MCUXpresso SDK API Reference Manual  Rev 2.16.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
ADC: 12-bit SAR Analog-to-Digital Converter Driver

Overview

The MCUXpresso SDK provides a peripheral driver for the 12-bit Successive Approximation (SAR) Analog-to-Digital Converter (ADC) module of MCUXpresso SDK devices.

Typical use case

Polling Configuration

Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/fsl_adc

Interrupt Configuration

Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/fsl_adc

Files

file  fsl_adc.h
 

Data Structures

struct  _adc_config
 Define structure for configuring the block. More...
 
struct  _adc_conv_seq_config
 Define structure for configuring conversion sequence. More...
 
struct  _adc_result_info
 Define structure of keeping conversion result information. More...
 

Typedefs

typedef enum _adc_clock_mode adc_clock_mode_t
 Define selection of clock mode.
 
typedef enum _adc_resolution adc_resolution_t
 Define selection of resolution.
 
typedef enum _adc_trigger_polarity adc_trigger_polarity_t
 Define selection of polarity of selected input trigger for conversion sequence.
 
typedef enum _adc_priority adc_priority_t
 Define selection of conversion sequence's priority.
 
typedef enum
_adc_seq_interrupt_mode 
adc_seq_interrupt_mode_t
 Define selection of conversion sequence's interrupt.
 
typedef enum
_adc_threshold_compare_status 
adc_threshold_compare_status_t
 Define status of threshold compare result.
 
typedef enum
_adc_threshold_crossing_status 
adc_threshold_crossing_status_t
 Define status of threshold crossing detection result.
 
typedef enum
_adc_threshold_interrupt_mode 
adc_threshold_interrupt_mode_t
 Define interrupt mode for threshold compare event.
 
typedef enum _adc_inforesultshift adc_inforesult_t
 Define the info result mode of different resolution.
 
typedef enum
_adc_tempsensor_common_mode 
adc_tempsensor_common_mode_t
 Define common modes for Temerature sensor.
 
typedef enum _adc_second_control adc_second_control_t
 Define source impedance modes for GPADC control.
 
typedef struct _adc_config adc_config_t
 Define structure for configuring the block.
 
typedef struct _adc_conv_seq_config adc_conv_seq_config_t
 Define structure for configuring conversion sequence.
 
typedef struct _adc_result_info adc_result_info_t
 Define structure of keeping conversion result information.
 

Enumerations

enum  _adc_status_flags {
  kADC_ThresholdCompareFlagOnChn0 = 1U << 0U,
  kADC_ThresholdCompareFlagOnChn1 = 1U << 1U,
  kADC_ThresholdCompareFlagOnChn2 = 1U << 2U,
  kADC_ThresholdCompareFlagOnChn3 = 1U << 3U,
  kADC_ThresholdCompareFlagOnChn4 = 1U << 4U,
  kADC_ThresholdCompareFlagOnChn5 = 1U << 5U,
  kADC_ThresholdCompareFlagOnChn6 = 1U << 6U,
  kADC_ThresholdCompareFlagOnChn7 = 1U << 7U,
  kADC_ThresholdCompareFlagOnChn8 = 1U << 8U,
  kADC_ThresholdCompareFlagOnChn9 = 1U << 9U,
  kADC_ThresholdCompareFlagOnChn10 = 1U << 10U,
  kADC_ThresholdCompareFlagOnChn11 = 1U << 11U,
  kADC_OverrunFlagForChn0,
  kADC_OverrunFlagForChn1,
  kADC_OverrunFlagForChn2,
  kADC_OverrunFlagForChn3,
  kADC_OverrunFlagForChn4,
  kADC_OverrunFlagForChn5,
  kADC_OverrunFlagForChn6,
  kADC_OverrunFlagForChn7,
  kADC_OverrunFlagForChn8,
  kADC_OverrunFlagForChn9,
  kADC_OverrunFlagForChn10,
  kADC_OverrunFlagForChn11,
  kADC_GlobalOverrunFlagForSeqA = 1U << 24U,
  kADC_GlobalOverrunFlagForSeqB = 1U << 25U,
  kADC_ConvSeqAInterruptFlag = 1U << 28U,
  kADC_ConvSeqBInterruptFlag = 1U << 29U,
  kADC_ThresholdCompareInterruptFlag = 1U << 30U,
  kADC_OverrunInterruptFlag = (int)(1U << 31U)
}
 Flags. More...
 
