| aDigital_SetConfig | Index |
Definition:
| aErr aDigital_SetConfig( | aStemLib stemRef, const unsigned char module, const unsigned char nDigitalIndex, int nConfigValue); |
Parameters:
| stemRef | - | An opaque library reference representing the aStem library which manages the communication with the BrainStem modules. |
| module | - | The IIC address of the module that will receive new configuration data for one of its digital IO pins. This need not be the router. |
| nDigitalIndex | - | The index of the digital IO pin. |
| nConfigValue | - | Integer with the new configuration value. |
Return Value:
Description:
This routine manages the BrainStem packets needed to set the configuration byte of a digital IO pin. The following defined bit masks may be used to configure digital IO pins.
| aDIGITAL_INPUT | 1 | Set to make pin an input. Clear to make pin an output. |
| aDIGITAL_POLLENA | 2 | Set to enable transition polling for the pin. Clear to disable transition polling for the pin. |
| aDIGITAL_POLLHI | 4 | Set to trigger reflex on low-to-high transition when polling enabled. Clear to trigger reflex on high-to-low transition when polling enabled. |
| aDIGITAL_TMRHI | 8 | Set to measure high pulses or elapsed time till pin goes high. Clear to measure low pulses or elapsed time till pin goes low. |
| aDIGITAL_TMRWID | 16 | Set to make pin a pulse width timer. Clear to make pin an edge (elapsed time) timer. |
The defined value aDIGITAL_OUTPUT may be used by itself to configure a pin as an output. The timer flags are only relevant for inputs 1-4 on the BrainStem GP 1.0 Module.
Related: