12#include "fsl_common.h"
23#define FSL_ADC_DRIVER_VERSION (MAKE_VERSION(2, 0, 4))
74#if !(defined(FSL_FEATURE_ADC_SUPPORT_ALTCLK_REMOVE) && FSL_FEATURE_ADC_SUPPORT_ALTCLK_REMOVE)
193#if defined(__cplusplus)
275static inline uint32_t ADC_GetChannelConversionValue(
ADC_Type *base, uint32_t channelGroup)
277 assert(channelGroup < (uint32_t)FSL_FEATURE_ADC_CONVERSION_CONTROL_COUNT);
279 return base->R[channelGroup];
299static inline uint32_t ADC_GetChannelStatusFlags(
ADC_Type *base, uint32_t channelGroup)
301 assert(channelGroup < (uint32_t)FSL_FEATURE_ADC_CONVERSION_CONTROL_COUNT);
304 return (((base->HS) & (1UL << channelGroup)) >> channelGroup);
336static inline void ADC_EnableDMA(
ADC_Type *base,
bool enable)
340 base->GC |= ADC_GC_DMAEN_MASK;
344 base->GC &= ~ADC_GC_DMAEN_MASK;
354#if !(defined(FSL_FEATURE_ADC_SUPPORT_HARDWARE_TRIGGER_REMOVE) && FSL_FEATURE_ADC_SUPPORT_HARDWARE_TRIGGER_REMOVE)
355static inline void ADC_EnableHardwareTrigger(
ADC_Type *base,
bool enable)
359 base->CFG |= ADC_CFG_ADTRG_MASK;
363 base->CFG &= ~ADC_CFG_ADTRG_MASK;
402static inline uint32_t ADC_GetStatusFlags(
ADC_Type *base)
419#if defined(__cplusplus)
enum _adc_hardware_compare_mode adc_hardware_compare_mode_t
Converter hardware compare mode.
enum _adc_resolution adc_resolution_t
Converter's resolution.
void ADC_SetHardwareAverageConfig(ADC_Type *base, adc_hardware_average_mode_t mode)
Configures the hardware average mode.
Definition: fsl_adc.c:359
void ADC_SetOffsetConfig(ADC_Type *base, const adc_offest_config_t *config)
Set user defined offset.
Definition: fsl_adc.c:284
struct _adc_offest_config adc_offest_config_t
Converter Offset configuration.
enum _adc_clock_source adc_clock_source_t
Clock source.
_adc_status_flags
Converter's status flags.
Definition: fsl_adc.h:29
status_t ADC_DoAutoCalibration(ADC_Type *base)
Automates the hardware calibration.
Definition: fsl_adc.c:224
_adc_sample_period_mode
Sample time duration.
Definition: fsl_adc.h:48
enum _adc_reference_voltage_source adc_reference_voltage_source_t
Reference voltage source.
_adc_clock_source
Clock source.
Definition: fsl_adc.h:71
void ADC_GetDefaultConfig(adc_config_t *config)
Gets an available pre-defined settings for the converter's configuration.
Definition: fsl_adc.c:142
enum _adc_hardware_average_mode adc_hardware_average_mode_t
Converter hardware average mode.
struct _adc_hardware_compare_config adc_hardware_compare_config_t
ADC hardware compare configuration.
void ADC_ClearStatusFlags(ADC_Type *base, uint32_t mask)
Clears the converter's status falgs.
Definition: fsl_adc.c:382
struct _adc_channel_config adc_channel_config_t
ADC channel conversion configuration.
_adc_reference_voltage_source
Reference voltage source.
Definition: fsl_adc.h:40
void ADC_Deinit(ADC_Type *base)
De-initializes the ADC module.
Definition: fsl_adc.c:114
void ADC_Init(ADC_Type *base, const adc_config_t *config)
Initialize the ADC module.
Definition: fsl_adc.c:64
enum _adc_status_flags adc_status_flags_t
Converter's status flags.
_adc_hardware_compare_mode
Converter hardware compare mode.
Definition: fsl_adc.h:105
_adc_resolution
Converter's resolution.
Definition: fsl_adc.h:95
_adc_clock_drvier
Clock divider for the converter.
Definition: fsl_adc.h:84
void ADC_SetChannelConfig(ADC_Type *base, uint32_t channelGroup, const adc_channel_config_t *config)
Configures the conversion channel.
Definition: fsl_adc.c:189
enum _adc_sample_period_mode adc_sample_period_mode_t
Sample time duration.
_adc_hardware_average_mode
Converter hardware average mode.
Definition: fsl_adc.h:122
enum _adc_clock_drvier adc_clock_driver_t
Clock divider for the converter.
struct _adc_config adc_config_t
Converter configuration.
void ADC_SetHardwareCompareConfig(ADC_Type *base, const adc_hardware_compare_config_t *config)
Configures the hardware compare mode.
Definition: fsl_adc.c:311
@ kADC_ConversionActiveFlag
Definition: fsl_adc.h:30
@ kADC_CalibrationFailedFlag
Definition: fsl_adc.h:31
@ kADC_AsynchronousWakeupInterruptFlag
Definition: fsl_adc.h:32
@ kADC_SamplePeriod8or24Clocks
Definition: fsl_adc.h:53
@ kADC_SamplePeriodShort4Clocks
Definition: fsl_adc.h:62
@ kADC_SamplePeriodLong20Clcoks
Definition: fsl_adc.h:58
@ kADC_SamplePeriodShort8Clocks
Definition: fsl_adc.h:64
@ kADC_SamplePeriod4or16Clocks
Definition: fsl_adc.h:51
@ kADC_SamplePeriodLong16Clcoks
Definition: fsl_adc.h:57
@ kADC_SamplePeriodLong12Clcoks
Definition: fsl_adc.h:56
@ kADC_SamplePeriodShort6Clocks
Definition: fsl_adc.h:63
@ kADC_SamplePeriodShort2Clocks
Definition: fsl_adc.h:61
@ kADC_SamplePeriod2or12Clocks
Definition: fsl_adc.h:50
@ kADC_SamplePeriodLong24Clcoks
Definition: fsl_adc.h:59
@ kADC_SamplePeriod6or20Clocks
Definition: fsl_adc.h:52
@ kADC_ClockSourceALT
Definition: fsl_adc.h:75
@ kADC_ClockSourceIPGDiv2
Definition: fsl_adc.h:73
@ kADC_ClockSourceIPG
Definition: fsl_adc.h:72
@ kADC_ClockSourceAD
Definition: fsl_adc.h:77
@ kADC_ReferenceVoltageSourceAlt0
Definition: fsl_adc.h:41
@ kADC_HardwareCompareMode0
Definition: fsl_adc.h:106
@ kADC_HardwareCompareMode2
Definition: fsl_adc.h:108
@ kADC_HardwareCompareMode1
Definition: fsl_adc.h:107
@ kADC_HardwareCompareMode3
Definition: fsl_adc.h:112
@ kADC_Resolution10Bit
Definition: fsl_adc.h:97
@ kADC_Resolution12Bit
Definition: fsl_adc.h:98
@ kADC_Resolution8Bit
Definition: fsl_adc.h:96
@ kADC_ClockDriver2
Definition: fsl_adc.h:86
@ kADC_ClockDriver1
Definition: fsl_adc.h:85
@ kADC_ClockDriver8
Definition: fsl_adc.h:88
@ kADC_ClockDriver4
Definition: fsl_adc.h:87
@ kADC_HardwareAverageDiasable
Definition: fsl_adc.h:127
@ kADC_HardwareAverageCount8
Definition: fsl_adc.h:124
@ kADC_HardwareAverageCount16
Definition: fsl_adc.h:125
@ kADC_HardwareAverageCount32
Definition: fsl_adc.h:126
@ kADC_HardwareAverageCount4
Definition: fsl_adc.h:123
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:225
Definition: MIMXRT1052.h:1298
ADC channel conversion configuration.
Definition: fsl_adc.h:184
uint32_t channelNumber
Definition: fsl_adc.h:185
bool enableInterruptOnConversionCompleted
Definition: fsl_adc.h:188
Converter configuration.
Definition: fsl_adc.h:134
bool enableOverWrite
Definition: fsl_adc.h:135
bool enableLowPower
Definition: fsl_adc.h:138
adc_sample_period_mode_t samplePeriodMode
Definition: fsl_adc.h:142
bool enableLongSample
Definition: fsl_adc.h:139
bool enableAsynchronousClockOutput
Definition: fsl_adc.h:140
adc_clock_driver_t clockDriver
Definition: fsl_adc.h:144
adc_resolution_t resolution
Definition: fsl_adc.h:145
adc_reference_voltage_source_t referenceVoltageSource
Definition: fsl_adc.h:141
bool enableHighSpeed
Definition: fsl_adc.h:137
bool enableContinuousConversion
Definition: fsl_adc.h:136
adc_clock_source_t clockSource
Definition: fsl_adc.h:143
ADC hardware compare configuration.
Definition: fsl_adc.h:173
adc_hardware_compare_mode_t hardwareCompareMode
Definition: fsl_adc.h:174
uint16_t value1
Definition: fsl_adc.h:176
uint16_t value2
Definition: fsl_adc.h:177
Converter Offset configuration.
Definition: fsl_adc.h:152
uint32_t offsetValue
Definition: fsl_adc.h:155
bool enableSigned
Definition: fsl_adc.h:153
Definition: deflate.c:114