| Online Development Notebook > Index > ODN > USBm DLL Programming > Device Commands > DirectionA |
DirectionA
Description:
This is a USBm.dll function that sets the i⁄o direction of port A.
Command Syntax: (USBm.dll)
USBm_DirectionA(device, dir0, dir1)
The USBm_DirectionA function syntax has these parts:
| Part | Description |
| device | A zero-based index to address the appropriate USB device. |
| dir0 | Port direction. |
| dir1 | Port direction. |
Remarks:
The individual pins of the ports can be set to input, or output. Input is set when both bits associated with a particular line are set to 0. There are different types of outputs available for the board, but generally setting both of the direction bits to 1 will suffice.
To set all pins in the port to input, set dir0 = 00h and dir1 = 00h. To set the highest port pin to output set the highest bit in both registers, dir0 = 80h and dir1 = 80h.
VB Declaration
| Public Declare Function USBm_DirectionA _ Lib "USBm.dll" _ (ByVal device As Byte, _ ByVal dir0 As Byte, _ ByVal dir1 As Byte) _ As Integer |
VB Example
| USBm_DirectionA 1, 0, 0 |
This code fragment sets port A of device 1 to input.
C Example
-TBD-
| Hardware: U401 USB Interface U421 USB Interface |
| Programming: USBm DLL Programming Download Files |
| Application Notes: U4x1 Application Notes Misc Applications and Information FAQ |