Defines | |
#define | MXD2R_ADC_CHANNELS 3 |
#define | MXD2R_OPTO_INPUTS 0 |
#define | MXD2R_RELAYS 2 |
#define | mxd2rSetRly1(value) mxd2rSetRly(0, value) |
#define | mxd2rSetRly2(value) mxd2rSetRly(1, value) |
Functions | |
BYTE | mxd2rAddEvents (void) |
WORD | mxd2rGetAdc (BYTE chan) |
BYTE | mxd2rGetIO (void) |
BYTE | mxd2rGetRly (void) |
void | mxd2rInit (void) |
void | mxd2rService (void) |
void | mxd2rSetIO (BYTE ch, BOOL bVal) |
void | mxd2rSetRly (BYTE rly, BOOL bVal) |
Variables | |
WORD | mxd2rAdcValues [MXD2R_ADC_CHANNELS] |
//********************************************************************* //-------------- MXD2R Configuration -------------------- //********************************************************************* //Define ... //#define MXD2R_....
#define MXD2R_ADC_CHANNELS 3 |
#define MXD2R_OPTO_INPUTS 0 |
#define MXD2R_RELAYS 2 |
#define mxd2rSetRly1 | ( | value | ) | mxd2rSetRly(0, value) |
Set or clear relay1.
value | When 0, relay 1 is switched of. When 1, relay 1 is switched on |
#define mxd2rSetRly2 | ( | value | ) | mxd2rSetRly(1, value) |
Set or clear relay2.
value | When 0, relay 2 is switched of. When 1, relay 2 is switched on |
BYTE mxd2rAddEvents | ( | void | ) |
Check if any events occured, and add them to all active event ports.
Gets the requested 16 bit filtered ADC channel.
chan | The channel to get, a value from 1 to 5 for channels 1 to 5 of MXD2R |
BYTE mxd2rGetIO | ( | void | ) |
Gets the current state of all 6 IOs
BYTE mxd2rGetRly | ( | void | ) |
Gets the current state of both relays
void mxd2rInit | ( | void | ) |
Initialize the MXD2R module
void mxd2rService | ( | void | ) |
Service this module
Set or clear given IO port. Is only done if this IO port is current set as an ouput
ch | Offset of IO to perform action on. A value from 0-n. IO1 will be 0, IO2 will be 1, .... | |
bVal | When 0, relay is switched of. When 1, relay is switched on |
Set or clear given relay
rly | Offset of relay to perform action on. A value from 0-n. Relay 1 will be 0, relay 2 will be 1, .... | |
bVal | When 0, relay is switched of. When 1, relay is switched on |
WORD mxd2rAdcValues[MXD2R_ADC_CHANNELS] |
Global Array containing converted ADC values. This array can be accessed from anywhere to obtain the current value of the ADC inputs. For example, to get the current value of AN2 ADC, use mxd2rAdcValues[2]