enum  _adc_interrupt_enable {
  kADC_ConvSeqAInterruptEnable = ADC_INTEN_SEQA_INTEN_MASK,
  kADC_ConvSeqBInterruptEnable = ADC_INTEN_SEQB_INTEN_MASK,
  kADC_OverrunInterruptEnable = ADC_INTEN_OVR_INTEN_MASK
}
 Interrupts. More...
 
enum  _adc_clock_mode {
  kADC_ClockSynchronousMode,
  kADC_ClockAsynchronousMode = 1U
}
 Define selection of clock mode. More...
 
enum  _adc_resolution {
  kADC_Resolution6bit = 0U,
  kADC_Resolution8bit = 1U,
  kADC_Resolution10bit = 2U,
  kADC_Resolution12bit = 3U
}
 Define selection of resolution. More...
 
enum  _adc_trigger_polarity {
  kADC_TriggerPolarityNegativeEdge = 0U,
  kADC_TriggerPolarityPositiveEdge = 1U
}
 Define selection of polarity of selected input trigger for conversion sequence. More...
 
enum  _adc_priority {
  kADC_PriorityLow = 0U,
  kADC_PriorityHigh = 1U
}
 Define selection of conversion sequence's priority. More...
 
enum  _adc_seq_interrupt_mode {
  kADC_InterruptForEachConversion = 0U,
  kADC_InterruptForEachSequence = 1U
}
 Define selection of conversion sequence's interrupt. More...
 
enum  _adc_threshold_compare_status {
  kADC_ThresholdCompareInRange = 0U,
  kADC_ThresholdCompareBelowRange = 1U,
  kADC_ThresholdCompareAboveRange = 2U
}
 Define status of threshold compare result. More...
 
enum  _adc_threshold_crossing_status {
  kADC_ThresholdCrossingNoDetected = 0U,
  kADC_ThresholdCrossingDownward = 2U,
  kADC_ThresholdCrossingUpward = 3U
}
 Define status of threshold crossing detection result. More...
 
enum  _adc_threshold_interrupt_mode {
  kADC_ThresholdInterruptDisabled = 0U,
  kADC_ThresholdInterruptOnOutside = 1U,
  kADC_ThresholdInterruptOnCrossing = 2U
}
 Define interrupt mode for threshold compare event. More...
 
enum  _adc_inforesultshift {
  kADC_Resolution12bitInfoResultShift = 0U,
  kADC_Resolution10bitInfoResultShift = 2U,
  kADC_Resolution8bitInfoResultShift = 4U,
  kADC_Resolution6bitInfoResultShift = 6U
}
 Define the info result mode of different resolution. More...
 
enum  _adc_tempsensor_common_mode {
  kADC_HighNegativeOffsetAdded = 0x0U,
  kADC_IntermediateNegativeOffsetAdded,
  kADC_NoOffsetAdded = 0x8U,
  kADC_LowPositiveOffsetAdded = 0xcU
}
 Define common modes for Temerature sensor. More...
 
enum  _adc_second_control {
  kADC_Impedance621Ohm = 0x1U << 9U,
  kADC_Impedance55kOhm,
  kADC_Impedance87kOhm = 0x1fU << 9U,
  kADC_NormalFunctionalMode = 0x0U << 14U,
  kADC_MultiplexeTestMode = 0x1U << 14U,
  kADC_ADCInUnityGainMode = 0x2U << 14U
}
 Define source impedance modes for GPADC control. More...
 

Driver version

#define FSL_ADC_DRIVER_VERSION   (MAKE_VERSION(2, 5,3))
 ADC driver version 2.5.3. More...
 

Initialization and Deinitialization

void ADC_Init (ADC_Type *base, const adc_config_t *config)
 Initialize the ADC module. More...
 
void ADC_Deinit (ADC_Type *base)
 Deinitialize the ADC module. More...
 
void ADC_GetDefaultConfig (adc_config_t *config)
 Gets an available pre-defined settings for initial configuration. More...
 
bool ADC_DoSelfCalibration (ADC_Type *base)
 Do the hardware self-calibration. More...
 
bool ADC_DoOffsetCalibration (ADC_Type *base, uint32_t frequency)
 Do the hardware offset-calibration. More...
 

