Data Structures |
struct | ADConfiguration |
| storing of AD configuration data More...
|
Defines |
#define | MAX_CH 16 |
#define | ADCINA0 0 |
#define | ADCINA1 1 |
#define | ADCINA2 2 |
#define | ADCINA3 3 |
#define | ADCINA4 4 |
#define | ADCINA5 5 |
#define | ADCINA6 6 |
#define | ADCINA7 7 |
#define | ADCINB0 8 |
#define | ADCINB1 9 |
#define | ADCINB2 10 |
#define | ADCINB3 11 |
#define | ADCINB4 12 |
#define | ADCINB5 13 |
#define | ADCINB6 14 |
#define | ADCINB7 15 |
#define | CH0_RAW ((AdcRegs.ADCRESULT0 & 0xFFF0) >> 4) |
#define | CH1_RAW ((AdcRegs.ADCRESULT1 & 0xFFF0) >> 4) |
#define | CH2_RAW ((AdcRegs.ADCRESULT2 & 0xFFF0) >> 4) |
#define | CH3_RAW ((AdcRegs.ADCRESULT3 & 0xFFF0) >> 4) |
#define | CH4_RAW ((AdcRegs.ADCRESULT4 & 0xFFF0) >> 4) |
#define | CH5_RAW ((AdcRegs.ADCRESULT5 & 0xFFF0) >> 4) |
#define | CH6_RAW ((AdcRegs.ADCRESULT6 & 0xFFF0) >> 4) |
#define | CH7_RAW ((AdcRegs.ADCRESULT7 & 0xFFF0) >> 4) |
#define | CH8_RAW ((AdcRegs.ADCRESULT8 & 0xFFF0) >> 4) |
#define | CH9_RAW ((AdcRegs.ADCRESULT9 & 0xFFF0) >> 4) |
#define | CH10_RAW ((AdcRegs.ADCRESULT10 & 0xFFF0) >> 4) |
#define | CH11_RAW ((AdcRegs.ADCRESULT11 & 0xFFF0) >> 4) |
#define | CH12_RAW ((AdcRegs.ADCRESULT12 & 0xFFF0) >> 4) |
#define | CH13_RAW ((AdcRegs.ADCRESULT13 & 0xFFF0) >> 4) |
#define | CH14_RAW ((AdcRegs.ADCRESULT14 & 0xFFF0) >> 4) |
#define | CH15_RAW ((AdcRegs.ADCRESULT15 & 0xFFF0) >> 4) |
#define | CH0_RAW_MIRROW (AdcMirror.ADCRESULT0) |
#define | CH1_RAW_MIRROW (AdcMirror.ADCRESULT1) |
#define | CH2_RAW_MIRROW (AdcMirror.ADCRESULT2) |
#define | CH3_RAW_MIRROW (AdcMirror.ADCRESULT3) |
#define | CH4_RAW_MIRROW (AdcMirror.ADCRESULT4) |
#define | CH5_RAW_MIRROW (AdcMirror.ADCRESULT5) |
#define | CH6_RAW_MIRROW (AdcMirror.ADCRESULT6) |
#define | CH7_RAW_MIRROW (AdcMirror.ADCRESULT7) |
#define | CH8_RAW_MIRROW (AdcMirror.ADCRESULT8) |
#define | CH9_RAW_MIRROW (AdcMirror.ADCRESULT9) |
#define | CH10_RAW_MIRROW (AdcMirror.ADCRESULT10) |
#define | CH11_RAW_MIRROW (AdcMirror.ADCRESULT11) |
#define | CH12_RAW_MIRROW (AdcMirror.ADCRESULT12) |
#define | CH13_RAW_MIRROW (AdcMirror.ADCRESULT13) |
#define | CH14_RAW_MIRROW (AdcMirror.ADCRESULT14) |
#define | CH15_RAW_MIRROW (AdcMirror.ADCRESULT15) |
#define | BITS2VOLTS(bits) ((bits >> 12)*3 + ADCLO) |
#define | VOLTS2BITS(volts) (4096/3*(volts - ADCLO)) |
#define | AD_ORIGIN (2048) |
Enumerations |
enum | SAMPLING_MODE { CASCADED_MODE = 0,
SIMULTANEOUS_MODE = 1
} |
| sampling mode configuration
More...
|
enum | SEQ_MODE { INDEPENDENT_SEQ_MODE = 0,
CASCADED_SEQ_MODE = 1
} |
| sequence mode configuration
More...
|
enum | SOC_MODE { PWM_SOC = (int)0x8901,
GPIO_SOC = 0x0080,
SW_SOC = 0x0000
} |
| start of conversion (SOC) configuration
More...
|
enum | POLARITY { UNIPOLAR = 0,
BIPOLAR = 1
} |
| input polarity configuration
More...
|
Functions |
void | ConfigureAD (void(*interruptFCN)(void), _iq fAD, Uint16 tSH, SEQ_MODE seqMode, SAMPLING_MODE samplingMode, SOC_MODE socMode, Uint16 offtrim) |
void | AddChannel (Uint16 input, Uint16 channel, _iq offset, _iq gain) |
void | AddUnipolarChannel (Uint16 input, Uint16 channel, _iq offset, _iq gain) |
void | InitAD (void) |
| Initializes AD circuits.
|
void | InitADPeripheralClocks (void) |
| Initializes AD clock.
|
static void | ReinitADSEQ1 (void) |
| Prepare AD SEQ1 for next acquisition: Reset SEQ1, clear INT SEQ1, ACK int to PIE.
|
static void | ReinitADSEQ2 (void) |
| Prepare AD SEQ2 for next acquisition: Reset SEQ2, clear INT SEQ2, ACK int to PIE.
|
static void | SetTrigger (void) |
| Trigger to enable internal memory writing.
|
static void | ResetTrigger (void) |
| Reset trigger for internal memory writing.
|
static Uint16 | ReadADChannelRaw (Uint16 channel) |
| Read raw channel (position in CONV).
|
static Uint16 | ReadADInputRaw (Uint16 input) |
| Read raw input (physical ADINPUT).
|
static Uint16 | ReadADChannelRawWriteRaw (Uint16 channel) |
| Read channel in raw and writes raw values.
|
static Uint16 | ReadADInputRawWriteRaw (Uint16 input) |
| Read input in raw and writes raw values.
|
static _iq | ReadADInput (Uint16 input) |
| Read channel with specified gain and offset.
|
static _iq | ReadADInputWriteRaw (Uint16 input) |
| Read channel with specified gain and offset and write raw to memory.
|
static void | ReadADSimultaneousInputWriteRaw (Uint16 aInput, Uint16 bInput, volatile _iq *aVal, volatile _iq *bVal) |
static _iq | Bits2Units (Uint16 rawVal, Uint16 input) |
Variables |
struct ADConfiguration | adConfiguration |
AD Routines.
This module allows to program the AD converter. Supported functions include the configuration of the channel list, read of values both in raw or physical units and storage of read values in memory.