TMTouchBit Overview Group

The TMTouchBit API call transmits the least significant bit of the variable 'outbit' on the 1-wire bus and concurrently receives a bit from the 1-wire bus. The received bit is the return value of the function. For a write operation, provide the bit to send in 'outbit'. For a read operation, where the 1-Wire device is sending a bit, provide 0x01 in the 'outbit'. This API call is mostly used for ROM search operations.

short far pascal TMTouchBit(
long session_handle,      // session handle for the desired 1-Wire network
short outbit              // bit to transfer to the 1-Wire network
);

For a description of the above types, see the TMEX Type Descriptions.

Parameters

session_handle

Specifies the session handle returned from the API function TMExtendedStartSession that specifies the desired 1-Wire network port. This parameter is required by most TMEX API functions.

outbit

Specifies the bit to transfer to the 1-Wire network. Concurrently, a bit is received from the 1-Wire network that is the return value of the API call.

Return Value

0,1 => bit returned from 1-Wire network while sending bit
0x01 => 1-wire bus is shorted
<0 => TMEX Hardware Specific Error Return Code

Code Example

See Also

TMSetup, TMTouchReset, TMTouchByte