Control conversion sequence A.

static void ADC_EnableConvSeqA (ADC_Type *base, bool enable)
 Enable the conversion sequence A. More...
 
void ADC_SetConvSeqAConfig (ADC_Type *base, const adc_conv_seq_config_t *config)
 Configure the conversion sequence A. More...
 
static void ADC_DoSoftwareTriggerConvSeqA (ADC_Type *base)
 Do trigger the sequence's conversion by software. More...
 
static void ADC_EnableConvSeqABurstMode (ADC_Type *base, bool enable)
 Enable the burst conversion of sequence A. More...
 
static void ADC_SetConvSeqAHighPriority (ADC_Type *base)
 Set the high priority for conversion sequence A. More...
 

Control conversion sequence B.

static void ADC_EnableConvSeqB (ADC_Type *base, bool enable)
 Enable the conversion sequence B. More...
 
void ADC_SetConvSeqBConfig (ADC_Type *base, const adc_conv_seq_config_t *config)
 Configure the conversion sequence B. More...
 
static void ADC_DoSoftwareTriggerConvSeqB (ADC_Type *base)
 Do trigger the sequence's conversion by software. More...
 
static void ADC_EnableConvSeqBBurstMode (ADC_Type *base, bool enable)
 Enable the burst conversion of sequence B. More...
 
static void ADC_SetConvSeqBHighPriority (ADC_Type *base)
 Set the high priority for conversion sequence B. More...
 

Data result.

bool ADC_GetConvSeqAGlobalConversionResult (ADC_Type *base, adc_result_info_t *info)
 Get the global ADC conversion infomation of sequence A. More...
 
bool ADC_GetConvSeqBGlobalConversionResult (ADC_Type *base, adc_result_info_t *info)
 Get the global ADC conversion infomation of sequence B. More...
 
bool ADC_GetChannelConversionResult (ADC_Type *base, uint32_t channel, adc_result_info_t *info)
 Get the channel's ADC conversion completed under each conversion sequence. More...
 

Threshold function.

static void ADC_SetThresholdPair0 (ADC_Type *base, uint32_t lowValue, uint32_t highValue)
 Set the threshhold pair 0 with low and high value. More...
 
static void ADC_SetThresholdPair1 (ADC_Type *base, uint32_t lowValue, uint32_t highValue)
 Set the threshhold pair 1 with low and high value. More...
 
static void ADC_SetChannelWithThresholdPair0 (ADC_Type *base, uint32_t channelMask)
 Set given channels to apply the threshold pare 0. More...
 
static void ADC_SetChannelWithThresholdPair1 (ADC_Type *base, uint32_t channelMask)
 Set given channels to apply the threshold pare 1. More...
 

Interrupts.

static void ADC_EnableInterrupts (ADC_Type *base, uint32_t mask)
 Enable interrupts for conversion sequences. More...
 
static void ADC_DisableInterrupts (ADC_Type *base, uint32_t mask)
 Disable interrupts for conversion sequence. More...
 
static void ADC_EnableThresholdCompareInterrupt (ADC_Type *base, uint32_t channel, adc_threshold_interrupt_mode_t mode)
 Enable the interrupt of threshold compare event for each channel. More...
 

Status.

static uint32_t ADC_GetStatusFlags (ADC_Type *base)
 Get status flags of ADC module. More...
 
static void ADC_ClearStatusFlags (ADC_Type *base, uint32_t mask)
 Clear status flags of ADC module. More...
 

Data Structure Documentation

struct _adc_config

Data Fields

adc_clock_mode_t clockMode
 Select the clock mode for ADC converter. More...
 
uint32_t clockDividerNumber
 This field is only available when using kADC_ClockSynchronousMode for "clockMode" field. More...
 
adc_resolution_t resolution
 Select the conversion bits. More...
 
bool enableBypassCalibration
 By default, a calibration cycle must be performed each time the chip is powered-up. More...
 
uint32_t sampleTimeNumber
 By default, with value as "0U", the sample period would be 2.5 ADC clocks. More...
 

Field Documentation

adc_clock_mode_t _adc_config::clockMode
uint32_t _adc_config::clockDividerNumber

The divider would be plused by 1 based on the value in this field. The available range is in 8 bits.

adc_resolution_t _adc_config::resolution
bool _adc_config::enableBypassCalibration

