23#define FSL_ADC12_DRIVER_VERSION (MAKE_VERSION(2, 0, 2))
146#if defined(__cplusplus)
230 assert(channelGroup < ADC_R_COUNT);
232 return base->R[channelGroup];
279 base->USR_OFS = (value & ADC_USR_OFS_USR_OFS_MASK);
293 base->UG = (value & ADC_UG_UG_MASK);
296#if defined(FSL_FEATURE_ADC12_HAS_DMA_SUPPORT) && (FSL_FEATURE_ADC12_HAS_DMA_SUPPORT == 1)
307 base->SC2 |= ADC_SC2_DMAEN_MASK;
311 base->SC2 &= ~ADC_SC2_DMAEN_MASK;
326 base->SC2 |= ADC_SC2_ADTRG_MASK;
330 base->SC2 &= ~ADC_SC2_ADTRG_MASK;
368#if defined(__cplusplus)
static constexpr persistent_config_s * config
_adc12_channel_status_flags
Channel status flags' mask.
struct _adc12_hardware_compare_config adc12_hardware_compare_config_t
Hardware compare configuration.
enum _adc12_reference_voltage_source adc12_reference_voltage_source_t
Reference voltage source.
adc12_reference_voltage_source_t referenceVoltageSource
enum _adc12_clock_source adc12_clock_source_t
Conversion clock source.
static void ADC12_EnableHardwareTrigger(ADC_Type *base, bool enable)
Enable of disable the hardware trigger mode.
_adc12_reference_voltage_source
Reference voltage source.
_adc12_status_flags
Converter status flags' mask.
adc12_hardware_compare_mode_t hardwareCompareMode
bool enableInterruptOnConversionCompleted
_adc12_hardware_compare_mode
Hardware compare mode.
status_t ADC12_DoAutoCalibration(ADC_Type *base)
Automate the hardware calibration.
static void ADC12_SetGainValue(ADC_Type *base, uint32_t value)
Set the gain value for the conversion result.
static void ADC12_SetOffsetValue(ADC_Type *base, uint32_t value)
Set the offset value for the conversion result.
uint32_t ADC12_GetChannelStatusFlags(ADC_Type *base, uint32_t channelGroup)
Get the status flags of channel.
struct _adc12_channel_config adc12_channel_config_t
Channel conversion configuration.
uint32_t ADC12_GetStatusFlags(ADC_Type *base)
Get the status flags of the converter.
void ADC12_SetChannelConfig(ADC_Type *base, uint32_t channelGroup, const adc12_channel_config_t *config)
Configure the conversion channel.
enum _adc12_hardware_compare_mode adc12_hardware_compare_mode_t
Hardware compare mode.
adc12_clock_source_t clockSource
void ADC12_SetHardwareCompareConfig(ADC_Type *base, const adc12_hardware_compare_config_t *config)
Configure the hardware compare mode.
static uint32_t ADC12_GetChannelConversionValue(ADC_Type *base, uint32_t channelGroup)
Get the conversion value.
struct _adc12_config adc12_config_t
Converter configuration.
void ADC12_SetHardwareAverage(ADC_Type *base, adc12_hardware_average_mode_t mode)
Set the hardware average mode.
void ADC12_GetDefaultConfig(adc12_config_t *config)
Gets an available pre-defined settings for converter's configuration.
static void ADC12_EnableDMA(ADC_Type *base, bool enable)
Enable generating the DMA trigger when conversion is completed.
void ADC12_Deinit(ADC_Type *base)
De-initialize the ADC12 module.
enum _adc12_clock_divider adc12_clock_divider_t
Clock divider for the converter.
adc12_clock_divider_t clockDivider
bool enableContinuousConversion
void ADC12_Init(ADC_Type *base, const adc12_config_t *config)
Initialize the ADC12 module.
enum _adc12_hardware_average_mode adc12_hardware_average_mode_t
Hardware average mode.
_adc12_hardware_average_mode
Hardware average mode.
_adc12_resolution
Converter's resolution.
_adc12_clock_divider
Clock divider for the converter.
enum _adc12_resolution adc12_resolution_t
Converter's resolution.
adc12_resolution_t resolution
uint32_t sampleClockCount
_adc12_clock_source
Conversion clock source.
@ kADC12_ChannelConversionCompletedFlag
@ kADC12_ReferenceVoltageSourceVref
@ kADC12_ReferenceVoltageSourceValt
@ kADC12_CalibrationFailedFlag
@ kADC12_HardwareCompareMode0
@ kADC12_HardwareCompareMode2
@ kADC12_HardwareCompareMode3
@ kADC12_HardwareCompareMode1
@ kADC12_HardwareAverageDisabled
@ kADC12_HardwareAverageCount32
@ kADC12_HardwareAverageCount4
@ kADC12_HardwareAverageCount16
@ kADC12_HardwareAverageCount8
int32_t status_t
Type used for all status and error return values.
static void enable(const char *param)
Channel conversion configuration.
Hardware compare configuration.