MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
ADC_ETC: ADC External Trigger Control

Overview

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

Data Structures

struct  adc_etc_config_t
 ADC_ETC configuration. More...
 
struct  adc_etc_trigger_chain_config_t
 ADC_ETC trigger chain configuration. More...
 
struct  adc_etc_trigger_config_t
 ADC_ETC trigger configuration. More...
 

Macros

#define FSL_ADC_ETC_DRIVER_VERSION   (MAKE_VERSION(2, 1, 2))
 ADC_ETC driver version. More...
 
#define ADC_ETC_DMA_CTRL_TRGn_REQ_MASK   0xFF0000U
 The mask of status flags cleared by writing 1. More...
 

Enumerations

enum  _adc_etc_status_flag_mask
 ADC_ETC customized status flags mask.
 
enum  adc_etc_external_trigger_source_t
 External triggers sources.
 
enum  adc_etc_interrupt_enable_t
 Interrupt enable/disable mask.
 
enum  adc_etc_dma_mode_selection_t
 DMA mode selection.
 

Initialization

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...
 

Data Structure Documentation

struct adc_etc_config_t
struct adc_etc_trigger_chain_config_t
struct adc_etc_trigger_config_t

Macro Definition Documentation

#define FSL_ADC_ETC_DRIVER_VERSION   (MAKE_VERSION(2, 1, 2))

Version 2.1.2.

#define ADC_ETC_DMA_CTRL_TRGn_REQ_MASK   0xFF0000U

Function Documentation

void ADC_ETC_Init ( ADC_ETC_Type *  base,
const adc_etc_config_t config 
)
Parameters
baseADC_ETC peripheral base address.
configPointer to "adc_etc_config_t" structure.
void ADC_ETC_Deinit ( ADC_ETC_Type *  base)
Parameters
baseADC_ETC peripheral base address.
void ADC_ETC_GetDefaultConfig ( adc_etc_config_t config)

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
configPointer to "adc_etc_config_t" structure.
void ADC_ETC_SetTriggerConfig ( ADC_ETC_Type *  base,
uint32_t  triggerGroup,
const adc_etc_trigger_config_t config 
)
Parameters
baseADC_ETC peripheral base address.
triggerGroupTrigger group index.
configPointer to "adc_etc_trigger_config_t" structure.
void ADC_ETC_SetTriggerChainConfig ( ADC_ETC_Type *  base,
uint32_t  triggerGroup,
uint32_t  chainGroup,
const adc_etc_trigger_chain_config_t config 
)

For example, if triggerGroup is set to 0U and chainGroup is set to 1U, which means Trigger0 source's chain1 would be configurated.

Parameters
baseADC_ETC peripheral base address.
triggerGroupTrigger group index. Available number is 0~7.
chainGroupTrigger chain group index. Available number is 0~7.
configPointer to "adc_etc_trigger_chain_config_t" structure.
uint32_t ADC_ETC_GetInterruptStatusFlags ( ADC_ETC_Type *  base,
adc_etc_external_trigger_source_t  sourceIndex 
)
Parameters
baseADC_ETC peripheral base address.
sourceIndextrigger source index.
Returns
Status flags mask of trigger. Refer to "_adc_etc_status_flag_mask".
void ADC_ETC_ClearInterruptStatusFlags ( ADC_ETC_Type *  base,
adc_etc_external_trigger_source_t  sourceIndex,
uint32_t  mask 
)
Parameters
baseADC_ETC peripheral base address.
sourceIndextrigger source index.
maskStatus 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
baseADC_ETC peripheral base address.
triggerGroupTrigger group index. Available number is 0~7.
static void ADC_ETC_DisableDMA ( ADC_ETC_Type *  base,
uint32_t  triggerGroup 
)
inlinestatic
Parameters
baseADC_ETC peripheral base address.
triggerGroupTrigger 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
baseADC_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
baseADC_ETC peripheral base address.
maskMask 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
baseADC_ETC peripheral base address.
enableEnable/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
baseADC_ETC peripheral base address.
triggerGroupTrigger 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
baseADC_ETC peripheral base address.
triggerGroupTrigger group index. Available number is 0~7.
chainGroupTrigger chain group index. Available number is 0~7.
Returns
ADC conversion result value.