IADC - Incremental ADC#
Incremental Analog to Digital Converter (IADC) Peripheral API.
This module contains functions to control the IADC peripheral of Silicon Labs 32-bit MCUs and SoCs. The IADC is used to convert analog signals into a digital representation.
Modules#
Enumerations#
Warm-up mode.
IADC result alignment.
IADC negative input selection.
IADC positive port selection.
IADC Commands.
IADC Configuration.
IADC Over sampling rate for high speed.
IADC Over sampling rate for high accuracy.
IADC Analog Gain.
IADC Reference.
IADC Two's complement results.
IADC trigger action.
IADC trigger action.
IADC data valid level before requesting DMA transfer.
IADC digital averaging function.
Functions#
Initialize IADC.
Initialize IADC scan sequence.
Initialize single IADC conversion.
Update IADC single input selection.
Set mask of IADC scan table entries to include in scan.
Add/update entry in scan table.
Reset IADC to same state as after a HW reset.
Calculate timebase value in order to get a timebase providing at least 1us.
Calculate prescaler for CLK_SRC_ADC high speed clock.
Calculate prescaler for ADC_CLK clock.
Pull result from single data FIFO.
Read most recent single conversion result.
Pull result from scan data FIFO.
Read most recent scan conversion result.
Get reference voltage selection.
Pull data from single data FIFO.
Read most recent single conversion data.
Pull data from scan data FIFO.
Read most recent scan conversion data.
Clear one or more pending IADC interrupts.
Disable one or more IADC interrupts.
Enable one or more IADC interrupts.
Get pending IADC interrupt flags.
Get enabled and pending IADC interrupt flags.
Set one or more pending IADC interrupts from SW.
Start/stop scan sequence, single conversion and/or timer.
Get the scan mask currently used in the IADC.
Get status bits of IADC.
Get the number of elements in the IADC single FIFO.
Get the number of elements in the IADC scan FIFO.
Convert the GPIO port/pin to IADC negative input selection.
Convert the GPIO port/pin to IADC positive input selection.
Macros#
Default config for IADC init structure.
Default IADC config structure.
Default IADC sructure for all configs.
Default config for IADC scan init structure.
Default config for IADC single init structure.
Default config for IADC single input structure.
Default config for IADC scan table entry structure.
Default IADC structure for scan table.
Enumeration Documentation#
IADC_Warmup_t#
IADC_Warmup_t
Warm-up mode.
Enumerator | |
---|---|
iadcWarmupNormal | IADC shutdown after each conversion. |
iadcWarmupKeepInStandby | ADC is kept in standby mode between conversion. |
iadcWarmupKeepWarm | ADC and reference selected for scan mode kept warmup, allowing continuous conversion. |
55
of file platform/emlib/inc/em_iadc.h
IADC_Alignment_t#
IADC_Alignment_t
IADC result alignment.
Enumerator | |
---|---|
iadcAlignRight12 | IADC results 12-bit right aligned |
iadcAlignLeft12 | IADC results 12-bit left aligned |
iadcAlignRight16 | IADC results 16-bit right aligned |
iadcAlignLeft16 | IADC results 16-bit left aligned |
iadcAlignRight20 | IADC results 20-bit right aligned |
iadcAlignLeft20 | IADC results 20-bit left aligned |
68
of file platform/emlib/inc/em_iadc.h
IADC_NegInput_t#
IADC_NegInput_t
IADC negative input selection.
Enumerator | |
---|---|
iadcNegInputGnd | Ground |
iadcNegInputGndaux | Ground using even mux. |
iadcNegInputDac1 | Direct connection to DAC_1 input pin. |
iadcNegInputPadAna1 | Direct connection to Pad_ana_1 input pin. |
iadcNegInputPortAPin0 | GPIO port A pin 0. |
iadcNegInputPortAPin1 | GPIO port A pin 1. |
iadcNegInputPortAPin2 | GPIO port A pin 2. |
iadcNegInputPortAPin3 | GPIO port A pin 3. |
iadcNegInputPortAPin4 | GPIO port A pin 4. |
iadcNegInputPortAPin5 | GPIO port A pin 5. |
iadcNegInputPortAPin6 | GPIO port A pin 6. |
iadcNegInputPortAPin7 | GPIO port A pin 7. |
iadcNegInputPortAPin8 | GPIO port A pin 8. |
iadcNegInputPortAPin9 | GPIO port A pin 9. |
iadcNegInputPortAPin10 | GPIO port A pin 10. |
iadcNegInputPortAPin11 | GPIO port A pin 11. |
iadcNegInputPortAPin12 | GPIO port A pin 12. |
iadcNegInputPortAPin13 | GPIO port A pin 13. |
iadcNegInputPortAPin14 | GPIO port A pin 14. |
iadcNegInputPortAPin15 | GPIO port A pin 15. |
iadcNegInputPortBPin0 | GPIO port B pin 0. |
iadcNegInputPortBPin1 | GPIO port B pin 1. |
iadcNegInputPortBPin2 | GPIO port B pin 2. |
iadcNegInputPortBPin3 | GPIO port B pin 3. |
iadcNegInputPortBPin4 | GPIO port B pin 4. |
iadcNegInputPortBPin5 | GPIO port B pin 5. |
iadcNegInputPortBPin6 | GPIO port B pin 6. |
iadcNegInputPortBPin7 | GPIO port B pin 7. |
iadcNegInputPortBPin8 | GPIO port B pin 8. |
iadcNegInputPortBPin9 | GPIO port B pin 9. |
iadcNegInputPortBPin10 | GPIO port B pin 10. |
iadcNegInputPortBPin11 | GPIO port B pin 11. |
iadcNegInputPortBPin12 | GPIO port B pin 12. |
iadcNegInputPortBPin13 | GPIO port B pin 13. |
iadcNegInputPortBPin14 | GPIO port B pin 14. |
iadcNegInputPortBPin15 | GPIO port B pin 15. |
iadcNegInputPortCPin0 | GPIO port C pin 0. |
iadcNegInputPortCPin1 | GPIO port C pin 1. |
iadcNegInputPortCPin2 | GPIO port C pin 2. |
iadcNegInputPortCPin3 | GPIO port C pin 3. |
iadcNegInputPortCPin4 | GPIO port C pin 4. |
iadcNegInputPortCPin5 | GPIO port C pin 5. |
iadcNegInputPortCPin6 | GPIO port C pin 6. |
iadcNegInputPortCPin7 | GPIO port C pin 7. |
iadcNegInputPortCPin8 | GPIO port C pin 8. |
iadcNegInputPortCPin9 | GPIO port C pin 9. |
iadcNegInputPortCPin10 | GPIO port C pin 10. |
iadcNegInputPortCPin11 | GPIO port C pin 11. |
iadcNegInputPortCPin12 | GPIO port C pin 12. |
iadcNegInputPortCPin13 | GPIO port C pin 13. |
iadcNegInputPortCPin14 | GPIO port C pin 14. |
iadcNegInputPortCPin15 | GPIO port C pin 15. |
iadcNegInputPortDPin0 | GPIO port D pin 0. |
iadcNegInputPortDPin1 | GPIO port D pin 1. |
iadcNegInputPortDPin2 | GPIO port D pin 2. |
iadcNegInputPortDPin3 | GPIO port D pin 3. |
iadcNegInputPortDPin4 | GPIO port D pin 4. |
iadcNegInputPortDPin5 | GPIO port D pin 5. |
iadcNegInputPortDPin6 | GPIO port D pin 6. |
iadcNegInputPortDPin7 | GPIO port D pin 7. |
iadcNegInputPortDPin8 | GPIO port D pin 8. |
iadcNegInputPortDPin9 | GPIO port D pin 9. |
iadcNegInputPortDPin10 | GPIO port D pin 10. |
iadcNegInputPortDPin11 | GPIO port D pin 11. |
iadcNegInputPortDPin12 | GPIO port D pin 12. |
iadcNegInputPortDPin13 | GPIO port D pin 13. |
iadcNegInputPortDPin14 | GPIO port D pin 14. |
iadcNegInputPortDPin15 | GPIO port D pin 15. |
93
of file platform/emlib/inc/em_iadc.h
IADC_PosInput_t#
IADC_PosInput_t
IADC positive port selection.
Enumerator | |
---|---|
iadcPosInputGnd | Ground |
iadcPosInputAvdd | Avdd / 4 |
iadcPosInputVddio | Vddio / 4 |
iadcPosInputVss | Vss |
iadcPosInputVssaux | Vss |
iadcPosInputDvdd | Dvdd / 4 |
iadcPosInputDecouple | Decouple |
iadcPosInputDac0 | Direct connection to DAC_0 input pin. |
iadcPosInputPadAna0 | Direct connection to Pad_ana_0 input pin. |
iadcPosInputPortAPin0 | GPIO port A pin 0. |
iadcPosInputPortAPin1 | GPIO port A pin 1. |
iadcPosInputPortAPin2 | GPIO port A pin 2. |
iadcPosInputPortAPin3 | GPIO port A pin 3. |
iadcPosInputPortAPin4 | GPIO port A pin 4. |
iadcPosInputPortAPin5 | GPIO port A pin 5. |
iadcPosInputPortAPin6 | GPIO port A pin 6. |
iadcPosInputPortAPin7 | GPIO port A pin 7. |
iadcPosInputPortAPin8 | GPIO port A pin 8. |
iadcPosInputPortAPin9 | GPIO port A pin 9. |
iadcPosInputPortAPin10 | GPIO port A pin 10. |
iadcPosInputPortAPin11 | GPIO port A pin 11. |
iadcPosInputPortAPin12 | GPIO port A pin 12. |
iadcPosInputPortAPin13 | GPIO port A pin 13. |
iadcPosInputPortAPin14 | GPIO port A pin 14. |
iadcPosInputPortAPin15 | GPIO port A pin 15. |
iadcPosInputPortBPin0 | GPIO port B pin 0. |
iadcPosInputPortBPin1 | GPIO port B pin 1. |
iadcPosInputPortBPin2 | GPIO port B pin 2. |
iadcPosInputPortBPin3 | GPIO port B pin 3. |
iadcPosInputPortBPin4 | GPIO port B pin 4. |
iadcPosInputPortBPin5 | GPIO port B pin 5. |
iadcPosInputPortBPin6 | GPIO port B pin 6. |
iadcPosInputPortBPin7 | GPIO port B pin 7. |
iadcPosInputPortBPin8 | GPIO port B pin 8. |
iadcPosInputPortBPin9 | GPIO port B pin 9. |
iadcPosInputPortBPin10 | GPIO port B pin 10. |
iadcPosInputPortBPin11 | GPIO port B pin 11. |
iadcPosInputPortBPin12 | GPIO port B pin 12. |
iadcPosInputPortBPin13 | GPIO port B pin 13. |
iadcPosInputPortBPin14 | GPIO port B pin 14. |
iadcPosInputPortBPin15 | GPIO port B pin 15. |
iadcPosInputPortCPin0 | GPIO port C pin 0. |
iadcPosInputPortCPin1 | GPIO port C pin 1. |
iadcPosInputPortCPin2 | GPIO port C pin 2. |
iadcPosInputPortCPin3 | GPIO port C pin 3. |
iadcPosInputPortCPin4 | GPIO port C pin 4. |
iadcPosInputPortCPin5 | GPIO port C pin 5. |
iadcPosInputPortCPin6 | GPIO port C pin 6. |
iadcPosInputPortCPin7 | GPIO port C pin 7. |
iadcPosInputPortCPin8 | GPIO port C pin 8. |
iadcPosInputPortCPin9 | GPIO port C pin 9. |
iadcPosInputPortCPin10 | GPIO port C pin 10. |
iadcPosInputPortCPin11 | GPIO port C pin 11. |
iadcPosInputPortCPin12 | GPIO port C pin 12. |
iadcPosInputPortCPin13 | GPIO port C pin 13. |
iadcPosInputPortCPin14 | GPIO port C pin 14. |
iadcPosInputPortCPin15 | GPIO port C pin 15. |
iadcPosInputPortDPin0 | GPIO port D pin 0. |
iadcPosInputPortDPin1 | GPIO port D pin 1. |
iadcPosInputPortDPin2 | GPIO port D pin 2. |
iadcPosInputPortDPin3 | GPIO port D pin 3. |
iadcPosInputPortDPin4 | GPIO port D pin 4. |
iadcPosInputPortDPin5 | GPIO port D pin 5. |
iadcPosInputPortDPin6 | GPIO port D pin 6. |
iadcPosInputPortDPin7 | GPIO port D pin 7. |
iadcPosInputPortDPin8 | GPIO port D pin 8. |
iadcPosInputPortDPin9 | GPIO port D pin 9. |
iadcPosInputPortDPin10 | GPIO port D pin 10. |
iadcPosInputPortDPin11 | GPIO port D pin 11. |
iadcPosInputPortDPin12 | GPIO port D pin 12. |
iadcPosInputPortDPin13 | GPIO port D pin 13. |
iadcPosInputPortDPin14 | GPIO port D pin 14. |
iadcPosInputPortDPin15 | GPIO port D pin 15. |
310
of file platform/emlib/inc/em_iadc.h
IADC_Cmd_t#
IADC_Cmd_t
IADC Commands.
Enumerator | |
---|---|
iadcCmdStartSingle | Start single queue |
iadcCmdStopSingle | Stop single queue |
iadcCmdStartScan | Start scan queue |
iadcCmdStopScan | Stop scan queue |
iadcCmdEnableTimer | Enable Timer |
iadcCmdDisableTimer | Disable Timer |
559
of file platform/emlib/inc/em_iadc.h
IADC_CfgAdcMode_t#
IADC_CfgAdcMode_t
IADC Configuration.
Enumerator | |
---|---|
iadcCfgModeNormal | Normal mode |
iadcCfgModeHighSpeed | High Speed mode |
iadcCfgModeHighAccuracy | High Accuracy mode |
580
of file platform/emlib/inc/em_iadc.h
IADC_CfgOsrHighSpeed_t#
IADC_CfgOsrHighSpeed_t
IADC Over sampling rate for high speed.
Enumerator | |
---|---|
iadcCfgOsrHighSpeed2x | High speed oversampling of 2x. |
iadcCfgOsrHighSpeed4x | High speed oversampling of 4x. |
iadcCfgOsrHighSpeed8x | High speed oversampling of 8x. |
iadcCfgOsrHighSpeed16x | High speed oversampling of 16x. |
iadcCfgOsrHighSpeed32x | High speed oversampling of 32x. |
iadcCfgOsrHighSpeed64x | High speed oversampling of 64x. |
594
of file platform/emlib/inc/em_iadc.h
IADC_CfgOsrHighAccuracy_t#
IADC_CfgOsrHighAccuracy_t
IADC Over sampling rate for high accuracy.
Enumerator | |
---|---|
iadcCfgOsrHighAccuracy16x | High accuracy oversampling of 16x. |
iadcCfgOsrHighAccuracy32x | High accuracy oversampling of 32x. |
iadcCfgOsrHighAccuracy64x | High accuracy oversampling of 64x. |
iadcCfgOsrHighAccuracy92x | High accuracy oversampling of 92x. |
iadcCfgOsrHighAccuracy128x | High accuracy oversampling of 128x. |
iadcCfgOsrHighAccuracy256x | High accuracy oversampling of 256x. |
616
of file platform/emlib/inc/em_iadc.h
IADC_CfgAnalogGain_t#
IADC_CfgAnalogGain_t
IADC Analog Gain.
Enumerator | |
---|---|
iadcCfgAnalogGain0P5x | Analog gain of 0.5x. |
iadcCfgAnalogGain1x | Analog gain of 1x. |
iadcCfgAnalogGain2x | Analog gain of 2x. |
iadcCfgAnalogGain3x | Analog gain of 3x. |
iadcCfgAnalogGain4x | Analog gain of 4x. |
638
of file platform/emlib/inc/em_iadc.h
IADC_CfgReference_t#
IADC_CfgReference_t
IADC Reference.
Enumerator | |
---|---|
iadcCfgReferenceInt1V2 | Internal 1.2V Band Gap Reference (buffered) to ground. |
iadcCfgReferenceExt1V25 | External reference (unbuffered) VREFP to VREFN. |
iadcCfgReferenceExt2V5 | External reference (unbuffered) VREFP to VREFN. |
iadcCfgReferenceVddx | VDDX (unbuffered) to ground. |
iadcCfgReferenceVddX0P8Buf | 0.8 * VDDX (buffered) to ground. |
660
of file platform/emlib/inc/em_iadc.h
IADC_CfgTwosComp_t#
IADC_CfgTwosComp_t
IADC Two's complement results.
Enumerator | |
---|---|
iadcCfgTwosCompAuto | Automatic. |
iadcCfgTwosCompUnipolar | All results in unipolar format. |
iadcCfgTwosCompBipolar | All results in bipolar (2's complement) format. |
696
of file platform/emlib/inc/em_iadc.h
IADC_TriggerSel_t#
IADC_TriggerSel_t
IADC trigger action.
Enumerator | |
---|---|
iadcTriggerSelImmediate | Start single/scan queue immediately. |
iadcTriggerSelTimer | Timer starts single/scan queue. |
iadcTriggerSelPrs0SameClk | PRS0 from timer in same clock group starts single/scan queue |
iadcTriggerSelPrs0PosEdge | PRS0 positive edge starts single/scan queue |
iadcTriggerSelPrs0NegEdge | PRS0 negative edge starts single/scan queue |
iadcTriggerSelLesense | LESENSE starts scan queue |
708
of file platform/emlib/inc/em_iadc.h
IADC_TriggerAction_t#
IADC_TriggerAction_t
IADC trigger action.
Enumerator | |
---|---|
iadcTriggerActionOnce | Convert single/scan queue once per trigger |
iadcTriggerActionContinuous | Convert single/scan queue continuously |
731
of file platform/emlib/inc/em_iadc.h
IADC_FifoCfgDvl_t#
IADC_FifoCfgDvl_t
IADC data valid level before requesting DMA transfer.
Enumerator | |
---|---|
iadcFifoCfgDvl1 | Data valid level is 1 before requesting DMA transfer. |
iadcFifoCfgDvl2 | Data valid level is 2 before requesting DMA transfer. |
iadcFifoCfgDvl3 | Data valid level is 3 before requesting DMA transfer. |
iadcFifoCfgDvl4 | Data valid level is 4 before requesting DMA transfer. |
iadcFifoCfgDvl5 | Data valid level is 5 before requesting DMA transfer. |
iadcFifoCfgDvl6 | Data valid level is 6 before requesting DMA transfer. |
iadcFifoCfgDvl7 | Data valid level is 7 before requesting DMA transfer. |
740
of file platform/emlib/inc/em_iadc.h
IADC_DigitalAveraging_t#
IADC_DigitalAveraging_t
IADC digital averaging function.
Enumerator | |
---|---|
iadcDigitalAverage1 | Average over 1 sample (no averaging). |
iadcDigitalAverage2 | Average over 2 samples. |
iadcDigitalAverage4 | Average over 4 samples. |
iadcDigitalAverage8 | Average over 8 samples. |
iadcDigitalAverage16 | Average over 16 samples. |
774
of file platform/emlib/inc/em_iadc.h
Function Documentation#
IADC_init#
void IADC_init (IADC_TypeDef * iadc, const IADC_Init_t * init, const IADC_AllConfigs_t * allConfigs)
Initialize IADC.
[in] | iadc | Pointer to IADC peripheral register block. |
[in] | init | Pointer to IADC initialization structure. |
[in] | allConfigs | Pointer to structure holding all configs. |
Initializes common parts for both single conversion and scan sequence. In addition, single and/or scan control configuration must be done, please refer to IADC_initSingle() and IADC_initScan() respectively.
Note
This function will stop any ongoing conversions.
213
of file platform/emlib/src/em_iadc.c
IADC_initScan#
void IADC_initScan (IADC_TypeDef * iadc, const IADC_InitScan_t * init, const IADC_ScanTable_t * scanTable)
Initialize IADC scan sequence.
[in] | iadc | Pointer to IADC peripheral register block. |
[in] | init | Pointer to IADC initialization structure. |
[in] | scanTable | Pointer to IADC scan table structure. |
This function will configure scan mode and set up entries in the scan table. The scan table mask can be updated by calling IADC_updateScanMask.
Note
This function will stop any ongoing conversions.
If an even numbered pin is selected for the positive input, the negative input must use an odd numbered pin and vice versa.
529
of file platform/emlib/src/em_iadc.c
IADC_initSingle#
void IADC_initSingle (IADC_TypeDef * iadc, const IADC_InitSingle_t * init, const IADC_SingleInput_t * input)
Initialize single IADC conversion.
[in] | iadc | Pointer to IADC peripheral register block. |
[in] | init | Pointer to IADC single initialization structure. |
[in] | input | Pointer to IADC single input selection initialization structure. |
This function will initialize the single conversion and configure the single input selection.
Note
This function will stop any ongoing conversions.
If an even numbered pin is selected for the positive input, the negative input must use an odd numbered pin and vice versa.
608
of file platform/emlib/src/em_iadc.c
IADC_updateSingleInput#
void IADC_updateSingleInput (IADC_TypeDef * iadc, const IADC_SingleInput_t * input)
Update IADC single input selection.
[in] | iadc | Pointer to IADC peripheral register block. |
[in] | input | Pointer to single input selection structure. |
This function updates the single input selection. The function can be called while single and/or scan conversions are ongoing and the new input configuration will take place on the next single conversion.
Note
If an even numbered pin is selected for the positive input, the negative input must use an odd numbered pin and vice versa.
663
of file platform/emlib/src/em_iadc.c
IADC_setScanMask#
void IADC_setScanMask (IADC_TypeDef * iadc, uint32_t mask)
Set mask of IADC scan table entries to include in scan.
[in] | iadc | Pointer to IADC peripheral register block. |
[in] | mask | Mask of scan table entries to include in scan. |
Set mask of scan table entries to include in next scan. This function can be called while scan conversions are ongoing, but the new scan mask will take effect once the ongoing scan is completed.
704
of file platform/emlib/src/em_iadc.c
IADC_updateScanEntry#
void IADC_updateScanEntry (IADC_TypeDef * iadc, uint8_t id, IADC_ScanTableEntry_t * entry)
Add/update entry in scan table.
[in] | iadc | Pointer to IADC peripheral register block. |
[in] | id | ID of scan table entry to add. |
[in] | entry | Pointer to scan table entry structure. |
This function will update or add an entry in the scan table with a specific ID.
Note
This function will stop any ongoing conversions.
746
of file platform/emlib/src/em_iadc.c
IADC_reset#
void IADC_reset (IADC_TypeDef * iadc)
Reset IADC to same state as after a HW reset.
[in] | iadc | Pointer to IADC peripheral register block. |
790
of file platform/emlib/src/em_iadc.c
IADC_calcTimebase#
uint8_t IADC_calcTimebase (IADC_TypeDef * iadc, uint32_t srcClkFreq)
Calculate timebase value in order to get a timebase providing at least 1us.
[in] | iadc | Pointer to IADC peripheral register block. |
[in] | srcClkFreq | Frequency in Hz of reference CLK_SRC_ADC clock. Set to 0 to derive srcClkFreq from CLK_CMU_ADC and prescaler HSCLKRATE. |
Returns
Timebase value to use for IADC in order to achieve at least 1 us.
877
of file platform/emlib/src/em_iadc.c
IADC_calcSrcClkPrescale#
uint8_t IADC_calcSrcClkPrescale (IADC_TypeDef * iadc, uint32_t srcClkFreq, uint32_t cmuClkFreq)
Calculate prescaler for CLK_SRC_ADC high speed clock.
[in] | iadc | Pointer to IADC peripheral register block. |
[in] | srcClkFreq | CLK_SRC_ADC frequency wanted. The frequency will automatically be adjusted to be within valid range according to reference manual. |
[in] | cmuClkFreq | Frequency in Hz of reference CLK_CMU_ADC. Set to 0 to use currently defined CMU clock setting for the IADC. |
The IADC high speed clock is given by: CLK_SRC_ADC / (srcClkPrescaler + 1).
Returns
Divider value to use for IADC in order to achieve a high speed clock value <=
srcClkFreq
.
932
of file platform/emlib/src/em_iadc.c
IADC_calcAdcClkPrescale#
uint32_t IADC_calcAdcClkPrescale (IADC_TypeDef * iadc, uint32_t adcClkFreq, uint32_t cmuClkFreq, IADC_CfgAdcMode_t adcMode, uint8_t srcClkPrescaler)
Calculate prescaler for ADC_CLK clock.
[in] | iadc | Pointer to IADC peripheral register block. |
[in] | adcClkFreq | ADC_CLK frequency wanted. The frequency will automatically be adjusted to be within valid range according to reference manual. |
[in] | cmuClkFreq | Frequency in Hz of CLK_CMU_ADC Set to 0 to use currently defined IADC clock setting (in CMU). |
[in] | adcMode | Mode for IADC config. |
[in] | srcClkPrescaler | Precaler setting for ADC_CLK |
The ADC_CLK is given by: CLK_SRC_ADC / (adcClkprescale + 1).
Returns
Divider value to use for IADC in order to achieve a ADC_CLK frequency <=
adcClkFreq
.
987
of file platform/emlib/src/em_iadc.c
IADC_pullSingleFifoResult#
IADC_Result_t IADC_pullSingleFifoResult (IADC_TypeDef * iadc)
Pull result from single data FIFO.
[in] | iadc | Pointer to IADC peripheral register block. |
The result struct includes both the data and the ID (0x20) if showId was set when initializing single mode.
Note
Check data valid flag before calling this function.
Returns
Single conversion result struct holding data and id.
1040
of file platform/emlib/src/em_iadc.c
IADC_readSingleResult#
IADC_Result_t IADC_readSingleResult (IADC_TypeDef * iadc)
Read most recent single conversion result.
[in] | iadc | Pointer to IADC peripheral register block. |
The result struct includes both the data and the ID (0x20) if showId was set when initializing single mode. Calling this function will not affect the state of the single data FIFO.
Note
Check data valid flag before calling this function.
Returns
Single conversion result struct holding data and id.
1063
of file platform/emlib/src/em_iadc.c
IADC_pullScanFifoResult#
IADC_Result_t IADC_pullScanFifoResult (IADC_TypeDef * iadc)
Pull result from scan data FIFO.
[in] | iadc | Pointer to IADC peripheral register block. |
The result struct includes both the data and the ID (0x20) if showId was set when initializing scan entry.
Note
Check data valid flag before calling this function.
Returns
Scan conversion result struct holding data and id.
1085
of file platform/emlib/src/em_iadc.c
IADC_readScanResult#
IADC_Result_t IADC_readScanResult (IADC_TypeDef * iadc)
Read most recent scan conversion result.
[in] | iadc | Pointer to IADC peripheral register block. |
The result struct includes both the data and the ID (0x20) if showId was set when initializing scan entry. Calling this function will not affect the state of the scan data FIFO.
Note
Check data valid flag before calling this function.
Returns
Scan conversion result struct holding data and id.
1108
of file platform/emlib/src/em_iadc.c
IADC_getReferenceVoltage#
uint32_t IADC_getReferenceVoltage (IADC_CfgReference_t reference)
Get reference voltage selection.
[in] | reference | IADC Reference selection. |
Returns
IADC reference voltage in millivolts.
1126
of file platform/emlib/src/em_iadc.c
IADC_pullSingleFifoData#
uint32_t IADC_pullSingleFifoData (IADC_TypeDef * iadc)
Pull data from single data FIFO.
[in] | iadc | Pointer to IADC peripheral register block. |
If showId was set when initializing single mode, the results will contain the ID (0x20).
Note
Check data valid flag before calling this function.
Returns
Single conversion data.
1086
of file platform/emlib/inc/em_iadc.h
IADC_readSingleData#
uint32_t IADC_readSingleData (IADC_TypeDef * iadc)
Read most recent single conversion data.
[in] | iadc | Pointer to IADC peripheral register block. |
If showId was set when initializing single mode, the data will contain the ID (0x20). Calling this function will not affect the state of the single data FIFO.
Note
Check data valid flag before calling this function.
Returns
Single conversion data.
1106
of file platform/emlib/inc/em_iadc.h
IADC_pullScanFifoData#
uint32_t IADC_pullScanFifoData (IADC_TypeDef * iadc)
Pull data from scan data FIFO.
[in] | iadc | Pointer to IADC peripheral register block. |
If showId was set for the scan entry initialization, the data will contain the ID of the scan entry.
Note
Check data valid flag before calling this function.
Returns
Scan conversion data.
1125
of file platform/emlib/inc/em_iadc.h
IADC_readScanData#
uint32_t IADC_readScanData (IADC_TypeDef * iadc)
Read most recent scan conversion data.
[in] | iadc | Pointer to IADC peripheral register block. |
If showId was set for the scan entry initialization, the data will contain the ID of the scan entry. Calling this function will not affect the state of the scan data FIFO.
Note
Check data valid flag before calling this function.
Returns
Scan conversion data.
1145
of file platform/emlib/inc/em_iadc.h
IADC_clearInt#
void IADC_clearInt (IADC_TypeDef * iadc, uint32_t flags)
Clear one or more pending IADC interrupts.
[in] | iadc | Pointer to IADC peripheral register block. |
[in] | flags | Pending IADC interrupt source to clear. Use a bitwise logic OR combination of valid interrupt flags for the IADC module (IADC_IF_nnn). |
1161
of file platform/emlib/inc/em_iadc.h
IADC_disableInt#
void IADC_disableInt (IADC_TypeDef * iadc, uint32_t flags)
Disable one or more IADC interrupts.
[in] | iadc | Pointer to IADC peripheral register block. |
[in] | flags | IADC interrupt sources to disable. Use a bitwise logic OR combination of valid interrupt flags for the IADC module (IADC_IF_nnn). |
1177
of file platform/emlib/inc/em_iadc.h
IADC_enableInt#
void IADC_enableInt (IADC_TypeDef * iadc, uint32_t flags)
Enable one or more IADC interrupts.
[in] | iadc | Pointer to IADC peripheral register block. |
[in] | flags | IADC interrupt sources to enable. Use a bitwise logic OR combination of valid interrupt flags for the IADC module (IADC_IF_nnn). |
Note
Depending on the use, a pending interrupt may already be set prior to enabling the interrupt. Consider using IADC_intClear() prior to enabling if such a pending interrupt should be ignored.
1202
of file platform/emlib/inc/em_iadc.h
IADC_getInt#
uint32_t IADC_getInt (IADC_TypeDef * iadc)
Get pending IADC interrupt flags.
[in] | iadc | Pointer to IADC peripheral register block. |
Note
The event bits are not cleared by the use of this function.
Returns
IADC interrupt sources pending. A bitwise logic OR combination of valid interrupt flags for the IADC module (IADC_IF_nnn).
1221
of file platform/emlib/inc/em_iadc.h
IADC_getEnabledInt#
uint32_t IADC_getEnabledInt (IADC_TypeDef * iadc)
Get enabled and pending IADC interrupt flags.
[in] | iadc | Pointer to IADC peripheral register block. |
Useful for handling more interrupt sources in the same interrupt handler.
Note
Interrupt flags are not cleared by the use of this function.
Returns
Pending and enabled IADC interrupt sources. The return value is the bitwise AND combination of
the OR combination of enabled interrupt sources in IADCx_IEN_nnn register (IADCx_IEN_nnn) and
the OR combination of valid interrupt flags of the IADC module (IADCx_IF_nnn).
1245
of file platform/emlib/inc/em_iadc.h
IADC_setInt#
void IADC_setInt (IADC_TypeDef * iadc, uint32_t flags)
Set one or more pending IADC interrupts from SW.
[in] | iadc | Pointer to IADC peripheral register block. |
[in] | flags | IADC interrupt sources to set to pending. Use a bitwise logic OR combination of valid interrupt flags for the IADC module (IADC_IF_nnn). |
1268
of file platform/emlib/inc/em_iadc.h
IADC_command#
void IADC_command (IADC_TypeDef * iadc, IADC_Cmd_t cmd)
Start/stop scan sequence, single conversion and/or timer.
[in] | iadc | Pointer to IADC peripheral register block. |
[in] | cmd | Command to be performed. |
1283
of file platform/emlib/inc/em_iadc.h
IADC_getScanMask#
uint32_t IADC_getScanMask (IADC_TypeDef * iadc)
Get the scan mask currently used in the IADC.
[in] | iadc | Pointer to IADC peripheral register block. |
Returns
Mask of scan table entries currently included in scan.
1298
of file platform/emlib/inc/em_iadc.h
IADC_getStatus#
uint32_t IADC_getStatus (IADC_TypeDef * iadc)
Get status bits of IADC.
[in] | iadc | Pointer to IADC peripheral register block. |
Returns
IADC status bits
1313
of file platform/emlib/inc/em_iadc.h
IADC_getSingleFifoCnt#
uint8_t IADC_getSingleFifoCnt (IADC_TypeDef * iadc)
Get the number of elements in the IADC single FIFO.
[in] | iadc | Pointer to IADC peripheral register block. |
Returns
Number of elements in single FIFO
1328
of file platform/emlib/inc/em_iadc.h
IADC_getScanFifoCnt#
uint8_t IADC_getScanFifoCnt (IADC_TypeDef * iadc)
Get the number of elements in the IADC scan FIFO.
[in] | iadc | Pointer to IADC peripheral register block. |
Returns
Number of elements in scan FIFO
1344
of file platform/emlib/inc/em_iadc.h
IADC_portPinToNegInput#
IADC_NegInput_t IADC_portPinToNegInput (GPIO_Port_TypeDef port, uint8_t pin)
Convert the GPIO port/pin to IADC negative input selection.
[in] | port | GPIO port |
[in] | pin | GPIO in |
Returns
IADC negative input selection
1363
of file platform/emlib/inc/em_iadc.h
IADC_portPinToPosInput#
IADC_PosInput_t IADC_portPinToPosInput (GPIO_Port_TypeDef port, uint8_t pin)
Convert the GPIO port/pin to IADC positive input selection.
[in] | port | GPIO port |
[in] | pin | GPIO in |
Returns
IADC positive input selection
1384
of file platform/emlib/inc/em_iadc.h
Macro Definition Documentation#
IADC_INIT_DEFAULT#
#define IADC_INIT_DEFAULTValue:
Default config for IADC init structure.
815
of file platform/emlib/inc/em_iadc.h
IADC_CONFIG_DEFAULT#
#define IADC_CONFIG_DEFAULTValue:
Default IADC config structure.
848
of file platform/emlib/inc/em_iadc.h
IADC_ALLCONFIGS_DEFAULT#
#define IADC_ALLCONFIGS_DEFAULTValue:
Default IADC sructure for all configs.
910
of file platform/emlib/inc/em_iadc.h
IADC_INITSCAN_DEFAULT#
#define IADC_INITSCAN_DEFAULTValue:
Default config for IADC scan init structure.
930
of file platform/emlib/inc/em_iadc.h
IADC_INITSINGLE_DEFAULT#
#define IADC_INITSINGLE_DEFAULTValue:
Default config for IADC single init structure.
955
of file platform/emlib/inc/em_iadc.h
IADC_SINGLEINPUT_DEFAULT#
#define IADC_SINGLEINPUT_DEFAULTValue:
Default config for IADC single input structure.
976
of file platform/emlib/inc/em_iadc.h
IADC_SCANTABLEENTRY_DEFAULT#
#define IADC_SCANTABLEENTRY_DEFAULTValue:
Default config for IADC scan table entry structure.
994
of file platform/emlib/inc/em_iadc.h
IADC_SCANTABLE_DEFAULT#
#define IADC_SCANTABLE_DEFAULTValue:
Default IADC structure for scan table.
1010
of file platform/emlib/inc/em_iadc.h