Re-calibration may be warranted periodically - especially if operating conditions have changed. To enable this option would avoid the need to calibrate if offset error is not a concern in the application.

uint32_t _adc_config::sampleTimeNumber

Then, to plus the "sampleTimeNumber" value here. The available value range is in 3 bits.

struct _adc_conv_seq_config

Data Fields

uint32_t channelMask
 
              Selects which one or more of the ADC channels will be sampled and converted when this

sequence is launched. More...

 
uint32_t triggerMask
 
              Selects which one or more of the available hardware trigger sources will cause this

conversion sequence to be initiated. More...

 
adc_trigger_polarity_t triggerPolarity
 Select the trigger to launch conversion sequence. More...
 
bool enableSyncBypass
 
             To enable this feature allows the hardware trigger input to bypass synchronization

flip-flop stages and therefore shorten the time between the trigger input signal and the start of a conversion. More...

 
bool enableSingleStep
 
             When enabling this feature, a trigger will launch a single conversion on the next

channel in the sequence instead of the default response of launching an entire sequence of conversions. More...

 
adc_seq_interrupt_mode_t interruptMode
 Select the interrpt/DMA trigger mode. More...
 

Field Documentation

uint32_t _adc_conv_seq_config::channelMask

The masked channels would be involved in current conversion sequence, beginning with the lowest-order. The available range is in 12-bit.

uint32_t _adc_conv_seq_config::triggerMask

The available range is 6-bit.

adc_trigger_polarity_t _adc_conv_seq_config::triggerPolarity
bool _adc_conv_seq_config::enableSyncBypass
bool _adc_conv_seq_config::enableSingleStep
adc_seq_interrupt_mode_t _adc_conv_seq_config::interruptMode
struct _adc_result_info

Data Fields

uint32_t result
 Keep the conversion data value. More...
 
adc_threshold_compare_status_t thresholdCompareStatus
 Keep the threshold compare status. More...
 
adc_threshold_crossing_status_t thresholdCorssingStatus
 Keep the threshold crossing status. More...
 
uint32_t channelNumber
 Keep the channel number for this conversion. More...
 
bool overrunFlag
 Keep the status whether the conversion is overrun or not. More...
 

Field Documentation

uint32_t _adc_result_info::result
adc_threshold_compare_status_t _adc_result_info::thresholdCompareStatus
adc_threshold_crossing_status_t _adc_result_info::thresholdCorssingStatus
uint32_t _adc_result_info::channelNumber
bool _adc_result_info::overrunFlag

Macro Definition Documentation

#define FSL_ADC_DRIVER_VERSION   (MAKE_VERSION(2, 5,3))

Enumeration Type Documentation

Enumerator
kADC_ThresholdCompareFlagOnChn0 

Threshold comparison event on Channel 0.

kADC_ThresholdCompareFlagOnChn1 

Threshold comparison event on Channel 1.

kADC_ThresholdCompareFlagOnChn2 

Threshold comparison event on Channel 2.

kADC_ThresholdCompareFlagOnChn3 

Threshold comparison event on Channel 3.

kADC_ThresholdCompareFlagOnChn4 

Threshold comparison event on Channel 4.

kADC_ThresholdCompareFlagOnChn5 

Threshold comparison event on Channel 5.

kADC_ThresholdCompareFlagOnChn6 

Threshold comparison event on Channel 6.

kADC_ThresholdCompareFlagOnChn7 

Threshold comparison event on Channel 7.

kADC_ThresholdCompareFlagOnChn8 

Threshold comparison event on Channel 8.

kADC_ThresholdCompareFlagOnChn9 

Threshold comparison event on Channel 9.

kADC_ThresholdCompareFlagOnChn10 

Threshold comparison event on Channel 10.

kADC_ThresholdCompareFlagOnChn11 

Threshold comparison event on Channel 11.

kADC_OverrunFlagForChn0 

Mirror the OVERRUN status flag from the result register for ADC channel 0.

kADC_OverrunFlagForChn1 

Mirror the OVERRUN status flag from the result register for ADC channel 1.

kADC_OverrunFlagForChn2 

Mirror the OVERRUN status flag from the result register for ADC channel 2.

kADC_OverrunFlagForChn3 

Mirror the OVERRUN status flag from the result register for ADC channel 3.

