![]() |
LPCOpen Platform for LPC112X microcontrollers
112X
LPCOpen Platform for the NXP LPC112X family of Microcontrollers
|
The LPC1125 ADC is different than other LPC11xx ADC peripherals and has a different API than the other LPC11xx ADC driver. The LCP1125 only supports ADC channels 1-8.
Data Structures | |
struct | LPC_ADC_T |
ADC register block structure. More... | |
Functions | |
void | Chip_ADC_Init (LPC_ADC_T *pADC, uint32_t flags) |
Initialize the ADC peripheral. More... | |
void | Chip_ADC_DeInit (LPC_ADC_T *pADC) |
Shutdown ADC. More... | |
STATIC INLINE void | Chip_ADC_SetDivider (LPC_ADC_T *pADC, uint8_t div) |
Set ADC divider. More... | |
void | Chip_ADC_SetClockRate (LPC_ADC_T *pADC, uint32_t rate) |
Set ADC clock rate. More... | |
STATIC INLINE uint8_t | Chip_ADC_GetDivider (LPC_ADC_T *pADC) |
Get ADC divider. More... | |
void | Chip_ADC_StartCalibration (LPC_ADC_T *pADC) |
Start ADC calibration. More... | |
STATIC INLINE bool | Chip_ADC_IsCalibrationDone (LPC_ADC_T *pADC) |
Start ADC calibration. More... | |
void | Chip_ADC_SetSequencerBits (LPC_ADC_T *pADC, ADC_SEQ_IDX_T seqIndex, uint32_t bits) |
Helper function for safely setting ADC sequencer register bits. More... | |
void | Chip_ADC_ClearSequencerBits (LPC_ADC_T *pADC, ADC_SEQ_IDX_T seqIndex, uint32_t bits) |
Helper function for safely clearing ADC sequencer register bits. More... | |
STATIC INLINE void | Chip_ADC_SetupSequencer (LPC_ADC_T *pADC, ADC_SEQ_IDX_T seqIndex, uint32_t options) |
Sets up ADC conversion sequencer A or B. More... | |
STATIC INLINE void | Chip_ADC_EnableSequencer (LPC_ADC_T *pADC, ADC_SEQ_IDX_T seqIndex) |
Enables a sequencer. More... | |
STATIC INLINE void | Chip_ADC_DisableSequencer (LPC_ADC_T *pADC, ADC_SEQ_IDX_T seqIndex) |
Disables a sequencer. More... | |
STATIC INLINE void | Chip_ADC_StartSequencer (LPC_ADC_T *pADC, ADC_SEQ_IDX_T seqIndex) |
Forces a sequencer trigger event (software trigger of ADC) More... | |
STATIC INLINE void | Chip_ADC_StartBurstSequencer (LPC_ADC_T *pADC, ADC_SEQ_IDX_T seqIndex) |
Starts sequencer burst mode. More... | |
STATIC INLINE void | Chip_ADC_StopBurstSequencer (LPC_ADC_T *pADC, ADC_SEQ_IDX_T seqIndex) |
Stops sequencer burst mode. More... | |
STATIC INLINE uint32_t | Chip_ADC_GetSequencerDataReg (LPC_ADC_T *pADC, ADC_SEQ_IDX_T seqIndex) |
Read a ADC sequence global data register. More... | |
STATIC INLINE uint32_t | Chip_ADC_GetDataReg (LPC_ADC_T *pADC, uint8_t index) |
Read a ADC data register. More... | |
STATIC INLINE void | Chip_ADC_SetThrLowValue (LPC_ADC_T *pADC, uint8_t thrnum, uint16_t value) |
Set Threshold low value in ADC. More... | |
STATIC INLINE void | Chip_ADC_SetThrHighValue (LPC_ADC_T *pADC, uint8_t thrnum, uint16_t value) |
Set Threshold high value in ADC. More... | |
void | Chip_ADC_SelectTH0Channels (LPC_ADC_T *pADC, uint32_t channels) |
Select threshold 0 values for comparison for selected channels. More... | |
void | Chip_ADC_SelectTH1Channels (LPC_ADC_T *pADC, uint32_t channels) |
Select threshold 1 value for comparison for selected channels. More... | |
void | Chip_ADC_EnableInt (LPC_ADC_T *pADC, uint32_t intMask) |
Enable interrupts in ADC (sequencers A/B and overrun) More... | |
void | Chip_ADC_DisableInt (LPC_ADC_T *pADC, uint32_t intMask) |
Disable interrupts in ADC (sequencers A/B and overrun) More... | |
void | Chip_ADC_SetThresholdInt (LPC_ADC_T *pADC, uint8_t ch, ADC_INTEN_THCMP_T thInt) |
Enable a threshold event interrupt in ADC. More... | |
STATIC INLINE uint32_t | Chip_ADC_GetFlags (LPC_ADC_T *pADC) |
Get flags register in ADC. More... | |
STATIC INLINE void | Chip_ADC_ClearFlags (LPC_ADC_T *pADC, uint32_t flags) |
Clear flags register in ADC. More... | |
STATIC INLINE void | Chip_ADC_SetTrim (LPC_ADC_T *pADC, uint32_t trim) |
Set Trim register in ADC. More... | |
#define ADC_CR_ASYNC_MODE (1 << 8) |
Asynchronous mode enable bit
Definition at line 82 of file adc_112x.h.
#define ADC_CR_BITACC | ( | n | ) | ((((n) & 0x1) << 9)) |
12-bit or 10-bit ADC accuracy
Definition at line 86 of file adc_112x.h.
#define ADC_CR_CALMODEBIT (1 << 30) |
Self calibration cycle enable bit
Definition at line 85 of file adc_112x.h.
#define ADC_CR_CLKDIV | ( | n | ) | ((((n) & 0xFF) << 0)) |
The APB clock (PCLK) is divided by (this value plus one) to produce the clock for the A/D
Definition at line 87 of file adc_112x.h.
#define ADC_CR_CLKDIV_BITPOS (0) |
Bit position for Clock divider value
Definition at line 81 of file adc_112x.h.
#define ADC_CR_CLKDIV_MASK (0xFF << 0) |
ADC register support bitfields and mask.
ADC Control register bit fields Mask for Clock divider value
Definition at line 80 of file adc_112x.h.
#define ADC_CR_LPWRMODEBIT (1 << 10) |
Low power mode enable bit
Definition at line 84 of file adc_112x.h.
#define ADC_CR_MODE10BIT (1 << 9) |
10-bit mode enable bit
Definition at line 83 of file adc_112x.h.
#define ADC_DR_CHAN_BITPOS (26) |
Channel number bit position
Definition at line 136 of file adc_112x.h.
#define ADC_DR_CHAN_MASK (0xF << 26) |
Channel number mask
Definition at line 135 of file adc_112x.h.
#define ADC_DR_CHANNEL | ( | n | ) | (((n) >> ADC_DR_CHAN_BITPOS) & 0xF) |
Channel number bit position
Definition at line 137 of file adc_112x.h.
#define ADC_DR_DATAVALID (1UL << 31) |
Data valid bit
Definition at line 139 of file adc_112x.h.
#define ADC_DR_DONE | ( | n | ) | (((n) >> 31)) |
Definition at line 140 of file adc_112x.h.
#define ADC_DR_OVERRUN (1 << 30) |
Overrun bit
Definition at line 138 of file adc_112x.h.
#define ADC_DR_RESULT | ( | n | ) | ((((n) >> 4) & 0xFFF)) |
ADC Data register bit fields Macro for getting the ADC data value
Definition at line 128 of file adc_112x.h.
#define ADC_DR_THCMPCROSS | ( | n | ) | (((n) >> ADC_DR_THCMPCROSS_BITPOS) & 0x3) |
Definition at line 134 of file adc_112x.h.
#define ADC_DR_THCMPCROSS_BITPOS (18) |
Comparison cross bit position
Definition at line 133 of file adc_112x.h.
#define ADC_DR_THCMPCROSS_MASK (0x3 << 18) |
Comparion cross mask
Definition at line 132 of file adc_112x.h.
#define ADC_DR_THCMPRANGE | ( | n | ) | (((n) >> ADC_DR_THCMPRANGE_BITPOS) & 0x3) |
Definition at line 131 of file adc_112x.h.
#define ADC_DR_THCMPRANGE_BITPOS (16) |
Comparison range bit position
Definition at line 130 of file adc_112x.h.
#define ADC_DR_THCMPRANGE_MASK (0x3 << 16) |
Comparion range mask
Definition at line 129 of file adc_112x.h.
#define ADC_FLAGS_OVRRUN_INT_MASK (1UL << 31) |
Overrun Interrupt status
Definition at line 170 of file adc_112x.h.
#define ADC_FLAGS_OVRRUN_MASK | ( | ch | ) | (1 << (12 + (ch))) |
Overrun status for channel
Definition at line 162 of file adc_112x.h.
#define ADC_FLAGS_SEQA_INT_MASK (1 << 28) |
Seq A Interrupt status
Definition at line 166 of file adc_112x.h.
#define ADC_FLAGS_SEQA_OVRRUN_MASK (1 << 24) |
Seq A Overrun status
Definition at line 163 of file adc_112x.h.
#define ADC_FLAGS_SEQB_INT_MASK (1 << 29) |
Seq B Interrupt status
Definition at line 167 of file adc_112x.h.
#define ADC_FLAGS_SEQB_OVRRUN_MASK (1 << 25) |
Seq B Overrun status
Definition at line 164 of file adc_112x.h.
#define ADC_FLAGS_SEQN_INT_MASK | ( | seq | ) | (1 << (28 + (seq))) |
Seq A/B Interrupt status
Definition at line 168 of file adc_112x.h.
#define ADC_FLAGS_SEQN_OVRRUN_MASK | ( | seq | ) | (1 << (24 + (seq))) |
Seq A/B Overrun status
Definition at line 165 of file adc_112x.h.
#define ADC_FLAGS_THCMP_INT_MASK (1 << 30) |
Threshold comparison Interrupt status
Definition at line 169 of file adc_112x.h.
#define ADC_FLAGS_THCMP_MASK | ( | ch | ) | (1 << (ch)) |
ADC Flags register bit fields Threshold comparison status for channel
Definition at line 161 of file adc_112x.h.
#define ADC_INTEN_CMP_CROSSTH (2) |
Crossing threshold interrupt value
Definition at line 156 of file adc_112x.h.
#define ADC_INTEN_CMP_DISBALE (0) |
Disable comparison interrupt value
Definition at line 154 of file adc_112x.h.
#define ADC_INTEN_CMP_ENABLE | ( | isel, | |
ch | |||
) | (((isel) & ADC_INTEN_CMP_MASK) << ((2 * (ch)) + 3)) |
Interrupt selection for channel
Definition at line 158 of file adc_112x.h.
#define ADC_INTEN_CMP_MASK (3) |
Comparison interrupt value mask
Definition at line 157 of file adc_112x.h.
#define ADC_INTEN_CMP_OUTSIDETH (1) |
Outside threshold interrupt value
Definition at line 155 of file adc_112x.h.
#define ADC_INTEN_OVRRUN_ENABLE (1 << 2) |
Overrun Interrupt enable bit
Definition at line 153 of file adc_112x.h.
#define ADC_INTEN_SEQA_ENABLE (1 << 0) |
ADC Interrupt Enable register bit fields Sequence A Interrupt enable bit
Definition at line 150 of file adc_112x.h.
#define ADC_INTEN_SEQB_ENABLE (1 << 1) |
Sequence B Interrupt enable bit
Definition at line 151 of file adc_112x.h.
#define ADC_INTEN_SEQN_ENABLE | ( | seq | ) | (1 << (seq)) |
Sequence A/B Interrupt enable bit
Definition at line 152 of file adc_112x.h.
#define ADC_MAX_SAMPLE_RATE 2000000 |
Maximum sample rate in Hz (12-bit conversions)
Definition at line 74 of file adc_112x.h.
#define ADC_SAMPLE_RATE_CONFIG_MASK (ADC_CR_CLKDIV(0xFF) | ADC_CR_BITACC(0x01)) |
Definition at line 88 of file adc_112x.h.
#define ADC_SEQ_CTRL_BURST (1 << 27) |
Repeated conversion enable bit
Definition at line 109 of file adc_112x.h.
#define ADC_SEQ_CTRL_CHANSEL | ( | n | ) | (1 << (n)) |
ADC Sequence Control register bit fields Channel select macro
Definition at line 91 of file adc_112x.h.
#define ADC_SEQ_CTRL_CHANSEL_MASK (0xFFF) |
Channel select mask
Definition at line 92 of file adc_112x.h.
#define ADC_SEQ_CTRL_HWTRIG_ARM_TXEV (0 << 12) |
ADC hardware trigger sources in SEQ_CTRL HW trigger input - ARM TXEV
Definition at line 95 of file adc_112x.h.
#define ADC_SEQ_CTRL_HWTRIG_CT16B1_MAT2 (2 << 12) |
HW trigger input - Match output 2 of CT16B1
Definition at line 97 of file adc_112x.h.
#define ADC_SEQ_CTRL_HWTRIG_CT16B1_MAT3 (1 << 12) |
HW trigger input - Match output 3 of CT16B1
Definition at line 96 of file adc_112x.h.
#define ADC_SEQ_CTRL_HWTRIG_MASK (0x3F << 12) |
HW trigger input bitfield mask
Definition at line 103 of file adc_112x.h.
#define ADC_SEQ_CTRL_HWTRIG_PIO0_2 (3 << 12) |
HW trigger input - PIO0_2
Definition at line 98 of file adc_112x.h.
#define ADC_SEQ_CTRL_HWTRIG_PIO0_7 (4 << 12) |
HW trigger input - PIO0_7
Definition at line 99 of file adc_112x.h.
#define ADC_SEQ_CTRL_HWTRIG_PIO0_8 (5 << 12) |
HW trigger input - PIO0_8
Definition at line 100 of file adc_112x.h.
#define ADC_SEQ_CTRL_HWTRIG_PIO0_9 (6 << 12) |
HW trigger input - PIO0_9
Definition at line 101 of file adc_112x.h.
#define ADC_SEQ_CTRL_HWTRIG_PIO2_0 (7 << 12) |
HW trigger input - PIO2_0
Definition at line 102 of file adc_112x.h.
#define ADC_SEQ_CTRL_HWTRIG_POLPOS (1 << 18) |
SEQ_CTRL register bit fields HW trigger polarity - positive edge
Definition at line 106 of file adc_112x.h.
#define ADC_SEQ_CTRL_HWTRIG_SYNCBYPASS (1 << 19) |
HW trigger bypass synchronisation
Definition at line 107 of file adc_112x.h.
#define ADC_SEQ_CTRL_LOWPRIO (1 << 29) |
High priority enable bit (regardless of name)
Definition at line 111 of file adc_112x.h.
#define ADC_SEQ_CTRL_MODE_EOS (1 << 30) |
Mode End of sequence enable bit
Definition at line 112 of file adc_112x.h.
#define ADC_SEQ_CTRL_SEQ_ENA (1UL << 31) |
Sequence enable bit
Definition at line 113 of file adc_112x.h.
#define ADC_SEQ_CTRL_SINGLESTEP (1 << 28) |
Single step enable bit
Definition at line 110 of file adc_112x.h.
#define ADC_SEQ_CTRL_START (1 << 26) |
Start conversion enable bit
Definition at line 108 of file adc_112x.h.
#define ADC_SEQ_GDAT_CHAN_BITPOS (26) |
Channel number bit position
Definition at line 123 of file adc_112x.h.
#define ADC_SEQ_GDAT_CHAN_MASK (0xF << 26) |
Channel number mask
Definition at line 122 of file adc_112x.h.
#define ADC_SEQ_GDAT_DATAVALID (1UL << 31) |
Data valid bit
Definition at line 125 of file adc_112x.h.
#define ADC_SEQ_GDAT_OVERRUN (1 << 30) |
Overrun bit
Definition at line 124 of file adc_112x.h.
#define ADC_SEQ_GDAT_RESULT_BITPOS (4) |
Result start bit position
Definition at line 117 of file adc_112x.h.
#define ADC_SEQ_GDAT_RESULT_MASK (0xFFF << 4) |
ADC global data register bit fields Result value mask
Definition at line 116 of file adc_112x.h.
#define ADC_SEQ_GDAT_THCMPCROSS_BITPOS (18) |
Comparison cross bit position
Definition at line 121 of file adc_112x.h.
#define ADC_SEQ_GDAT_THCMPCROSS_MASK (0x3 << 18) |
Comparion cross mask
Definition at line 120 of file adc_112x.h.
#define ADC_SEQ_GDAT_THCMPRANGE_BITPOS (16) |
Comparison range bit position
Definition at line 119 of file adc_112x.h.
#define ADC_SEQ_GDAT_THCMPRANGE_MASK (0x3 << 16) |
Comparion range mask
Definition at line 118 of file adc_112x.h.
#define ADC_THR_VAL_MASK (0xFFF << 4) |
ADC low/high Threshold register bit fields Threshold value bit mask
Definition at line 143 of file adc_112x.h.
#define ADC_THR_VAL_POS (4) |
Threshold value bit position
Definition at line 144 of file adc_112x.h.
#define ADC_THRSEL_CHAN_SEL_THR1 | ( | n | ) | (1 << (n)) |
ADC Threshold select register bit fields Select THR1 register for channel n
Definition at line 147 of file adc_112x.h.
#define ADC_TRIM_VRANGE_HIGHV (0 << 5) |
ADC Trim register bit fields Voltage range bit - High volatge (2.7V to 3.6V)
Definition at line 173 of file adc_112x.h.
#define ADC_TRIM_VRANGE_LOWV (1 << 5) |
Voltage range bit - Low volatge (1.8V to 2.7V)
Definition at line 174 of file adc_112x.h.
enum ADC_DR_THCMPCROSS_T |
ADC sequence global data register threshold comparison cross enumerations
Enumerator | |
---|---|
ADC_DR_THCMPCROSS_NOCROSS | |
ADC_DR_THCMPCROSS_RESERVED | |
ADC_DR_THCMPCROSS_DOWNWARD | |
ADC_DR_THCMPCROSS_UPWARD |
Definition at line 377 of file adc_112x.h.
enum ADC_DR_THCMPRANGE_T |
ADC sequence global data register threshold comparison range enumerations
Enumerator | |
---|---|
ADC_DR_THCMPRANGE_INRANGE | |
ADC_DR_THCMPRANGE_RESERVED | |
ADC_DR_THCMPRANGE_BELOW | |
ADC_DR_THCMPRANGE_ABOVE |
Definition at line 369 of file adc_112x.h.
enum ADC_INTEN_THCMP_T |
Threshold interrupt event options
Enumerator | |
---|---|
ADC_INTEN_THCMP_DISABLE | |
ADC_INTEN_THCMP_OUTSIDE | |
ADC_INTEN_THCMP_CROSSING |
Definition at line 495 of file adc_112x.h.
enum ADC_SEQ_IDX_T |
Sequence index enumerations, used in various parts of the code for register indexing and sequencer selection
Enumerator | |
---|---|
ADC_SEQA_IDX | |
ADC_SEQB_IDX |
Definition at line 49 of file adc_112x.h.
Clear flags register in ADC.
pADC | : The base of ADC peripheral on the chip |
flags | : An Or'ed values of ADC_FLAGS_* values to clear |
Definition at line 530 of file adc_112x.h.
void Chip_ADC_ClearSequencerBits | ( | LPC_ADC_T * | pADC, |
ADC_SEQ_IDX_T | seqIndex, | ||
uint32_t | bits | ||
) |
Helper function for safely clearing ADC sequencer register bits.
pADC | : The base of ADC peripheral on the chip |
seqIndex | : Sequencer to clear bits for |
bits | : Or'ed bits of a sequencer register to clear |
Definition at line 173 of file adc_112x.c.
void Chip_ADC_DeInit | ( | LPC_ADC_T * | pADC | ) |
Shutdown ADC.
pADC | : The base of ADC peripheral on the chip |
Definition at line 116 of file adc_112x.c.
void Chip_ADC_DisableInt | ( | LPC_ADC_T * | pADC, |
uint32_t | intMask | ||
) |
Disable interrupts in ADC (sequencers A/B and overrun)
pADC | : The base of ADC peripheral on the chip |
intMask | : Interrupt values to be disabled (see notes) |
Definition at line 191 of file adc_112x.c.
STATIC INLINE void Chip_ADC_DisableSequencer | ( | LPC_ADC_T * | pADC, |
ADC_SEQ_IDX_T | seqIndex | ||
) |
Disables a sequencer.
pADC | : The base of ADC peripheral on the chip |
seqIndex | : Sequencer to disable |
Definition at line 325 of file adc_112x.h.
void Chip_ADC_EnableInt | ( | LPC_ADC_T * | pADC, |
uint32_t | intMask | ||
) |
Enable interrupts in ADC (sequencers A/B and overrun)
pADC | : The base of ADC peripheral on the chip |
intMask | : Interrupt values to be enabled (see notes) |
Definition at line 185 of file adc_112x.c.
STATIC INLINE void Chip_ADC_EnableSequencer | ( | LPC_ADC_T * | pADC, |
ADC_SEQ_IDX_T | seqIndex | ||
) |
Enables a sequencer.
pADC | : The base of ADC peripheral on the chip |
seqIndex | : Sequencer to enable |
Definition at line 314 of file adc_112x.h.
Read a ADC data register.
pADC | : The base of ADC peripheral on the chip |
index | : Data register to read, 1-8 |
Definition at line 421 of file adc_112x.h.
Get ADC divider.
pADC | : The base of ADC peripheral on the chip |
Definition at line 233 of file adc_112x.h.
Get flags register in ADC.
pADC | : The base of ADC peripheral on the chip |
Definition at line 519 of file adc_112x.h.
STATIC INLINE uint32_t Chip_ADC_GetSequencerDataReg | ( | LPC_ADC_T * | pADC, |
ADC_SEQ_IDX_T | seqIndex | ||
) |
Read a ADC sequence global data register.
pADC | : The base of ADC peripheral on the chip |
seqIndex | : Sequencer to read |
Definition at line 400 of file adc_112x.h.
void Chip_ADC_Init | ( | LPC_ADC_T * | pADC, |
uint32_t | flags | ||
) |
Initialize the ADC peripheral.
pADC | : The base of ADC peripheral on the chip |
flags | : ADC flags for init (ADC_CR_MODE10BIT and/or ADC_CR_LPWRMODEBIT) |
Definition at line 99 of file adc_112x.c.
Start ADC calibration.
pADC | : The base of ADC peripheral on the chip |
Definition at line 253 of file adc_112x.h.
void Chip_ADC_SelectTH0Channels | ( | LPC_ADC_T * | pADC, |
uint32_t | channels | ||
) |
Select threshold 0 values for comparison for selected channels.
pADC | : The base of ADC peripheral on the chip |
channels | : An OR'ed value of one or more ADC_THRSEL_CHAN_SEL_THR1(ch) values |
Definition at line 209 of file adc_112x.c.
void Chip_ADC_SelectTH1Channels | ( | LPC_ADC_T * | pADC, |
uint32_t | channels | ||
) |
Select threshold 1 value for comparison for selected channels.
pADC | : The base of ADC peripheral on the chip |
channels | : An OR'ed value of one or more ADC_THRSEL_CHAN_SEL_THR1(ch) values |
Definition at line 215 of file adc_112x.c.
void Chip_ADC_SetClockRate | ( | LPC_ADC_T * | pADC, |
uint32_t | rate | ||
) |
Set ADC clock rate.
pADC | : The base of ADC peripheral on the chip |
rate | : rate in Hz to set ADC clock to (maximum ADC_MAX_SAMPLE_RATE) |
Definition at line 127 of file adc_112x.c.
Set ADC divider.
pADC | : The base of ADC peripheral on the chip |
div | : ADC divider value to set minus 1 |
Definition at line 208 of file adc_112x.h.
void Chip_ADC_SetSequencerBits | ( | LPC_ADC_T * | pADC, |
ADC_SEQ_IDX_T | seqIndex, | ||
uint32_t | bits | ||
) |
Helper function for safely setting ADC sequencer register bits.
pADC | : The base of ADC peripheral on the chip |
seqIndex | : Sequencer to set bits for |
bits | : Or'ed bits of a sequencer register to set |
Definition at line 161 of file adc_112x.c.
void Chip_ADC_SetThresholdInt | ( | LPC_ADC_T * | pADC, |
uint8_t | ch, | ||
ADC_INTEN_THCMP_T | thInt | ||
) |
Enable a threshold event interrupt in ADC.
pADC | : The base of ADC peripheral on the chip |
ch | : ADC channel to set threshold inetrrupt for, 1-8 |
thInt | : Selected threshold interrupt type |
Definition at line 197 of file adc_112x.c.
Set Threshold high value in ADC.
pADC | : The base of ADC peripheral on the chip |
thrnum | : Threshold register value (1 for threshold register 1, 0 for threshold register 0) |
value | : Threshold high data value (should be 12-bit value) |
Definition at line 445 of file adc_112x.h.
Set Threshold low value in ADC.
pADC | : The base of ADC peripheral on the chip |
thrnum | : Threshold register value (1 for threshold register 1, 0 for threshold register 0) |
value | : Threshold low data value (should be 12-bit value) |
Definition at line 433 of file adc_112x.h.
Set Trim register in ADC.
pADC | : The base of ADC peripheral on the chip |
trim | : Trim value (ADC_TRIM_VRANGE_HIGHV or ADC_TRIM_VRANGE_LOWV) |
Definition at line 541 of file adc_112x.h.
STATIC INLINE void Chip_ADC_SetupSequencer | ( | LPC_ADC_T * | pADC, |
ADC_SEQ_IDX_T | seqIndex, | ||
uint32_t | options | ||
) |
Sets up ADC conversion sequencer A or B.
pADC | : The base of ADC peripheral on the chip |
seqIndex | : Sequencer to setup |
options | : OR'ed Sequencer options to setup (see notes) |
Definition at line 303 of file adc_112x.h.
STATIC INLINE void Chip_ADC_StartBurstSequencer | ( | LPC_ADC_T * | pADC, |
ADC_SEQ_IDX_T | seqIndex | ||
) |
Starts sequencer burst mode.
pADC | : The base of ADC peripheral on the chip |
seqIndex | : Sequencer to start burst on |
Definition at line 352 of file adc_112x.h.
void Chip_ADC_StartCalibration | ( | LPC_ADC_T * | pADC | ) |
Start ADC calibration.
pADC | : The base of ADC peripheral on the chip |
Definition at line 143 of file adc_112x.c.
STATIC INLINE void Chip_ADC_StartSequencer | ( | LPC_ADC_T * | pADC, |
ADC_SEQ_IDX_T | seqIndex | ||
) |
Forces a sequencer trigger event (software trigger of ADC)
pADC | : The base of ADC peripheral on the chip |
seqIndex | : Sequencer to start |
Definition at line 338 of file adc_112x.h.
STATIC INLINE void Chip_ADC_StopBurstSequencer | ( | LPC_ADC_T * | pADC, |
ADC_SEQ_IDX_T | seqIndex | ||
) |
Stops sequencer burst mode.
pADC | : The base of ADC peripheral on the chip |
seqIndex | : Sequencer to stop burst on |
Definition at line 363 of file adc_112x.h.