rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Data Structures | Typedefs | Enumerations
fsl_adc12.h File Reference

Data Structures

struct  _adc12_config
 Converter configuration. More...
 
struct  _adc12_hardware_compare_config
 Hardware compare configuration. More...
 
struct  _adc12_channel_config
 Channel conversion configuration. More...
 

Typedefs

typedef enum _adc12_clock_divider adc12_clock_divider_t
 Clock divider for the converter.
 
typedef enum _adc12_resolution adc12_resolution_t
 Converter's resolution.
 
typedef enum _adc12_clock_source adc12_clock_source_t
 Conversion clock source.
 
typedef enum _adc12_reference_voltage_source adc12_reference_voltage_source_t
 Reference voltage source.
 
typedef enum _adc12_hardware_average_mode adc12_hardware_average_mode_t
 Hardware average mode.
 
typedef enum _adc12_hardware_compare_mode adc12_hardware_compare_mode_t
 Hardware compare mode.
 
typedef struct _adc12_config adc12_config_t
 Converter configuration.
 
typedef struct _adc12_hardware_compare_config adc12_hardware_compare_config_t
 Hardware compare configuration.
 
typedef struct _adc12_channel_config adc12_channel_config_t
 Channel conversion configuration.
 

Enumerations

enum  _adc12_channel_status_flags { kADC12_ChannelConversionCompletedFlag = ADC_SC1_COCO_MASK }
 Channel status flags' mask. More...
 
enum  _adc12_status_flags { kADC12_ActiveFlag = ADC_SC2_ADACT_MASK , kADC12_CalibrationFailedFlag = (ADC_SC2_ADACT_MASK << 1U) }
 Converter status flags' mask. More...
 
enum  _adc12_clock_divider { kADC12_ClockDivider1 = 0U , kADC12_ClockDivider2 = 1U , kADC12_ClockDivider4 = 2U , kADC12_ClockDivider8 = 3U }
 Clock divider for the converter. More...
 
enum  _adc12_resolution { kADC12_Resolution8Bit = 0U , kADC12_Resolution12Bit = 1U , kADC12_Resolution10Bit = 2U }
 Converter's resolution. More...
 
enum  _adc12_clock_source { kADC12_ClockSourceAlt0 = 0U , kADC12_ClockSourceAlt1 = 1U , kADC12_ClockSourceAlt2 = 2U , kADC12_ClockSourceAlt3 = 3U }
 Conversion clock source. More...
 
enum  _adc12_reference_voltage_source { kADC12_ReferenceVoltageSourceVref = 0U , kADC12_ReferenceVoltageSourceValt = 1U }
 Reference voltage source. More...
 
enum  _adc12_hardware_average_mode {
  kADC12_HardwareAverageCount4 = 0U , kADC12_HardwareAverageCount8 = 1U , kADC12_HardwareAverageCount16 = 2U , kADC12_HardwareAverageCount32 = 3U ,
  kADC12_HardwareAverageDisabled = 4U
}
 Hardware average mode. More...
 
enum  _adc12_hardware_compare_mode { kADC12_HardwareCompareMode0 = 0U , kADC12_HardwareCompareMode1 = 1U , kADC12_HardwareCompareMode2 = 2U , kADC12_HardwareCompareMode3 = 3U }
 Hardware compare mode. More...
 

Functions

Initialization
void ADC12_Init (ADC_Type *base, const adc12_config_t *config)
 Initialize the ADC12 module.
 
void ADC12_Deinit (ADC_Type *base)
 De-initialize the ADC12 module.
 
void ADC12_GetDefaultConfig (adc12_config_t *config)
 Gets an available pre-defined settings for converter's configuration.
 
Basic Operations
void ADC12_SetChannelConfig (ADC_Type *base, uint32_t channelGroup, const adc12_channel_config_t *config)
 Configure the conversion channel.
 
static uint32_t ADC12_GetChannelConversionValue (ADC_Type *base, uint32_t channelGroup)
 Get the conversion value.
 
uint32_t ADC12_GetChannelStatusFlags (ADC_Type *base, uint32_t channelGroup)
 Get the status flags of channel.
 
Advanced Operations
status_t ADC12_DoAutoCalibration (ADC_Type *base)
 Automate the hardware calibration.
 
static void ADC12_SetOffsetValue (ADC_Type *base, uint32_t value)
 Set the offset value for the conversion result.
 
static void ADC12_SetGainValue (ADC_Type *base, uint32_t value)
 Set the gain value for the conversion result.
 
static void ADC12_EnableDMA (ADC_Type *base, bool enable)
 Enable generating the DMA trigger when conversion is completed.
 
static void ADC12_EnableHardwareTrigger (ADC_Type *base, bool enable)
 Enable of disable the hardware trigger mode.
 
void ADC12_SetHardwareCompareConfig (ADC_Type *base, const adc12_hardware_compare_config_t *config)
 Configure the hardware compare mode.
 
void ADC12_SetHardwareAverage (ADC_Type *base, adc12_hardware_average_mode_t mode)
 Set the hardware average mode.
 
uint32_t ADC12_GetStatusFlags (ADC_Type *base)
 Get the status flags of the converter.
 

Go to the source code of this file.