Online Development Notebook > Index > ODN > USBm DLL Programming > Device Commands > Read1WireBit

Read1WireBit


VERSION 1.46+ of the firmware, VERSION 58+ of the DLL

Description:

This is a USBm.dll function to send a 1-wire (MicroLAN) bit read on the previously selected port pin.

 

Command Syntax: (USBm.dll)

USBm_Reset1WireBit(device, data )

The USBm_Reset1WireBit function syntax has these parts:

Part Description
device A zero-based index to address the appropriate USB device.
data The function causes this variable to be changed to the value read from the bus (00h for a bit value of 0, and a value that is not 00h for a bit value of 1).

 

Remarks:

This command does not set the port direction pins or select the pin to use as the 1-wire bus - it is the Reset1Wire command that does this.

 

VB Declaration

Public Declare Function USBm_Read1WireBit _
    Lib "USBm.dll" _
        (ByVal device As Byte, _
               ByRef data As Byte)_
   As Integer

 

VB Example

Dim data As Byte
    USBm_Read1WireBit 3, data

This code fragment addresses U4x1 device #3, and reads a bit from the 1-wire device. The read value is in "data". 00h for a bit value of 0, and a value that is not 00h for a bit value of 1

 

C Prototype

int USBm_Read1WireBit (unsigned char device, unsigned char data);

 

C Example

USBm_Read1WireBit ( 3, data );

This code fragment addresses U4x1 device #3, and reads a bit from the 1-wire device. The read value is in "data". 00h for a bit value of 0, and a value that is not 00h for a bit value of 1


Hardware:  U401 USB Interface    U421 USB Interface
Programming:  USBm DLL Programming    Download Files
Application Notes:  U4x1 Application Notes    Misc Applications and Information    FAQ