MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
This document consists of sections titled with Driver Overview, Data Structures, Enumerations, Functions, etc., each with an overview list and detailed documentation. It is recommended to read the Driver Overview first for it includes a comprehensive description of the peripheral, driver and driver changes. Other sections give detailed information for APIs, enums, macros, etc., for your further reference.
Driver Overview | |
CADC Peripheral and Driver Overview | |
Content including 1) peripheral features, work logic and work method; 2) driver design logic and use method; 3) typical use case. | |
The Driver Change Log | |
The current CADC driver version is 2.0.0. | |
Data Structures | |
struct | cadc_sample_slot_independentParallel_mode_disabled_t |
The structure of the disabled sample slots in independent parallel mode. More... | |
union | cadc_sample_slot_disabled_t |
The union of disabled sample slot for each scan mode. More... | |
struct | cadc_sample_slot_config_t |
The structure for configuring the sample slot. More... | |
struct | cadc_scan_ctrl_seq_mode_t |
Cadc scan control for sequential scan mode. More... | |
struct | cadc_scan_ctrl_simultParallel_mode_t |
Cadc scan control for simultaneous parallel scan mode. More... | |
struct | cadc_scan_ctrl_independent_parallel_mode_converterA_t |
The scan ctrl struture for converterA in independent scan mode. More... | |
struct | cadc_scan_ctrl_independent_parallel_mode_converterB_t |
The scan ctrl struture for converterB in independent scan mode. More... | |
union | cadc_scan_ctrl_independent_parallel_mode_t |
The union for converters in independent parallel mode. More... | |
union | cadc_scan_control_t |
The union of the scan control for each scan mode. More... | |
struct | cadc_converter_config_t |
The structure for configuring each converter. More... | |
struct | cadc_config_t |
The structure for configuring the Cyclic ADC's setting. More... | |
Driver version | |
#define | FSL_CADC_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
Initialization and deinitialization Interfaces | |
void | CADC_Init (ADC_Type *base, const cadc_config_t *psConfig) |
Initializes the CADC module, such as scan mode, DMA trigger source, interrupt mask and so on. More... | |
void | CADC_GetDefaultConfig (cadc_config_t *psConfig) |
Gets an available pre-defined options(such as scan mode, DMA trigger source, interrupt mask and so on) for module's configuration. More... | |
void | CADC_Deinit (ADC_Type *base) |
De-initializes the CADC module, including power down both converter and disable the clock(Optional). More... | |
Scan related Interfaces | |
static void | CADC_SetScanMode (ADC_Type *base, cadc_scan_mode_t eScanMode) |
Sets the scan mode(such as Sequential scan mode, Simultaneous parallel scan mode, Independent parallel scan mode) of dual converters. More... | |
static void | CADC_SetScanControl (ADC_Type *base, cadc_scan_control_t uScanControl) |
The function provides the ability to pause and await new sync in the conversion sequence. More... | |
Channel control Interfaces | |
void | CADC_SetChannelMode (ADC_Type *base, cadc_channel_mode_t eChannelMode) |
Sets mode for the specific channel(Each channel can be set as single-end, fully differential and unipolar differential(Optional) mode). More... | |
void | CADC_SetChannelGain (ADC_Type *base, cadc_channel_number_t eChannelNumber, cadc_channel_gain_t eChannelGain) |
Sets the gain(Supports X1, X2, X4) of selected channel. More... | |
Sample Slot Control Interfaces | |
void | CADC_GetSampleSlotDefaultConfig (cadc_sample_slot_config_t *psConfig) |
Gets sample slot default configuration including zero crossing mode, high limit value, low limit value and offset value. More... | |
void | CADC_SetSampleSlotConfig (ADC_Type *base, cadc_sample_slot_index_t eSampleIndex, const cadc_sample_slot_config_t *psConfig) |
Configures the options(including zero crossing mode, high limit value, low limit value and offset value) for sample slot. More... | |
void | CADC_SetSampleSlotZeroCrossingMode (ADC_Type *base, cadc_sample_slot_index_t eSampleIndex, cadc_sample_slot_zero_crossing_mode_t eZeroCrossingMode) |
Sets zero-crossing mode for the selected sample slot. More... | |
void | CADC_RouteChannelToSampleSlot (ADC_Type *base, cadc_sample_slot_index_t eSampleIndex, cadc_channel_number_t eChannelNumber) |
Routes the channel to the sample slot. More... | |
static void | CADC_SetSampleSlotLowLimitValue (ADC_Type *base, cadc_sample_slot_index_t eSampleIndex, uint16_t u16LowLimitValue) |
Sets the low limit value(-32768 ~ 32767 with lower three bits of fixed value 0) for the specific sample slot. More... | |
static void | CADC_SetSampleSlotHighLimitValue (ADC_Type *base, cadc_sample_slot_index_t eSampleIndex, uint16_t u16HighLimitValue) |
Sets the high limit value(-32768 ~ 32767 with lower three bits of fixed value 0) for the specific sample slot. More... | |
static void | CADC_SetSampleSlotOffsetValue (ADC_Type *base, cadc_sample_slot_index_t eSampleIndex, uint16_t u16OffsetValue) |
Sets the offset value(-32768 ~ 32767 with lower three bits of fixed value 0) for the specific sample slot. More... | |
static uint16_t | CADC_GetSampleSlotResultValue (ADC_Type *base, cadc_sample_slot_index_t eSampleIndex) |
Gets the sample result value. More... | |
Converters Control Interfaces | |
void | CADC_GetConverterDefaultConfig (cadc_converter_config_t *psConfig) |
Gets available pre-defined settings(such as clock divisor, reference voltage source, and so on) for each converter's configuration. More... | |
void | CADC_SetConverterConfig (ADC_Type *base, cadc_converter_id_t eConverterId, const cadc_converter_config_t *psConfig) |
Configures the options(such as clock divisor, reference voltage source, and so on) for the converter. More... | |
static void | CADC_EnableConverter (ADC_Type *base, cadc_converter_id_t eConverterId, bool bEnable) |
Changes the converter to stop mode or normal mode. More... | |
static void | CADC_EnableConverterSyncInput (ADC_Type *base, cadc_converter_id_t eConverterId, bool bEnable) |
Enables/Disables the external sync input pulse to initiate a scan. More... | |
static void | CADC_DoSoftwareTriggerConverter (ADC_Type *base, cadc_converter_id_t eConverterId) |
Uses software trigger to start a conversion sequence. More... | |
static void | CADC_SetConverterClockDivisor (ADC_Type *base, cadc_converter_id_t eConverterId, uint16_t u16ClockDivisor) |
Sets clock divisor(Range from 0 to 63) for converterA and conveter B. More... | |
void | CADC_SetConverterReferenceVoltageSource (ADC_Type *base, cadc_converter_id_t eConverterId, cadc_reference_voltage_source_t eHighReferenceVoltage, cadc_reference_voltage_source_t eLowReferenceVoltage) |
Sets converter's reference voltage source(Including high reference voltage source and low reference voltage source). More... | |
void | CADC_EnableConverterPower (ADC_Type *base, cadc_converter_id_t eConverterId, bool bEnable) |
Powers up/down the specific converter. More... | |
static void | CADC_EnableConverterDMA (ADC_Type *base, cadc_converter_id_t eConverterId, bool bEnable) |
Enables/Disables the converter's DMA feature. More... | |
Power Control Interfaces | |
static void | CADC_SetPowerUpDelay (ADC_Type *base, uint16_t u16PowerUpDelay) |
Sets power up delay(The number of ADC clocks to power up the converters before allowing a scan to start). More... | |
static void | CADC_EnableAutoPowerDownMode (ADC_Type *base, bool bEnable) |
Enables/Disables auto-powerdown converters when the module is not in use for a scan. More... | |
DMA Control Interfaces | |
static void | CADC_SetDMATriggerSource (ADC_Type *base, cadc_dma_trigger_source_t eDMATriggerSource) |
Sets DMA trigger source(available selections are "End of scan" and "Sample Ready"). More... | |
Interrupt Control Interfaces | |
static void | CADC_EnableInterrupts (ADC_Type *base, uint32_t u32Mask) |
Enables the interrupts(such as high/low limit interrupts, end of scan interrupts, and so on). More... | |
static void | CADC_DisableInterrupts (ADC_Type *base, uint32_t u32Mask) |
Disables the interrupts(such as high/low limit interrupts, end of scan interrupts, and so on). More... | |
ADC Status Flag Interfaces | |
static uint16_t | CADC_GetMiscStatusFlags (ADC_Type *base) |
Gets Miscellaneous status flags, such as end of scan status flag, high/low limit interrupt flags and so on. More... | |
static void | CADC_ClearMiscStatusFlags (ADC_Type *base, uint16_t u16Flags) |
Clears Miscellaneous status flags(Only for "end of scan" status flags). More... | |
static uint32_t | CADC_GetSampleSlotReadyStatusFlags (ADC_Type *base) |
Gets sample slots ready status flag, those status flags are cleared by reading the corresponding sample slots' result. More... | |
static uint32_t | CADC_GetSampleSlotLowLimitStatusFlags (ADC_Type *base) |
Gets sample slot low limit status flags(Each bit represents one sample slot). More... | |
static void | CADC_ClearSampleSlotLowLimitStatusFlags (ADC_Type *base, uint32_t u32SampleMask) |
Clears sample slot's low limit status flags(Each bit represents one sample slot). More... | |
static uint32_t | CADC_GetSampleSlotHighLimitStatusFlags (ADC_Type *base) |
Gets sample slot high limit status flags(Each bit represents one sample slot). More... | |
static void | CADC_ClearSampleSlotHighLimitStatusFlags (ADC_Type *base, uint32_t u32SampleMask) |
Clears sample slot's high limit status flags(Each bit represents one sample slot). More... | |
static uint32_t | CADC_GetSampleSlotZeroCrossingStatusFlags (ADC_Type *base) |
Gets sample slot zero crossing status flags(Each bit represents one sample slot). More... | |
static void | CADC_ClearSampleSlotZeroCrossingStatusFlags (ADC_Type *base, uint32_t u32SampleMask) |
Clears sample slot's zero crossing status flags(Each bit represents one sample slot). More... | |
static uint16_t | CADC_GetPowerStatusFlags (ADC_Type *base) |
Gets converters power status(Those power status can not be cleared). More... | |
struct cadc_sample_slot_independentParallel_mode_disabled_t |
Data Fields | |
cadc_sample_slot_independentParallel_mode_convA_disabled_t | eConverterA |
The sample slot to be disabled for the converter A, when the scan mode is set as independent parallel mode. More... | |
cadc_sample_slot_independentParallel_mode_convB_disabled_t | eConverterB |
The sample slot to be disabled for the converter B, when the scan mode is set as independent parallel mode. More... | |
cadc_sample_slot_independentParallel_mode_convA_disabled_t cadc_sample_slot_independentParallel_mode_disabled_t::eConverterA |
cadc_sample_slot_independentParallel_mode_convB_disabled_t cadc_sample_slot_independentParallel_mode_disabled_t::eConverterB |
union cadc_sample_slot_disabled_t |
Data Fields | |
uint32_t | u32SampleDisVal |
The 32 bits width of disabled sample slot value. More... | |
cadc_sample_slot_sequential_mode_disabled_t | eSequentialModeDisSample |
If the scan mode is selected as sequential mode, the application must use this member to set the disabled sample slot. More... | |
cadc_sample_slot_simultParallel_mode_disabled_t | eSimultParallelModeDisSample |
In simultaneous parallel scan mode, the application must use this member to set the disabled sample slot. More... | |
cadc_sample_slot_independentParallel_mode_disabled_t | sIndependentParallelModeDisSample |
In independent parallel scan mode, the application must use this member to set the disabled sample slot. More... | |
uint32_t cadc_sample_slot_disabled_t::u32SampleDisVal |
This member used to get the disabled sample slot which sets in different scan modes in word type. This member is not recommended to be used to set the disabled sample slot. This member is designed to be used in driver level only, the application should not use this member.
cadc_sample_slot_sequential_mode_disabled_t cadc_sample_slot_disabled_t::eSequentialModeDisSample |
This member is used to set disabled sample slot when the scan mode is selected as sequential mode. The scan will stop at the first disabled sample slot in that mode. So for the application, this member should be set as one sample slot index that the scan will stop.
cadc_sample_slot_simultParallel_mode_disabled_t cadc_sample_slot_disabled_t::eSimultParallelModeDisSample |
In that scan mode, the scan will stop when either converter encounters a disabled sample.
cadc_sample_slot_independentParallel_mode_disabled_t cadc_sample_slot_disabled_t::sIndependentParallelModeDisSample |
In that scan mode, the converter will stop scan when it encounters a disabled sample slot. In this mode, the disabled sample slot for converterA and converterB may different.
struct cadc_sample_slot_config_t |
Data Fields | |
cadc_sample_slot_zero_crossing_mode_t | eZeroCrossingMode |
Zero crossing mode. More... | |
uint16_t | u16HighLimitValue |
High limit value. More... | |
uint16_t | u16LowLimitValue |
Low limit value. More... | |
uint16_t | u16OffsetValue |
Offset value. More... | |
cadc_sample_slot_zero_crossing_mode_t cadc_sample_slot_config_t::eZeroCrossingMode |
uint16_t cadc_sample_slot_config_t::u16HighLimitValue |
Original value formation as hardware register, with 3-bits left shifted.
uint16_t cadc_sample_slot_config_t::u16LowLimitValue |
Original value formation as hardware register, with 3-bits left shifted.
uint16_t cadc_sample_slot_config_t::u16OffsetValue |
Original value formation as hardware register, with 3-bits left shifted.
struct cadc_scan_ctrl_seq_mode_t |
Data Fields | |
uint32_t | bitSample0: 1U |
Control whether delay sample0 until a new sync input occurs. More... | |
uint32_t | bitSample1: 1U |
Control whether delay sample1 until a new sync input occurs. More... | |
uint32_t | bitSample2: 1U |
Control whether delay sample2 until a new sync input occurs. More... | |
uint32_t | bitSample3: 1U |
Control whether delay sample3 until a new sync input occurs. More... | |
uint32_t | bitSample4: 1U |
Control whether delay sample4 until a new sync input occurs. More... | |
uint32_t | bitSample5: 1U |
Control whether delay sample5 until a new sync input occurs. More... | |
uint32_t | bitSample6: 1U |
Control whether delay sample6 until a new sync input occurs. More... | |
uint32_t | bitSample7: 1U |
Control whether delay sample7 until a new sync input occurs. More... | |
uint32_t | bitSample8: 1U |
Control whether delay sample8 until a new sync input occurs. More... | |
uint32_t | bitSample9: 1U |
Control whether delay sample9 until a new sync input occurs. More... | |
uint32_t | bitSample10: 1U |
Control whether delay sample10 until a new sync input occurs. More... | |
uint32_t | bitSample11: 1U |
Control whether delay sample11 until a new sync input occurs. More... | |
uint32_t | bitSample12: 1U |
Control whether delay sample12 until a new sync input occurs. More... | |
uint32_t | bitSample13: 1U |
Control whether delay sample13 until a new sync input occurs. More... | |
uint32_t | bitSample14: 1U |
Control whether delay sample14 until a new sync input occurs. More... | |
uint32_t | bitSample15: 1U |
Control whether delay sample15 until a new sync input occurs. More... | |
uint32_t | bitSample16: 1U |
Control whether delay sample16 until a new sync input occurs. More... | |
uint32_t | bitSample17: 1U |
Control whether delay sample17 until a new sync input occurs. More... | |
uint32_t | bitSample18: 1U |
Control whether delay sample18 until a new sync input occurs. More... | |
uint32_t | bitSample19: 1U |
Control whether delay sample19 until a new sync input occurs. More... | |
uint32_t | bitsReserved: 12U |
Reserved 12 bits. More... | |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample0 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample1 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample2 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample3 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample4 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample5 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample6 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample7 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample8 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample9 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample10 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample11 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample12 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample13 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample14 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample15 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample16 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample17 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample18 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitSample19 |
uint32_t cadc_scan_ctrl_seq_mode_t::bitsReserved |
struct cadc_scan_ctrl_simultParallel_mode_t |
Data Fields | |
uint32_t | bitSample0_8: 1U |
Control whether delay sample0 and sample8 until a new sync input occurs. More... | |
uint32_t | bitSample1_9: 1U |
Control whether delay sample1 and sample9 until a new sync input occurs. More... | |
uint32_t | bitSample2_10: 1U |
Control whether delay sample2 and sample10 until a new sync input occurs. More... | |
uint32_t | bitSample3_11: 1U |
Control whether delay sample3 and sample11 until a new sync input occurs. More... | |
uint32_t | bitsReserved1: 4U |
Reserved 4 bits. More... | |
uint32_t | bitSample4_12: 1U |
Control whether delay sample4 and sample12 until a new sync input occurs. More... | |
uint32_t | bitSample5_13: 1U |
Control whether delay sample5 and sample13 until a new sync input occurs. More... | |
uint32_t | bitSample6_14: 1U |
Control whether delay sample6 and sample14 until a new sync input occurs. More... | |
uint32_t | bitSample7_15: 1U |
Control whether delay sample7 and sample15 until a new sync input occurs. More... | |
uint32_t | bitsReserved2: 4U |
Reserved 4 bits. More... | |
uint32_t | bitSample16_18: 1U |
Control whether delay sample16 and sample18 until a new sync input occurs. More... | |
uint32_t | bitSample17_19: 1U |
Control whether delay sample17 and sample19 until a new sync input occurs. More... | |
uint32_t | bitsReserved3: 14U |
Reserved 14 bits. More... | |
uint32_t cadc_scan_ctrl_simultParallel_mode_t::bitSample0_8 |
uint32_t cadc_scan_ctrl_simultParallel_mode_t::bitSample1_9 |
uint32_t cadc_scan_ctrl_simultParallel_mode_t::bitSample2_10 |
uint32_t cadc_scan_ctrl_simultParallel_mode_t::bitSample3_11 |
uint32_t cadc_scan_ctrl_simultParallel_mode_t::bitsReserved1 |
uint32_t cadc_scan_ctrl_simultParallel_mode_t::bitSample4_12 |
uint32_t cadc_scan_ctrl_simultParallel_mode_t::bitSample5_13 |
uint32_t cadc_scan_ctrl_simultParallel_mode_t::bitSample6_14 |
uint32_t cadc_scan_ctrl_simultParallel_mode_t::bitSample7_15 |
uint32_t cadc_scan_ctrl_simultParallel_mode_t::bitsReserved2 |
uint32_t cadc_scan_ctrl_simultParallel_mode_t::bitSample16_18 |
uint32_t cadc_scan_ctrl_simultParallel_mode_t::bitSample17_19 |
uint32_t cadc_scan_ctrl_simultParallel_mode_t::bitsReserved3 |
struct cadc_scan_ctrl_independent_parallel_mode_converterA_t |
Data Fields | |
uint32_t | bitSample0: 1U |
Control whether delay converterA's sample0 until a new sync input occurs. More... | |
uint32_t | bitSample1: 1U |
Control whether delay converterA's sample1 until a new sync input occurs. More... | |
uint32_t | bitSample2: 1U |
Control whether delay converterA's sample2 until a new sync input occurs. More... | |
uint32_t | bitSample3: 1U |
Control whether delay converterA's sample3 until a new sync input occurs. More... | |
uint32_t | bitsReserved1: 4U |
Reserved 4 bits. More... | |
uint32_t | bitSample4: 1U |
Control whether delay converterA's sample4 until a new sync input occurs. More... | |
uint32_t | bitSample5: 1U |
Control whether delay converterA's sample5 until a new sync input occurs. More... | |
uint32_t | bitSample6: 1U |
Control whether delay converterA's sample6 until a new sync input occurs. More... | |
uint32_t | bitSample7: 1U |
Control whether delay converterA's sample7 until a new sync input occurs. More... | |
uint32_t | bitsReserved2: 4U |
Reserved 4 bits. | |
uint32_t | bitSample16: 1U |
Control whether delay converterA's sample16 until a new sync input occurs. More... | |
uint32_t | bitSample17: 1U |
Control whether delay converterA's sample17 until a new sync input occurs. More... | |
uint32_t | bitsReserved3: 14U |
Reserved 14 bits. More... | |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterA_t::bitSample0 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterA_t::bitSample1 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterA_t::bitSample2 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterA_t::bitSample3 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterA_t::bitsReserved1 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterA_t::bitSample4 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterA_t::bitSample5 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterA_t::bitSample6 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterA_t::bitSample7 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterA_t::bitSample16 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterA_t::bitSample17 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterA_t::bitsReserved3 |
struct cadc_scan_ctrl_independent_parallel_mode_converterB_t |
Data Fields | |
uint32_t | bitsReserved1: 4U |
Reserved 4 bits. More... | |
uint32_t | bitSample8: 1U |
Control whether delay converterB's sample8 until a new sync input occurs. More... | |
uint32_t | bitSample9: 1U |
Control whether delay converterB's sample9 until a new sync input occurs. More... | |
uint32_t | bitSample10: 1U |
Control whether delay converterB's sample10 until a new sync input occurs. More... | |
uint32_t | bitSample11: 1U |
Control whether delay converterB's sample11 until a new sync input occurs. More... | |
uint32_t | bitsReserved2: 4U |
Reserved 4 bits. More... | |
uint32_t | bitSample12: 1U |
Control whether delay converterB's sample12 until a new sync input occurs. More... | |
uint32_t | bitSample13: 1U |
Control whether delay converterB's sample13 until a new sync input occurs. More... | |
uint32_t | bitSample14: 1U |
Control whether delay converterB's sample14 until a new sync input occurs. More... | |
uint32_t | bitSample15: 1U |
Control whether delay converterB's sample15 until a new sync input occurs. More... | |
uint32_t | bitsReserved3: 2U |
Reserved 2 bits. More... | |
uint32_t | bitSample18: 1U |
Control whether delay converterB's sample18 until a new sync input occurs. More... | |
uint32_t | bitSample19: 1U |
Control whether delay converterB's sample19 until a new sync input occurs. More... | |
uint32_t | bitsReserved4: 12U |
Reserved 12 bits. More... | |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterB_t::bitsReserved1 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterB_t::bitSample8 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterB_t::bitSample9 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterB_t::bitSample10 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterB_t::bitSample11 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterB_t::bitsReserved2 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterB_t::bitSample12 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterB_t::bitSample13 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterB_t::bitSample14 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterB_t::bitSample15 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterB_t::bitsReserved3 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterB_t::bitSample18 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterB_t::bitSample19 |
uint32_t cadc_scan_ctrl_independent_parallel_mode_converterB_t::bitsReserved4 |
union cadc_scan_ctrl_independent_parallel_mode_t |
Data Fields | |
cadc_scan_ctrl_independent_parallel_mode_converterA_t | sConverterA |
Scan control for converterA. More... | |
cadc_scan_ctrl_independent_parallel_mode_converterB_t | sConverterB |
Scan control for converterB. More... | |
cadc_scan_ctrl_independent_parallel_mode_converterA_t cadc_scan_ctrl_independent_parallel_mode_t::sConverterA |
cadc_scan_ctrl_independent_parallel_mode_converterB_t cadc_scan_ctrl_independent_parallel_mode_t::sConverterB |
union cadc_scan_control_t |
Data Fields | |
uint32_t | u32ScanCtrlVal |
The 32 bits value of the scan control value. More... | |
cadc_scan_ctrl_seq_mode_t | sSequential |
Scan control for sequential scan mode. More... | |
cadc_scan_ctrl_simultParallel_mode_t | sSimultParallel |
Scan control for simultaneous parallel scan mode. More... | |
cadc_scan_ctrl_independent_parallel_mode_t | uIndependentParallel |
Scan control for independent scan mode. More... | |
uint32_t cadc_scan_control_t::u32ScanCtrlVal |
cadc_scan_ctrl_seq_mode_t cadc_scan_control_t::sSequential |
cadc_scan_ctrl_simultParallel_mode_t cadc_scan_control_t::sSimultParallel |
cadc_scan_ctrl_independent_parallel_mode_t cadc_scan_control_t::uIndependentParallel |
struct cadc_converter_config_t |
Data Fields | |
uint16_t | u16ClockDivisor |
Converter's clock divisor for the clock source. More... | |
cadc_reference_voltage_source_t | eHighReferenceVoltageSource |
High voltage reference source. More... | |
cadc_reference_voltage_source_t | eLowReferenceVoltageSource |
Low reference voltage source. More... | |
bool | bEnableDMA |
Enable/Disable DMA. More... | |
bool | bPowerUp |
Power up or power down the converter. More... | |
bool | bScanInitBySync |
The member user to control the initiate method of the scan. More... | |
uint16_t cadc_converter_config_t::u16ClockDivisor |
Available setting range is 0-63.
cadc_reference_voltage_source_t cadc_converter_config_t::eHighReferenceVoltageSource |
cadc_reference_voltage_source_t cadc_converter_config_t::eLowReferenceVoltageSource |
bool cadc_converter_config_t::bEnableDMA |
bool cadc_converter_config_t::bPowerUp |
bool cadc_converter_config_t::bScanInitBySync |
struct cadc_config_t |
Data Fields | |
cadc_idle_work_mode_t | eIdleWorkMode |
Idle work mode for the module. More... | |
cadc_dma_trigger_source_t | eDMATriggerSource |
Selects the dma trigger source for the module. More... | |
uint16_t | u16PowerUpDelay |
The number of ADC clocks to power up the converters (if powered up), before allowing a scan to start. More... | |
uint32_t | u32EnabledInterruptMask |
The mask of the interrupts to be enabled, should be the OR'ed value of _cadc_interrupt. More... | |
cadc_scan_mode_t | eScanMode |
The scan mode of the module. More... | |
cadc_sample_slot_disabled_t | uDisabledSampleSlot |
The member used to config the which sample slot is disabled for the scan. More... | |
cadc_scan_control_t | uScanControl |
Scan control provides the ability to pause and await a new sync signal while current sample completed. More... | |
uint32_t | u32ChannelModeMask |
The mask of each channel's mode, should be the OR'ed value of cadc_channel_mode_t. More... | |
cadc_channel_gain_t | eChannelGain [CADC_SAMPLE_SLOTS_COUNT] |
The gain value for each channel. More... | |
cadc_channel_number_t | eSampleSlot [CADC_SAMPLE_SLOTS_COUNT] |
The channel assigned to each sample slot. More... | |
cadc_converter_config_t | sConverterA |
The configuration for converterA. More... | |
cadc_converter_config_t | sConverterB |
The configuration for converterB. More... | |
cadc_idle_work_mode_t cadc_config_t::eIdleWorkMode |
cadc_dma_trigger_source_t cadc_config_t::eDMATriggerSource |
uint16_t cadc_config_t::u16PowerUpDelay |
The available range is 0 to 63 .
uint32_t cadc_config_t::u32EnabledInterruptMask |
cadc_scan_mode_t cadc_config_t::eScanMode |
cadc_sample_slot_disabled_t cadc_config_t::uDisabledSampleSlot |
The scan will continue until the first disabled sample slot is encountered.
cadc_scan_control_t cadc_config_t::uScanControl |
uint32_t cadc_config_t::u32ChannelModeMask |
Each channel supports single-end and differential(Fully differentail and Unipolar differential). Some devices also support alternate source mode.
cadc_channel_gain_t cadc_config_t::eChannelGain[CADC_SAMPLE_SLOTS_COUNT] |
Each element of the array represents the gain of the channel. E.g. eChannelGain[0] means channel gain of channel0, which is ANA0.
cadc_channel_number_t cadc_config_t::eSampleSlot[CADC_SAMPLE_SLOTS_COUNT] |
The index of the array represents sample slot index.
cadc_converter_config_t cadc_config_t::sConverterA |
cadc_converter_config_t cadc_config_t::sConverterB |
enum cadc_converter_id_t |
enum cadc_scan_mode_t |
enum cadc_channel_gain_t |
enum cadc_channel_mode_t |
void CADC_Init | ( | ADC_Type * | base, |
const cadc_config_t * | psConfig | ||
) |
This function is to make the initialization for using CADC module. The operations are:
base | CADC peripheral base address. |
psConfig | Pointer to configuration structure. See cadc_config_t. |
void CADC_GetDefaultConfig | ( | cadc_config_t * | psConfig | ) |
This function initializes the module's configuration structure with an available settings. The default value are:
psConfig | Pointer to configuration structure. See cadc_config_t. |
void CADC_Deinit | ( | ADC_Type * | base | ) |
This function is to make the de-initialization for using CADC module. The operations are:
base | CADC peripheral base address. |
|
inlinestatic |
base | CADC peripheral base address. |
eScanMode | Dual converters' scan mode, please see cadc_scan_mode_t for details. |
|
inlinestatic |
base | CADC peripheral base address. |
uScanControl | The scan control value, please refer to cadc_scan_control_t for details. |
void CADC_SetChannelMode | ( | ADC_Type * | base, |
cadc_channel_mode_t | eChannelMode | ||
) |
base | CADC peripheral base address. |
eChannelMode | The channel mode to be set, please refer to cadc_channel_mode_t for details. |
void CADC_SetChannelGain | ( | ADC_Type * | base, |
cadc_channel_number_t | eChannelNumber, | ||
cadc_channel_gain_t | eChannelGain | ||
) |
base | CADC peripheral base address. |
eChannelNumber | The number of channel, please refer to cadc_channel_number_t. |
eChannelGain | The gain amplification, please refer to cadc_channel_gain_t for details. |
void CADC_GetSampleSlotDefaultConfig | ( | cadc_sample_slot_config_t * | psConfig | ) |
psConfig | Pointer to configuration structure. See cadc_sample_slot_config_t. |
void CADC_SetSampleSlotConfig | ( | ADC_Type * | base, |
cadc_sample_slot_index_t | eSampleIndex, | ||
const cadc_sample_slot_config_t * | psConfig | ||
) |
base | CADC peripheral base address. |
eSampleIndex | Index of sample slot in conversion sequence. Please refer to cadc_sample_slot_index_t. |
psConfig | Pointer to configuration structure. See cadc_sample_slot_config_t. |
void CADC_SetSampleSlotZeroCrossingMode | ( | ADC_Type * | base, |
cadc_sample_slot_index_t | eSampleIndex, | ||
cadc_sample_slot_zero_crossing_mode_t | eZeroCrossingMode | ||
) |
base | CADC peripheral base address. |
eSampleIndex | The index of sample slot. Please refer to cadc_sample_slot_index_t for details. |
eZeroCrossingMode | Zero crossing mode, please refer to cadc_sample_slot_zero_crossing_mode_t for details. |
void CADC_RouteChannelToSampleSlot | ( | ADC_Type * | base, |
cadc_sample_slot_index_t | eSampleIndex, | ||
cadc_channel_number_t | eChannelNumber | ||
) |
base | CADC peripheral base address. |
eSampleIndex | The index of sample slot, please refer to cadc_sample_slot_index_t for details. |
eChannelNumber | Sample channel number, please refer to cadc_channel_number_t for details. |
|
inlinestatic |
base | CADC peripheral base address. |
eSampleIndex | The index of sample slot. Please refer to cadc_sample_slot_index_t for details. |
u16LowLimitValue | Low limit value(-32768 ~ 32767 with lower three bits of fixed value 0). Original value formation as hardware register, with 3-bits left shifted. |
|
inlinestatic |
base | CADC peripheral base address. |
eSampleIndex | The index of sample slot. Please refer to cadc_sample_slot_index_t for details. |
u16HighLimitValue | High limit value(-32768 ~ 32767 with lower three bits of fixed value 0). Original value formation as hardware register, with 3-bits left shifted. |
|
inlinestatic |
base | CADC peripheral base address. |
eSampleIndex | The index of sample slot. Please refer to cadc_sample_slot_index_t for details. |
u16OffsetValue | Offset value(-32768 ~ 32767 with lower three bits of fixed value 0). Original value formation as hardware register, with 3-bits left shifted. |
|
inlinestatic |
This function is to get the sample result value. The returned value keeps it original formation just like in hardware result register. It includes the sign bit as the MSB and 3-bit left shifted value.
base | CADC peripheral base address. |
eSampleIndex | Index of sample slot. For the counts of sample slots, please refer to cadc_sample_slot_index_t for details. |
void CADC_GetConverterDefaultConfig | ( | cadc_converter_config_t * | psConfig | ) |
This function initializes each converter's configuration structure with an available settings. The default value are:
psConfig | Pointer to configuration structure. See cadc_converter_config_t. |
void CADC_SetConverterConfig | ( | ADC_Type * | base, |
cadc_converter_id_t | eConverterId, | ||
const cadc_converter_config_t * | psConfig | ||
) |
This function can be used to configure the converter The operations are:
base | CADC peripheral base address. |
eConverterId | The converter Id. See cadc_converter_id_t. |
psConfig | Pointer to configuration structure. See cadc_converter_config_t. |
|
inlinestatic |
The conversion should only be launched after the converter is in normal mode. When in stop mode, the current scan is stopped and no further scans can start. All the software trigger and hardware trigger are ignored.
base | CADC peripheral base address. |
eConverterId | The converter Id. See cadc_converter_id_t. |
bEnable | Used to change the operation mode.
|
|
inlinestatic |
base | CADC peripheral base address. |
eConverterId | The converter Id. See cadc_converter_id_t. |
bEnable | Enable the feature or not.
|
|
inlinestatic |
This function is to do the software trigger to the converter. The software trigger can used to start a conversion sequence.
base | CADC peripheral base address. |
eConverterId | The ID of the converter to be started. See cadc_converter_id_t. |
|
inlinestatic |
base | CADC peripheral base address. |
eConverterId | The converter Id. See cadc_converter_id_t. |
u16ClockDivisor | Converter's clock divisor for the clock source.Available setting range is 0-63.
|
void CADC_SetConverterReferenceVoltageSource | ( | ADC_Type * | base, |
cadc_converter_id_t | eConverterId, | ||
cadc_reference_voltage_source_t | eHighReferenceVoltage, | ||
cadc_reference_voltage_source_t | eLowReferenceVoltage | ||
) |
base | CADC peripheral base address. |
eConverterId | The converter Id. See cadc_converter_id_t. |
eHighReferenceVoltage | High voltage reference source, please refer to cadc_reference_voltage_source_t. |
eLowReferenceVoltage | Low voltage reference source, please refer to cadc_reference_voltage_source_t. |
void CADC_EnableConverterPower | ( | ADC_Type * | base, |
cadc_converter_id_t | eConverterId, | ||
bool | bEnable | ||
) |
This function is to enable the power for the converter. The converter should be powered up before the conversion. Once this API is called to power up the converter, the converter would be powered on after a few moment (so-called power up delay, the function CADC_SetPowerUpDelay() can be used to set the power up delay), so that the power would be stable.
base | CADC peripheral base address. |
eConverterId | The converter to be powered. See cadc_converter_id_t. |
bEnable | Powers up/down the converter.
|
|
inlinestatic |
base | CADC peripheral base address. |
eConverterId | The converter id. See cadc_converter_id_t. |
bEnable | Enables/Disables the DMA.
|
|
inlinestatic |
base | CADC peripheral base address. |
u16PowerUpDelay | The number of ADC clocks to power up an ADC converter. Ranges from 0 to 63. |
|
inlinestatic |
base | CADC peripheral base address. |
bEnable | Enable/Disable auto-powerdown mode.
|
|
inlinestatic |
base | CADC peripheral base address. |
eDMATriggerSource | DMA trigger source. Please refer to cadc_dma_trigger_source_t for details. |
|
inlinestatic |
base | CADC peripheral base address. |
u32Mask | Mask value for converters interrupt events. Should be the OR'ed value of _cadc_interrupt_enable. |
|
inlinestatic |
base | CADC peripheral base address. |
u32Mask | Mask value for converts interrupt events. Should be the OR'ed value of _cadc_interrupt_enable. |
|
inlinestatic |
base | CADC peripheral base address. |
|
inlinestatic |
base | CADC peripheral base address. |
flags | Mask value for the event flags to be cleared. See _cadc_misc_status_flags. Only the enumeration kCADC_ConverterAEndOfScanFlag and kCADC_ConverterBEndOfScanFlag are useful. |
|
inlinestatic |
base | CADC peripheral base address. |
|
inlinestatic |
base | CADC peripheral base address. |
|
inlinestatic |
base | CADC peripheral base address. |
u32SampleMask | Mask value of sample slots. This parameter should be the OR'ed value of cadc_sample_slot_mask_t. |
|
inlinestatic |
base | CADC peripheral base address. |
|
inlinestatic |
base | CADC peripheral base address. |
u32SampleMask | Mask value of sample slots. This parameter should be the OR'ed value of cadc_sample_slot_mask_t. |
|
inlinestatic |
base | CADC peripheral base address. |
|
inlinestatic |
base | CADC peripheral base address. |
u32SampleMask | Mask value of sample slots. This parameter should be the OR'ed value of cadc_sample_slot_mask_t. |
|
inlinestatic |
base | CADC peripheral base address. |