kADC_OverrunFlagForChn4 

Mirror the OVERRUN status flag from the result register for ADC channel 4.

kADC_OverrunFlagForChn5 

Mirror the OVERRUN status flag from the result register for ADC channel 5.

kADC_OverrunFlagForChn6 

Mirror the OVERRUN status flag from the result register for ADC channel 6.

kADC_OverrunFlagForChn7 

Mirror the OVERRUN status flag from the result register for ADC channel 7.

kADC_OverrunFlagForChn8 

Mirror the OVERRUN status flag from the result register for ADC channel 8.

kADC_OverrunFlagForChn9 

Mirror the OVERRUN status flag from the result register for ADC channel 9.

kADC_OverrunFlagForChn10 

Mirror the OVERRUN status flag from the result register for ADC channel 10.

kADC_OverrunFlagForChn11 

Mirror the OVERRUN status flag from the result register for ADC channel 11.

kADC_GlobalOverrunFlagForSeqA 

Mirror the glabal OVERRUN status flag for conversion sequence A.

kADC_GlobalOverrunFlagForSeqB 

Mirror the global OVERRUN status flag for conversion sequence B.

kADC_ConvSeqAInterruptFlag 

Sequence A interrupt/DMA trigger.

kADC_ConvSeqBInterruptFlag 

Sequence B interrupt/DMA trigger.

kADC_ThresholdCompareInterruptFlag 

Threshold comparision interrupt flag.

kADC_OverrunInterruptFlag 

Overrun interrupt flag.

Note
Not all the interrupt options are listed here
Enumerator
kADC_ConvSeqAInterruptEnable 

Enable interrupt upon completion of each individual conversion in sequence A, or entire sequence.

kADC_ConvSeqBInterruptEnable 

Enable interrupt upon completion of each individual conversion in sequence B, or entire sequence.

kADC_OverrunInterruptEnable 

Enable the detection of an overrun condition on any of the channel data registers will cause an overrun interrupt/DMA trigger.

Enumerator
kADC_ClockSynchronousMode 

The ADC clock would be derived from the system clock based on "clockDividerNumber".

kADC_ClockAsynchronousMode 

The ADC clock would be based on the SYSCON block's divider.

Enumerator
kADC_Resolution6bit 

6-bit resolution.

kADC_Resolution8bit 

8-bit resolution.

kADC_Resolution10bit 

10-bit resolution.

kADC_Resolution12bit 

12-bit resolution.

Enumerator
kADC_TriggerPolarityNegativeEdge 

A negative edge launches the conversion sequence on the trigger(s).

kADC_TriggerPolarityPositiveEdge 

A positive edge launches the conversion sequence on the trigger(s).

Enumerator
kADC_PriorityLow 

This sequence would be preempted when another sequence is started.

kADC_PriorityHigh 

This sequence would preempt other sequence even when it is started.

Enumerator
kADC_InterruptForEachConversion 

The sequence interrupt/DMA trigger will be set at the end of each individual ADC conversion inside this conversion sequence.

kADC_InterruptForEachSequence 

The sequence interrupt/DMA trigger will be set when the entire set of this sequence conversions completes.

Enumerator
kADC_ThresholdCompareInRange 

LOW threshold <= conversion value <= HIGH threshold.

kADC_ThresholdCompareBelowRange 

conversion value < LOW threshold.

kADC_ThresholdCompareAboveRange 

conversion value > HIGH threshold.

Enumerator
kADC_ThresholdCrossingNoDetected 

No threshold Crossing detected.

kADC_ThresholdCrossingDownward 

Downward Threshold Crossing detected.

kADC_ThresholdCrossingUpward 

Upward Threshold Crossing Detected.

Enumerator
kADC_ThresholdInterruptDisabled 

Threshold comparison interrupt is disabled.

kADC_ThresholdInterruptOnOutside 

Threshold comparison interrupt is enabled on outside threshold.

kADC_ThresholdInterruptOnCrossing 

Threshold comparison interrupt is enabled on crossing threshold.

Enumerator
kADC_Resolution12bitInfoResultShift 

Info result shift of Resolution12bit.

kADC_Resolution10bitInfoResultShift 

Info result shift of Resolution10bit.

kADC_Resolution8bitInfoResultShift 

Info result shift of Resolution8bit.

