Kinetis SDK v.1.3 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
This section describes the programming interface of the ADC16 HAL driver.
Data Structures | |
struct | adc16_chn_config_t |
Defines the structure to configure the ADC16 channel. More... | |
struct | adc16_converter_config_t |
Defines the structure to configure the ADC16's converter. More... | |
struct | adc16_hw_cmp_config_t |
Defines the structure to configure the ADC16 internal comparator. More... | |
ADC16 HAL. | |
void | ADC16_HAL_Init (ADC_Type *base) |
Resets all registers into a known state for the ADC16 module. More... | |
void | ADC16_HAL_ConfigChn (ADC_Type *base, uint32_t chnGroup, const adc16_chn_config_t *configPtr) |
Configures the conversion channel for the ADC16 module. More... | |
static bool | ADC16_HAL_GetChnConvCompletedFlag (ADC_Type *base, uint32_t chnGroup) |
Checks whether the channel conversion is completed. More... | |
void | ADC16_HAL_ConfigConverter (ADC_Type *base, const adc16_converter_config_t *configPtr) |
Configures the sampling converter for the ADC16. More... | |
void | ADC16_HAL_ConfigHwCompare (ADC_Type *base, const adc16_hw_cmp_config_t *configPtr) |
Configures the hardware comparator function for the ADC16. More... | |
static uint16_t | ADC16_HAL_GetChnConvValue (ADC_Type *base, uint32_t chnGroup) |
Gets the raw result data of channel conversion for the ADC16 module. More... | |
static bool | ADC16_HAL_GetConvActiveFlag (ADC_Type *base) |
Checks whether the converter is active for the ADC16 module. More... | |
struct adc16_chn_config_t |
This type of variable is treated as the command to be set in ADC control register, which may execute the ADC's conversion.
Data Fields | |
adc16_chn_t | chnIdx |
Select the sample channel index. More... | |
bool | convCompletedIntEnable |
Enable the conversion complete interrupt. More... | |
struct adc16_converter_config_t |
This type of variable is treated as a group of configurations. Most of the time, these configurations are a one-time setting for converter sampling condition. Usually, they are set before executing the ADC16 job.
Data Fields | |
bool | lowPowerEnable |
Enables low power. | |
adc16_clk_divider_t | clkDividerMode |
Selects the divider of input clock source. | |
bool | longSampleTimeEnable |
Enables the long sample time. | |
adc16_resolution_t | resolution |
Selects the sample resolution mode. | |
adc16_clk_src_mode_t | clkSrc |
Selects the input clock source to converter. | |
bool | asyncClkEnable |
Enables the asynchronous clock inside the ADC. | |
bool | highSpeedEnable |
Enables the high-speed mode. | |
adc16_long_sample_cycle_t | longSampleCycleMode |
Selects the long sample mode. | |
bool | hwTriggerEnable |
Enables the hardware trigger function. | |
adc16_ref_volt_src_t | refVoltSrc |
Selects the reference voltage source. | |
bool | continuousConvEnable |
Enables continuous conversion mode. | |
struct adc16_hw_cmp_config_t |
Data Fields | |
bool | hwCmpEnable |
Enables the hardware compare function. | |
bool | hwCmpGreaterThanEnable |
Configures the compare function. | |
bool | hwCmpRangeEnable |
Configures the comparator function. | |
uint16_t | cmpValue1 |
Setting value for CV1. | |
uint16_t | cmpValue2 |
Setting value for CV2. | |
enum adc16_status_t |
enum adc16_clk_divider_t |
enum adc16_resolution_t |
enum adc16_clk_src_mode_t |
enum adc16_ref_volt_src_t |
enum adc16_chn_t |
void ADC16_HAL_Init | ( | ADC_Type * | base | ) |
This function resets all registers into a known state for the ADC module. This known state is the reset value indicated by the Reference manual. It is strongly recommended to call this API before any other operation when initializing the ADC16 module.
base | Register base address for the module. |
void ADC16_HAL_ConfigChn | ( | ADC_Type * | base, |
uint32_t | chnGroup, | ||
const adc16_chn_config_t * | configPtr | ||
) |
This function configures the channel for the ADC16 module. At any point, only one of the configuration groups takes effect. The other channel group of the first group (group A, 0) is only for the hardware trigger. Both software and hardware trigger can be used to the first group. When in software trigger mode, after the available channel is set, the conversion begins to execute.
base | Register base address for the module. |
chnGroup | Channel configuration group ID. |
configPtr | Pointer to configuration structure. |
|
inlinestatic |
This function checks whether the channel conversion for the ADC module is completed.
base | Register base address for the module. |
chnGroup | Channel configuration group ID. |
void ADC16_HAL_ConfigConverter | ( | ADC_Type * | base, |
const adc16_converter_config_t * | configPtr | ||
) |
This function configures the sampling converter for the ADC16. Most of the time, the configurations are a one-time setting for the converter sampling condition. Usually, it is called before executing the ADC16 job.
base | Register base address for the module. |
configPtr | Pointer to configuration structure. |
void ADC16_HAL_ConfigHwCompare | ( | ADC_Type * | base, |
const adc16_hw_cmp_config_t * | configPtr | ||
) |
This function configures the hardware comparator function for the ADC16. These are the settings for the ADC16 comparator.
base | Register base address for the module. |
configPtr | Pointer to configuration structure. |
|
inlinestatic |
This function gets the conversion result data for the ADC16 module. The return value is the raw data that is not processed.
base | Register base address for the module. |
chnGroup | Channel configuration group ID. |
|
inlinestatic |
This function checks whether the converter is active for the ADC16 module.
base | Register base address for the module. |
adc16_chn_t adc16_chn_config_t::chnIdx |
bool adc16_chn_config_t::convCompletedIntEnable |