IADC
Detailed Description
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.
Data Structures | |
struct | IADC_AllConfigs_t |
struct | IADC_Config_t |
struct | IADC_Init_t |
struct | IADC_InitScan_t |
struct | IADC_InitSingle_t |
struct | IADC_Result_t |
struct | IADC_ScanTable_t |
struct | IADC_ScanTableEntry_t |
struct | IADC_SingleInput_t |
Macros | |
#define | IADC_ALLCONFIGS_DEFAULT |
#define | IADC_CONFIG_DEFAULT |
#define | IADC_INIT_DEFAULT |
#define | IADC_INITSCAN_DEFAULT |
#define | IADC_INITSINGLE_DEFAULT |
#define | IADC_SCANTABLE_DEFAULT |
#define | IADC_SCANTABLEENTRY_DEFAULT |
#define | IADC_SINGLEINPUT_DEFAULT |
Functions | |
uint8_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. | |
uint8_t | IADC_calcSrcClkPrescale (IADC_TypeDef *iadc, uint32_t srcClkFreq, uint32_t cmuClkFreq) |
Calculate prescaler for CLK_SRC_ADC high speed clock. | |
uint8_t | IADC_calcTimebase (IADC_TypeDef *iadc, uint32_t cmuClkFreq) |
Calculate timebase value in order to get a timebase providing at least 1us. | |
__STATIC_INLINE void | IADC_clearInt (IADC_TypeDef *iadc, uint32_t flags) |
Clear one or more pending IADC interrupts. | |
__STATIC_INLINE void | IADC_command (IADC_TypeDef *iadc, IADC_Cmd_t cmd) |
Start/stop scan sequence, single conversion and/or timer. | |
__STATIC_INLINE void | IADC_disableInt (IADC_TypeDef *iadc, uint32_t flags) |
Disable one or more IADC interrupts. | |
__STATIC_INLINE void | IADC_enableInt (IADC_TypeDef *iadc, uint32_t flags) |
Enable one or more IADC interrupts. | |
__STATIC_INLINE uint32_t | IADC_getEnabledInt (IADC_TypeDef *iadc) |
Get enabled and pending IADC interrupt flags. Useful for handling more interrupt sources in the same interrupt handler. | |
__STATIC_INLINE uint32_t | IADC_getInt (IADC_TypeDef *iadc) |
Get pending IADC interrupt flags. | |
__STATIC_INLINE uint8_t | IADC_getScanFifoCnt (IADC_TypeDef *iadc) |
Get number of elements in the IADC scan FIFO. | |
__STATIC_INLINE uint32_t | IADC_getScanMask (IADC_TypeDef *iadc) |
Get the scan mask currently used in the IADC. | |
__STATIC_INLINE uint8_t | IADC_getSingleFifoCnt (IADC_TypeDef *iadc) |
Get number of elements in the IADC single FIFO. | |
__STATIC_INLINE uint32_t | IADC_getStatus (IADC_TypeDef *iadc) |
Get status bits of IADC. | |
void | IADC_init (IADC_TypeDef *iadc, const IADC_Init_t *init, const IADC_AllConfigs_t *allConfigs) |
Initialize IADC. | |
void | IADC_initScan (IADC_TypeDef *iadc, const IADC_InitScan_t *init, const IADC_ScanTable_t *scanTable) |
Initialize IADC scan sequence. | |
void | IADC_initSingle (IADC_TypeDef *iadc, const IADC_InitSingle_t *init, const IADC_SingleInput_t *input) |
Initialize single IADC conversion. | |
__STATIC_INLINE IADC_NegInput_t | IADC_portPinToNegInput (GPIO_Port_TypeDef port, uint8_t pin) |
Convert GPIO port/pin to IADC negative input selection. | |
__STATIC_INLINE IADC_PosInput_t | IADC_portPinToPosInput (GPIO_Port_TypeDef port, uint8_t pin) |
Convert GPIO port/pin to IADC positive input selection. | |
__STATIC_INLINE uint32_t | IADC_pullScanFifoData (IADC_TypeDef *iadc) |
Pull data from scan data FIFO. If showId was set for the scan entry initialization, the data will contain the ID of the scan entry. | |
IADC_Result_t | IADC_pullScanFifoResult (IADC_TypeDef *iadc) |
Pull result from scan data FIFO. The result struct includes both the data and the ID (0x20) if showId was set when initializing scan entry. | |
__STATIC_INLINE uint32_t | IADC_pullSingleFifoData (IADC_TypeDef *iadc) |
Pull data from single data FIFO. If showId was set when initializing single mode, the results will contain the ID (0x20). | |
IADC_Result_t | IADC_pullSingleFifoResult (IADC_TypeDef *iadc) |
Pull result from single data FIFO. The result struct includes both the data and the ID (0x20) if showId was set when initializing single mode. | |
__STATIC_INLINE uint32_t | IADC_readScanData (IADC_TypeDef *iadc) |
Read most recent scan conversion data. 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. | |
IADC_Result_t | IADC_readScanResult (IADC_TypeDef *iadc) |
Read most recent scan conversion result. 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. | |
__STATIC_INLINE uint32_t | IADC_readSingleData (IADC_TypeDef *iadc) |
Read most recent single conversion data. 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. | |
IADC_Result_t | IADC_readSingleResult (IADC_TypeDef *iadc) |
Read most recent single conversion result. 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. | |
void | IADC_reset (IADC_TypeDef *iadc) |
Reset IADC to same state as after a HW reset. | |
__STATIC_INLINE void | IADC_setInt (IADC_TypeDef *iadc, uint32_t flags) |
Set one or more pending IADC interrupts from SW. | |
void | IADC_setScanMask (IADC_TypeDef *iadc, uint32_t mask) |
Set mask of IADC scan table entries to include in scan. | |
void | IADC_updateScanEntry (IADC_TypeDef *iadc, uint8_t id, IADC_ScanTableEntry_t *entry) |
Add/update entry in scan table. | |
void | IADC_updateSingleInput (IADC_TypeDef *iadc, const IADC_SingleInput_t *input) |
Update IADC single input selection. | |
Macro Definition Documentation
#define IADC_ALLCONFIGS_DEFAULT |
Default IADC sructure for all configs.
Definition at line 690
of file em_iadc.h
.
#define IADC_CONFIG_DEFAULT |
Default IADC config structure.
Definition at line 672
of file em_iadc.h
.
#define IADC_INIT_DEFAULT |
Default config for IADC init structure.
Definition at line 647
of file em_iadc.h
.
#define IADC_INITSCAN_DEFAULT |
Default config for IADC scan init structure.
Definition at line 710
of file em_iadc.h
.
#define IADC_INITSINGLE_DEFAULT |
Default config for IADC single init structure.
Definition at line 735
of file em_iadc.h
.
#define IADC_SCANTABLE_DEFAULT |
Default IADC sructure for scan table
Definition at line 790
of file em_iadc.h
.
#define IADC_SCANTABLEENTRY_DEFAULT |
Default config for IADC scan table entry structure.
Definition at line 774
of file em_iadc.h
.
#define IADC_SINGLEINPUT_DEFAULT |
Default config for IADC single input structure.
Definition at line 756
of file em_iadc.h
.
Enumeration Type Documentation
enum IADC_Alignment_t |
enum IADC_CfgAdcMode_t |
enum IADC_CfgAnalogGain_t |
IADC Over sampling rate for high speed.
Definition at line 535
of file em_iadc.h
.
enum IADC_CfgReference_t |
IADC Reference
Definition at line 571
of file em_iadc.h
.
enum IADC_CfgTwosComp_t |
IADC Two's complement results
Definition at line 586
of file em_iadc.h
.
enum IADC_Cmd_t |
enum IADC_NegInput_t |
IADC negative input selection.
Definition at line 81
of file em_iadc.h
.
enum IADC_PosInput_t |
IADC positive port selection.
Definition at line 283
of file em_iadc.h
.
enum IADC_TriggerAction_t |
enum IADC_TriggerSel_t |
IADC trigger action
Definition at line 598
of file em_iadc.h
.
enum IADC_Warmup_t |
Function Documentation
uint8_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.
The ADC_CLK is given by: CLK_SRC_ADC / (adcClkprescale + 1).
- Parameters
-
[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
- Returns
- Divider value to use for IADC in order to achieve a ADC_CLK frequency <=
adcClkFreq
.
Definition at line 811
of file em_iadc.c
.
References CMU_ClockFreqGet(), and SL_MIN.
Referenced by IADC_init().
uint8_t IADC_calcSrcClkPrescale | ( | IADC_TypeDef * | iadc, |
uint32_t | srcClkFreq, |
||
uint32_t | cmuClkFreq |
||
) |
Calculate prescaler for CLK_SRC_ADC high speed clock.
The IADC high speed clock is given by: CLK_SRC_ADC / (srcClkPrescaler + 1).
- Parameters
-
[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.
- Returns
- Divider value to use for IADC in order to achieve a high speed clock value <=
srcClkFreq
.
Definition at line 757
of file em_iadc.c
.
References CMU_ClockFreqGet(), and SL_MIN.
Referenced by IADC_init().
uint8_t IADC_calcTimebase | ( | IADC_TypeDef * | iadc, |
uint32_t | cmuClkFreq |
||
) |
Calculate timebase value in order to get a timebase providing at least 1us.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block. [in] cmuClkFreq
Frequency in Hz of reference CLK_CMU_ADC clock. Set to 0 to use currently defined CMU clock setting for the IADC.
- Returns
- Timebase value to use for IADC in order to achieve at least 1 us.
Definition at line 710
of file em_iadc.c
.
References CMU_ClockFreqGet(), and SL_MIN.
Referenced by IADC_init().
__STATIC_INLINE void IADC_clearInt | ( | IADC_TypeDef * | iadc, |
uint32_t | flags |
||
) |
Clear one or more pending IADC interrupts.
- Parameters
-
[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).
Definition at line 940
of file em_iadc.h
.
Referenced by IADC_reset().
__STATIC_INLINE void IADC_command | ( | IADC_TypeDef * | iadc, |
IADC_Cmd_t | cmd |
||
) |
Start/stop scan sequence, single conversion and/or timer.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block. [in] cmd
Command to be performed.
Definition at line 1062
of file em_iadc.h
.
Referenced by IADC_initScan(), and IADC_initSingle().
__STATIC_INLINE void IADC_disableInt | ( | IADC_TypeDef * | iadc, |
uint32_t | flags |
||
) |
Disable one or more IADC interrupts.
- Parameters
-
[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).
Definition at line 956
of file em_iadc.h
.
Referenced by IADC_reset().
__STATIC_INLINE void IADC_enableInt | ( | IADC_TypeDef * | iadc, |
uint32_t | flags |
||
) |
Enable one or more IADC interrupts.
- 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.
- Parameters
-
[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).
Definition at line 981
of file em_iadc.h
.
__STATIC_INLINE uint32_t IADC_getEnabledInt | ( | IADC_TypeDef * | iadc | ) |
Get enabled and pending IADC interrupt flags. Useful for handling more interrupt sources in the same interrupt handler.
- Note
- Interrupt flags are not cleared by the use of this function.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block.
- 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).
Definition at line 1024
of file em_iadc.h
.
__STATIC_INLINE uint32_t IADC_getInt | ( | IADC_TypeDef * | iadc | ) |
Get pending IADC interrupt flags.
- Note
- The event bits are not cleared by the use of this function.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block.
- Returns
- IADC interrupt sources pending. A bitwise logic OR combination of valid interrupt flags for the IADC module (IADC_IF_nnn).
Definition at line 1000
of file em_iadc.h
.
__STATIC_INLINE uint8_t IADC_getScanFifoCnt | ( | IADC_TypeDef * | iadc | ) |
Get number of elements in the IADC scan FIFO.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block.
- Returns
- Number of elements in scan FIFO
Definition at line 1123
of file em_iadc.h
.
__STATIC_INLINE uint32_t IADC_getScanMask | ( | IADC_TypeDef * | iadc | ) |
Get the scan mask currently used in the IADC.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block.
- Returns
- Mask of scan table entries currently included in scan.
Definition at line 1077
of file em_iadc.h
.
__STATIC_INLINE uint8_t IADC_getSingleFifoCnt | ( | IADC_TypeDef * | iadc | ) |
Get number of elements in the IADC single FIFO.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block.
- Returns
- Number of elements in single FIFO
Definition at line 1107
of file em_iadc.h
.
__STATIC_INLINE uint32_t IADC_getStatus | ( | IADC_TypeDef * | iadc | ) |
Get status bits of IADC.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block.
- Returns
- IADC status bits
Definition at line 1092
of file em_iadc.h
.
void IADC_init | ( | IADC_TypeDef * | iadc, |
const IADC_Init_t * | init, |
||
const IADC_AllConfigs_t * | allConfigs |
||
) |
Initialize IADC.
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.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block. [in] init
Pointer to IADC initialization structure. [in] allConfigs
Pointer to structure holding all configs.
Definition at line 170
of file em_iadc.c
.
References IADC_Config_t::adcClkPrescale, IADC_Config_t::adcMode, IADC_Config_t::analogGain, IADC_AllConfigs_t::configs, IADC_Init_t::debugHalt, IADC_Init_t::greaterThanEqualThres, IADC_calcAdcClkPrescale(), IADC_calcSrcClkPrescale(), IADC_calcTimebase(), iadcCfgModeNormal, IADC_Init_t::iadcClkSuspend0, IADC_Init_t::iadcClkSuspend1, IADC_Init_t::lessThanEqualThres, IADC_Config_t::osrHighSpeed, IADC_Config_t::reference, SL_MAX, IADC_Init_t::srcClkPrescale, IADC_Init_t::timebase, IADC_Init_t::timerCycles, IADC_Config_t::twosComplement, IADC_Config_t::vRef, and IADC_Init_t::warmup.
void IADC_initScan | ( | IADC_TypeDef * | iadc, |
const IADC_InitScan_t * | init, |
||
const IADC_ScanTable_t * | scanTable |
||
) |
Initialize IADC scan sequence.
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.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block. [in] init
Pointer to IADC initialization structure. [in] scanTable
Pointer to IADC scan table structure.
Definition at line 374
of file em_iadc.c
.
References IADC_InitScan_t::alignment, IADC_ScanTableEntry_t::compare, IADC_ScanTableEntry_t::configId, IADC_InitScan_t::dataValidLevel, IADC_ScanTable_t::entries, IADC_InitScan_t::fifoDmaWakeup, IADC_command(), iadcCmdStartScan, IADC_ScanTableEntry_t::includeInScan, IADC_ScanTableEntry_t::negInput, IADC_ScanTableEntry_t::posInput, IADC_InitScan_t::showId, IADC_InitScan_t::start, IADC_InitScan_t::triggerAction, and IADC_InitScan_t::triggerSelect.
void IADC_initSingle | ( | IADC_TypeDef * | iadc, |
const IADC_InitSingle_t * | init, |
||
const IADC_SingleInput_t * | input |
||
) |
Initialize single IADC conversion.
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.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block. [in] init
Pointer to IADC single initialization structure. [in] singleInput
Pointer to IADC single input selection initialization structure.
Definition at line 449
of file em_iadc.c
.
References IADC_InitSingle_t::alignment, IADC_InitSingle_t::dataValidLevel, IADC_InitSingle_t::fifoDmaWakeup, IADC_command(), IADC_updateSingleInput(), iadcCmdStartSingle, IADC_InitSingle_t::showId, IADC_InitSingle_t::singleTailgate, IADC_InitSingle_t::start, IADC_InitSingle_t::triggerAction, and IADC_InitSingle_t::triggerSelect.
__STATIC_INLINE IADC_NegInput_t IADC_portPinToNegInput | ( | GPIO_Port_TypeDef | port, |
uint8_t | pin |
||
) |
Convert GPIO port/pin to IADC negative input selection.
- Parameters
-
[in] port
GPIO port [in] pin
GPIO in
- Returns
- IADC negative input selection
Definition at line 1142
of file em_iadc.h
.
__STATIC_INLINE IADC_PosInput_t IADC_portPinToPosInput | ( | GPIO_Port_TypeDef | port, |
uint8_t | pin |
||
) |
Convert GPIO port/pin to IADC positive input selection.
- Parameters
-
[in] port
GPIO port [in] pin
GPIO in
- Returns
- IADC positive input selection
Definition at line 1163
of file em_iadc.h
.
__STATIC_INLINE uint32_t IADC_pullScanFifoData | ( | IADC_TypeDef * | iadc | ) |
Pull data from scan data FIFO. 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.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block.
- Returns
- Scan conversion data.
Definition at line 904
of file em_iadc.h
.
Referenced by IADC_reset().
IADC_Result_t IADC_pullScanFifoResult | ( | IADC_TypeDef * | iadc | ) |
Pull result from scan data FIFO. 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.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block.
- Returns
- Scan conversion result struct holding data and id.
Definition at line 908
of file em_iadc.c
.
__STATIC_INLINE uint32_t IADC_pullSingleFifoData | ( | IADC_TypeDef * | iadc | ) |
Pull data from single data FIFO. If showId was set when initializing single mode, the results will contain the ID (0x20).
- Note
- Check data valid flag before calling this function.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block.
- Returns
- Single conversion data.
Definition at line 865
of file em_iadc.h
.
Referenced by IADC_reset().
IADC_Result_t IADC_pullSingleFifoResult | ( | IADC_TypeDef * | iadc | ) |
Pull result from single data FIFO. 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.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block.
- Returns
- Single conversion result struct holding data and id.
Definition at line 863
of file em_iadc.c
.
__STATIC_INLINE uint32_t IADC_readScanData | ( | IADC_TypeDef * | iadc | ) |
Read most recent scan conversion data. 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.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block.
- Returns
- Scan conversion data.
Definition at line 924
of file em_iadc.h
.
Referenced by IADC_reset().
IADC_Result_t IADC_readScanResult | ( | IADC_TypeDef * | iadc | ) |
Read most recent scan conversion result. 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.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block.
- Returns
- Scan conversion result struct holding data and id.
Definition at line 931
of file em_iadc.c
.
__STATIC_INLINE uint32_t IADC_readSingleData | ( | IADC_TypeDef * | iadc | ) |
Read most recent single conversion data. 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.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block.
- Returns
- Single conversion data.
Definition at line 885
of file em_iadc.h
.
Referenced by IADC_reset().
IADC_Result_t IADC_readSingleResult | ( | IADC_TypeDef * | iadc | ) |
Read most recent single conversion result. 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.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block.
- Returns
- Single conversion result struct holding data and id.
Definition at line 886
of file em_iadc.c
.
void IADC_reset | ( | IADC_TypeDef * | iadc | ) |
Reset IADC to same state as after a HW reset.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block.
Definition at line 628
of file em_iadc.c
.
References IADC_clearInt(), IADC_disableInt(), IADC_pullScanFifoData(), IADC_pullSingleFifoData(), IADC_readScanData(), and IADC_readSingleData().
__STATIC_INLINE void IADC_setInt | ( | IADC_TypeDef * | iadc, |
uint32_t | flags |
||
) |
Set one or more pending IADC interrupts from SW.
- Parameters
-
[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).
Definition at line 1047
of file em_iadc.h
.
void IADC_setScanMask | ( | IADC_TypeDef * | iadc, |
uint32_t | mask |
||
) |
Set mask of IADC 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.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block. [in] mask
Mask of scan table entries to include in scan.
Definition at line 542
of file em_iadc.c
.
void IADC_updateScanEntry | ( | IADC_TypeDef * | iadc, |
uint8_t | id, |
||
IADC_ScanTableEntry_t * | entry |
||
) |
Add/update entry in scan table.
This function will update or add an entry in the scan table with a specific ID.
- Note
- This function will stop any ongoing conversions.
- Parameters
-
[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.
Definition at line 584
of file em_iadc.c
.
References IADC_ScanTableEntry_t::compare, IADC_ScanTableEntry_t::configId, IADC_ScanTableEntry_t::includeInScan, IADC_ScanTableEntry_t::negInput, and IADC_ScanTableEntry_t::posInput.
void IADC_updateSingleInput | ( | IADC_TypeDef * | iadc, |
const IADC_SingleInput_t * | input |
||
) |
Update IADC single input selection.
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.
- Parameters
-
[in] iadc
Pointer to IADC peripheral register block. [in] input
Pointer to single input selection structure.
Definition at line 501
of file em_iadc.c
.
References IADC_SingleInput_t::compare, IADC_SingleInput_t::configId, IADC_SingleInput_t::negInput, and IADC_SingleInput_t::posInput.
Referenced by IADC_initSingle().