Syntax
void OWIN (int
pin, int
out1,int
out2,int
out3,int
out4,int
out5, int
out6, int
cnt, char *
inList ) ;
Description
OWIN begins with a RESET/Presence sequence on the designated
Pin.
Then upto 6 Output bytes will be transfered to the device to select
the command. Byte values are sent out, if the value is -1, then that byte
is not sent.
Following that cnt bytes will be read into the character array
inList .
The bit order for the 1-Wire device is assumed to be LSB (bit 0) first.
Example
present =
OWOUT(7, 7, shortMessage);
if (present)
printf("one wire device found\n");
else {printf("***
NO one wire device ***\n"); break;}
OWIN(7, 0xCC, 0xAA, 0, -1, -1, -1, 4,
shortResponse);
for (i=0;
i<4; i++) if (shortMessage[i+3] != shortResponse[i])
break;
See also