kADC_Resolution6bitInfoResultShift 

Info result shift of Resolution6bit.

Enumerator
kADC_HighNegativeOffsetAdded 

Temperature sensor common mode: high negative offset added.

kADC_IntermediateNegativeOffsetAdded 

Temperature sensor common mode: intermediate negative offset added.

kADC_NoOffsetAdded 

Temperature sensor common mode: no offset added.

kADC_LowPositiveOffsetAdded 

Temperature sensor common mode: low positive offset added.

Enumerator
kADC_Impedance621Ohm 

Extand ADC sampling time according to source impedance 1: 0.621 kOhm.

kADC_Impedance55kOhm 

Extand ADC sampling time according to source impedance 20 (default): 55 kOhm.

kADC_Impedance87kOhm 

Extand ADC sampling time according to source impedance 31: 87 kOhm.

kADC_NormalFunctionalMode 

TEST mode: Normal functional mode.

kADC_MultiplexeTestMode 

TEST mode: Multiplexer test mode.

kADC_ADCInUnityGainMode 

TEST mode: ADC in unity gain mode.

Function Documentation

void ADC_Init ( ADC_Type *  base,
const adc_config_t config 
)
Parameters
baseADC peripheral base address.
configPointer to configuration structure, see to adc_config_t.
void ADC_Deinit ( ADC_Type *  base)
Parameters
baseADC peripheral base address.
void ADC_GetDefaultConfig ( adc_config_t config)

This function initializes the initial configuration structure with an available settings. The default values are:

* config->clockMode = kADC_ClockSynchronousMode;
* config->clockDividerNumber = 0U;
* config->resolution = kADC_Resolution12bit;
* config->enableBypassCalibration = false;
* config->sampleTimeNumber = 0U;
*
Parameters
configPointer to configuration structure.
bool ADC_DoSelfCalibration ( ADC_Type *  base)
Deprecated:
Do not use this function. It has been superceded by ADC_DoOffsetCalibration.

To calibrate the ADC, set the ADC clock to 500 kHz. In order to achieve the specified ADC accuracy, the A/D converter must be recalibrated, at a minimum, following every chip reset before initiating normal ADC operation.

Parameters
baseADC peripheral base address.
Return values
trueCalibration succeed.
falseCalibration failed.
bool ADC_DoOffsetCalibration ( ADC_Type *  base,
uint32_t  frequency 
)

To calibrate the ADC, set the ADC clock to no more then 30 MHz. In order to achieve the specified ADC accuracy, the A/D converter must be recalibrated, at a minimum, following every chip reset before initiating normal ADC operation.

Parameters
baseADC peripheral base address.
frequencyThe clock frequency that ADC operates at.
Return values
trueCalibration succeed.
falseCalibration failed.
static void ADC_EnableConvSeqA ( ADC_Type *  base,
bool  enable 
)
inlinestatic

In order to avoid spuriously triggering the sequence, the trigger to conversion sequence should be ready before the sequence is ready. when the sequence is disabled, the trigger would be ignored. Also, it is suggested to disable the sequence during changing the sequence's setting.

Parameters
baseADC peripheral base address.
enableSwitcher to enable the feature or not.
void ADC_SetConvSeqAConfig ( ADC_Type *  base,
const adc_conv_seq_config_t config 
)
Parameters
baseADC peripheral base address.
configPointer to configuration structure, see to adc_conv_seq_config_t.
static void ADC_DoSoftwareTriggerConvSeqA ( ADC_Type *  base)
inlinestatic
Parameters
baseADC peripheral base address.
static void ADC_EnableConvSeqABurstMode ( ADC_Type *  base,
bool  enable 
)
inlinestatic

Enable the burst mode would cause the conversion sequence to be cntinuously cycled through. Other triggers would be ignored while this mode is enabled. Repeated conversions could be halted by disabling this mode. And the sequence currently in process will be completed before cnversions are terminated. Note that a new sequence could begin just before the burst mode is disabled.

Parameters
baseADC peripheral base address.
enableSwitcher to enable this feature.
static void ADC_SetConvSeqAHighPriority ( ADC_Type *  base)
inlinestatic
Parameters
baseADC peripheral bass address.
static void ADC_EnableConvSeqB ( ADC_Type *  base,
bool  enable 
)
inlinestatic

