The MCUXpresso SDK provides a peripheral driver for the ADC_ETC module of MCUXpresso SDK devices.
Typical use case
Software trigger Configuration
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/adc_etc
Hardware trigger Configuration
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/adc_etc
|
void | ADC_ETC_Init (ADC_ETC_Type *base, const adc_etc_config_t *config) |
| Initialize the ADC_ETC module. More...
|
|
void | ADC_ETC_Deinit (ADC_ETC_Type *base) |
| De-Initialize the ADC_ETC module. More...
|
|
void | ADC_ETC_GetDefaultConfig (adc_etc_config_t *config) |
| Gets an available pre-defined settings for the ADC_ETC's configuration. More...
|
|
void | ADC_ETC_SetTriggerConfig (ADC_ETC_Type *base, uint32_t triggerGroup, const adc_etc_trigger_config_t *config) |
| Set the external XBAR trigger configuration. More...
|
|
void | ADC_ETC_SetTriggerChainConfig (ADC_ETC_Type *base, uint32_t triggerGroup, uint32_t chainGroup, const adc_etc_trigger_chain_config_t *config) |
| Set the external XBAR trigger chain configuration. More...
|
|
uint32_t | ADC_ETC_GetInterruptStatusFlags (ADC_ETC_Type *base, adc_etc_external_trigger_source_t sourceIndex) |
| Gets the interrupt status flags of external XBAR and TSC triggers. More...
|
|
void | ADC_ETC_ClearInterruptStatusFlags (ADC_ETC_Type *base, adc_etc_external_trigger_source_t sourceIndex, uint32_t mask) |
| Clears the ADC_ETC's interrupt status falgs. More...
|
|
static void | ADC_ETC_EnableDMA (ADC_ETC_Type *base, uint32_t triggerGroup) |
| Enable the DMA corresponding to each trigger source. More...
|
|
static void | ADC_ETC_DisableDMA (ADC_ETC_Type *base, uint32_t triggerGroup) |
| Disable the DMA corresponding to each trigger sources. More...
|
|
static uint32_t | ADC_ETC_GetDMAStatusFlags (ADC_ETC_Type *base) |
| Get the DMA request status falgs. More...
|
|
static void | ADC_ETC_ClearDMAStatusFlags (ADC_ETC_Type *base, uint32_t mask) |
| Clear the DMA request status falgs. More...
|
|
static void | ADC_ETC_DoSoftwareReset (ADC_ETC_Type *base, bool enable) |
| When enable, all logical will be reset. More...
|
|
static void | ADC_ETC_DoSoftwareTrigger (ADC_ETC_Type *base, uint32_t triggerGroup) |
| Do software trigger corresponding to each XBAR trigger sources. More...
|
|
uint32_t | ADC_ETC_GetADCConversionValue (ADC_ETC_Type *base, uint32_t triggerGroup, uint32_t chainGroup) |
| Get ADC conversion result from external XBAR sources. More...
|
|
struct adc_etc_trigger_chain_config_t |
struct adc_etc_trigger_config_t |
#define ADC_ETC_DMA_CTRL_TRGn_REQ_MASK 0xFF0000U |
- Parameters
-
base | ADC_ETC peripheral base address. |
config | Pointer to "adc_etc_config_t" structure. |
void ADC_ETC_Deinit |
( |
ADC_ETC_Type * |
base | ) |
|
- Parameters
-
base | ADC_ETC peripheral base address. |
This function initializes the ADC_ETC's configuration structure with available settings. The default values are:
* config->enableTSCBypass = true;
* config->enableTSC0Trigger = false;
* config->enableTSC1Trigger = false;
* config->TSC0triggerPriority = 0U;
* config->TSC1triggerPriority = 0U;
* config->clockPreDivider = 0U;
* config->XBARtriggerMask = 0U;
*
- Parameters
-
config | Pointer to "adc_etc_config_t" structure. |
- Parameters
-
base | ADC_ETC peripheral base address. |
triggerGroup | Trigger group index. |
config | Pointer to "adc_etc_trigger_config_t" structure. |
For example, if triggerGroup is set to 0U and chainGroup is set to 1U, which means Trigger0 source's chain1 would be configurated.
- Parameters
-
base | ADC_ETC peripheral base address. |
triggerGroup | Trigger group index. Available number is 0~7. |
chainGroup | Trigger chain group index. Available number is 0~7. |
config | Pointer to "adc_etc_trigger_chain_config_t" structure. |
- Parameters
-
base | ADC_ETC peripheral base address. |
sourceIndex | trigger source index. |
- Returns
- Status flags mask of trigger. Refer to "_adc_etc_status_flag_mask".
- Parameters
-
base | ADC_ETC peripheral base address. |
sourceIndex | trigger source index. |
mask | Status flags mask of trigger. Refer to "_adc_etc_status_flag_mask". |
static void ADC_ETC_EnableDMA |
( |
ADC_ETC_Type * |
base, |
|
|
uint32_t |
triggerGroup |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | ADC_ETC peripheral base address. |
triggerGroup | Trigger group index. Available number is 0~7. |
static void ADC_ETC_DisableDMA |
( |
ADC_ETC_Type * |
base, |
|
|
uint32_t |
triggerGroup |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | ADC_ETC peripheral base address. |
triggerGroup | Trigger group index. Available number is 0~7. |
static uint32_t ADC_ETC_GetDMAStatusFlags |
( |
ADC_ETC_Type * |
base | ) |
|
|
inlinestatic |
Only external XBAR sources support DMA request.
- Parameters
-
base | ADC_ETC peripheral base address. |
- Returns
- Mask of external XBAR tirgger's DMA request asserted flags. Available range is trigger0:0x01 to trigger7:0x80.
static void ADC_ETC_ClearDMAStatusFlags |
( |
ADC_ETC_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
Only external XBAR sources support DMA request.
- Parameters
-
base | ADC_ETC peripheral base address. |
mask | Mask of external XBAR tirgger's DMA request asserted flags. Available range is trigger0:0x01 to trigger7:0x80. |
static void ADC_ETC_DoSoftwareReset |
( |
ADC_ETC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | ADC_ETC peripheral base address. |
enable | Enable/Disable the software reset. |
static void ADC_ETC_DoSoftwareTrigger |
( |
ADC_ETC_Type * |
base, |
|
|
uint32_t |
triggerGroup |
|
) |
| |
|
inlinestatic |
Each XBAR trigger sources can be configured as HW or SW trigger mode. In hardware trigger mode, trigger source is from XBAR. In software mode, trigger source is from software tigger. TSC trigger sources can only work in hardware trigger mode.
- Parameters
-
base | ADC_ETC peripheral base address. |
triggerGroup | Trigger group index. Available number is 0~7. |
uint32_t ADC_ETC_GetADCConversionValue |
( |
ADC_ETC_Type * |
base, |
|
|
uint32_t |
triggerGroup, |
|
|
uint32_t |
chainGroup |
|
) |
| |
For example, if triggerGroup is set to 0U and chainGroup is set to 1U, which means the API would return Trigger0 source's chain1 conversion result.
- Parameters
-
base | ADC_ETC peripheral base address. |
triggerGroup | Trigger group index. Available number is 0~7. |
chainGroup | Trigger chain group index. Available number is 0~7. |
- Returns
- ADC conversion result value.