Functions | |
int | DigitalOut_SetActive (int index, int state) |
Enable or disable a DigitalOut. | |
int | DigitalOut_GetActive (int index) |
Read whether a DigitalOut is active. | |
int | DigitalOut_SetValue (int index, int state) |
Turn a Digital Out on or off. | |
int | DigitalOut_GetValue (int index) |
Read whether a DigitalOut is on or off. |
If you've previously used any of the other systems on the outputs (steppers, motors, etc.), you'll need to set them to inactive to unlock the IO lines and use the Digital Outs.
See the Digital Out section of the Application Board overview for more details.
int DigitalOut_GetActive | ( | int | index | ) |
Read whether a DigitalOut is active.
index | An integer specifying which Digital Out (0-7). |
if( DigitalOut_GetActive( 5 ) ) { // DigitalOut 5 is active } else { // DigitalOut 5 is inactive }
Definition at line 140 of file digitalout.c.
int DigitalOut_GetValue | ( | int | index | ) |
Read whether a DigitalOut is on or off.
index | An integer specifying which Digital Out (0-7). |
if( DigitalOut_GetValue( 2 ) ) { // DigitalOut 2 is high } else { // DigitalOut 2 is low }
Definition at line 197 of file digitalout.c.
int DigitalOut_SetActive | ( | int | index, | |
int | state | |||
) |
Enable or disable a DigitalOut.
This is automatically called, setting the channel active, the first time DigitalOut_SetValue() is called. However, the channel must be explicitly set to inactive in order for any other devices to access the I/O lines.
index | An integer specifying which Digital Out (0-7). | |
state | An integer specifying the state - on (1) or off (0). |
// Enable DigitalOut 6 DigitalOut_SetActive( 6, 1 );
Definition at line 112 of file digitalout.c.
int DigitalOut_SetValue | ( | int | index, | |
int | state | |||
) |
Turn a Digital Out on or off.
index | An integer specifying which Digital Out (0-7). | |
state | An integer specifying the state - on (1) or off (0). |
// Turn digital out 2 on DigitalOut_SetValue( 2, 1 );
Definition at line 159 of file digitalout.c.