USB GPIO Open Drain Mode December 5, 2011 at 1:32 pm
USB GPIO Open Drain Mode is used for connecting several output USB SPI/GPIO/I2C pins to one I/O line. Each of the USB-I2C/SPI/GPIO pin can be programmed, whether to output data or to input it.
An open drain terminal is connected to the ground, which has low voltage state (logic 0). And has high resistance in the high state (logic 1). And it prohibits the flow of data, so to avoid this, pull up resistors should be embedded or external connected to the positive voltage rail in the GPIO device. If all GPIO output pins will be in the high impedance, the pull up resistor will hold the wire in a high voltage. If one or more USB GPIO output pins are in the ground state, the pull up resistor pulls the line down into the low voltage state.
The DlnGpioPortSetCfg ( ) function can activate and deactivate the GPIO Open Drain.
To do it you must set handle and port values, as well as validFields, mask and config parameters.
The third bit in the validFields is a isOpenDrain field, where you can make open drain function valid, so you must change there 0 to 1. In such way, you make all pins open drained.
But if you want to activate GPIO Open Drain Mode for a single pin you can call the function DlnGpioPinOpendrainEnable ( ). To disable this mode for a single pin call the function DlnGpioPinOpendrainDisable ( ).
After reset, the open drain mode is disabled for all pins.
Leave a Reply