In order to avoid spuriously triggering the sequence, the trigger to conversion sequence should be ready before the sequence is ready. when the sequence is disabled, the trigger would be ignored. Also, it is suggested to disable the sequence during changing the sequence's setting.

Parameters
baseADC peripheral base address.
enableSwitcher to enable the feature or not.
void ADC_SetConvSeqBConfig ( ADC_Type *  base,
const adc_conv_seq_config_t config 
)
Parameters
baseADC peripheral base address.
configPointer to configuration structure, see to adc_conv_seq_config_t.
static void ADC_DoSoftwareTriggerConvSeqB ( ADC_Type *  base)
inlinestatic
Parameters
baseADC peripheral base address.
static void ADC_EnableConvSeqBBurstMode ( ADC_Type *  base,
bool  enable 
)
inlinestatic

Enable the burst mode would cause the conversion sequence to be continuously cycled through. Other triggers would be ignored while this mode is enabled. Repeated conversions could be halted by disabling this mode. And the sequence currently in process will be completed before cnversions are terminated. Note that a new sequence could begin just before the burst mode is disabled.

Parameters
baseADC peripheral base address.
enableSwitcher to enable this feature.
static void ADC_SetConvSeqBHighPriority ( ADC_Type *  base)
inlinestatic
Parameters
baseADC peripheral bass address.
bool ADC_GetConvSeqAGlobalConversionResult ( ADC_Type *  base,
adc_result_info_t info 
)
Parameters
baseADC peripheral base address.
infoPointer to information structure, see to adc_result_info_t;
Return values
trueThe conversion result is ready.
falseThe conversion result is not ready yet.
bool ADC_GetConvSeqBGlobalConversionResult ( ADC_Type *  base,
adc_result_info_t info 
)
Parameters
baseADC peripheral base address.
infoPointer to information structure, see to adc_result_info_t;
Return values
trueThe conversion result is ready.
falseThe conversion result is not ready yet.
bool ADC_GetChannelConversionResult ( ADC_Type *  base,
uint32_t  channel,
adc_result_info_t info 
)
Parameters
baseADC peripheral base address.
channelThe indicated channel number.
infoPointer to information structure, see to adc_result_info_t;
Return values
trueThe conversion result is ready.
falseThe conversion result is not ready yet.
static void ADC_SetThresholdPair0 ( ADC_Type *  base,
uint32_t  lowValue,
uint32_t  highValue 
)
inlinestatic
Parameters
baseADC peripheral base address.
lowValueLOW threshold value.
highValueHIGH threshold value.
static void ADC_SetThresholdPair1 ( ADC_Type *  base,
uint32_t  lowValue,
uint32_t  highValue 
)
inlinestatic
Parameters
baseADC peripheral base address.
lowValueLOW threshold value. The available value is with 12-bit.
highValueHIGH threshold value. The available value is with 12-bit.
static void ADC_SetChannelWithThresholdPair0 ( ADC_Type *  base,
uint32_t  channelMask 
)
inlinestatic
Parameters
baseADC peripheral base address.
channelMaskIndicated channels' mask.
static void ADC_SetChannelWithThresholdPair1 ( ADC_Type *  base,
uint32_t  channelMask 
)
inlinestatic
Parameters
baseADC peripheral base address.
channelMaskIndicated channels' mask.
static void ADC_EnableInterrupts ( ADC_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseADC peripheral base address.
maskMask of interrupt mask value for global block except each channal, see to _adc_interrupt_enable.
static void ADC_DisableInterrupts ( ADC_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseADC peripheral base address.
maskMask of interrupt mask value for global block except each channel, see to _adc_interrupt_enable.
static void ADC_EnableThresholdCompareInterrupt ( ADC_Type *  base,
uint32_t  channel,
adc_threshold_interrupt_mode_t  mode 
)
inlinestatic
Parameters
baseADC peripheral base address.
channelChannel number.
modeInterrupt mode for threshold compare event, see to adc_threshold_interrupt_mode_t.
static uint32_t ADC_GetStatusFlags ( ADC_Type *  base)
inlinestatic
Parameters
baseADC peripheral base address.
Returns
Mask of status flags of module, see to _adc_status_flags.
static void ADC_ClearStatusFlags ( ADC_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseADC peripheral base address.
maskMask of status flags of module, see to _adc_status_flags.