![]() |
PDL for FM4
Version1.2
Peripheral Driverl Library for FM4
|
Data Structures | |
| union | un_adc_sccr_t |
| union | un_adc_pccr_t |
| struct | stc_ad_channel_list |
| ADC Channel list with same sort order as the ER32 registers. More... | |
| struct | stc_adc_config |
| ADC configuration. More... | |
| struct | stc_adc_intern_data |
| ADC instance internal data, storing internal information for each enabled ADC instance. More... | |
| struct | stc_adc_instance_data |
| ADC instance data type. More... | |
Macros | |
| #define | stc_adcn_t FM4_ADC_TypeDef |
| #define | ADC0 (*((volatile stc_adcn_t *) FM4_ADC0_BASE)) |
| #define | ADC1 (*((volatile stc_adcn_t *) FM4_ADC1_BASE)) |
| #define | ADC2 (*((volatile stc_adcn_t *) FM4_ADC2_BASE)) |
| #define | PDL_ADC_READY_WAIT_COUNT 1000000u |
| Time-out counter value for ADC ready bit polling. More... | |
| #define | ADC_INSTANCE_COUNT |
Typedefs | |
| typedef void(* | func_ptr_adc_parg32_t )(uint32_t *pu32Argument) |
| typedef enum en_adc_scan_mode | en_adc_scan_mode_t |
| Scan Conversion Mode. More... | |
| typedef enum en_adc_sample_time_n | en_adc_sample_time_n_t |
| Priority Conversion Stage Count. More... | |
| typedef enum en_adc_fifo_status | en_adc_fifo_status_t |
| FIFO Status (Scan, Priority Conversion) More... | |
| typedef enum en_adc_fifo_data_valid | en_adc_fifo_data_valid_t |
| FIFO valid data result (Scan, Priority Conversion) More... | |
| typedef enum en_adc_fifo_start_cause | en_adc_fifo_start_cause_t |
| FIFO data start cause. More... | |
| typedef enum en_adc_range_result | en_adc_range_result_t |
| Range Comparison Factor. More... | |
| typedef enum en_adc_timer_select | en_adc_timer_select_t |
| ADC scan/priority conversion timer trigger selection. More... | |
| typedef struct stc_ad_channel_list | stc_ad_channel_list_t |
| ADC Channel list with same sort order as the ER32 registers. More... | |
| typedef struct stc_adc_config | stc_adc_config_t |
| ADC configuration. More... | |
| typedef enum en_adc_instance_index | en_adc_instance_index_t |
| Enumeration to define an index for each enabled ADC instance. More... | |
| typedef struct stc_adc_intern_data | stc_adc_intern_data_t |
| ADC instance internal data, storing internal information for each enabled ADC instance. More... | |
| typedef struct stc_adc_instance_data | stc_adc_instance_data_t |
| ADC instance data type. More... | |
Functions | |
| static stc_adc_intern_data_t * | AdcGetInternDataPtr (volatile FM4_ADC_TypeDef *pstcAdc) |
| Return the internal data for a certain ADC instance. More... | |
| static void | Adc_InitInterrupt (volatile FM4_ADC_TypeDef *pstcAdc) |
| Set NVIC Interrupt depending on ADC instance. More... | |
| static void | Adc_DeInitInterrupt (volatile FM4_ADC_TypeDef *pstcAdc) |
| Clear NVIC Interrupt depending on ADC instance. More... | |
| void | AdcIrqHandler (volatile FM4_ADC_TypeDef *pstcAdc, stc_adc_intern_data_t *pstcAdcInternData) |
| ADC instance interrupt service routine. More... | |
| en_result_t | Adc_Init (volatile FM4_ADC_TypeDef *pstcAdc, stc_adc_config_t *pstcConfig) |
| Initialize ADC. More... | |
| en_result_t | Adc_DeInit (volatile FM4_ADC_TypeDef *pstcAdc) |
| De-Initialize ADC. More... | |
| en_result_t | Adc_EnableWaitReady (volatile FM4_ADC_TypeDef *pstcAdc) |
| Enable ADC and wait for Readiness. More... | |
| en_result_t | Adc_Enable (volatile FM4_ADC_TypeDef *pstcAdc) |
| Enable ADC. More... | |
| en_result_t | Adc_Ready (volatile FM4_ADC_TypeDef *pstcAdc) |
| Check ADC Readiness. More... | |
| en_result_t | Adc_ScanSwTrigger (volatile FM4_ADC_TypeDef *pstcAdc) |
| ADC Scan Software Start Trigger. More... | |
| en_result_t | Adc_PrioSwTrigger (volatile FM4_ADC_TypeDef *pstcAdc) |
| ADC Priority Software Start Trigger. More... | |
| en_result_t | Adc_ForceStop (volatile FM4_ADC_TypeDef *pstcAdc) |
| ADC Software Stop. More... | |
| en_result_t | Adc_ScanStatus (volatile FM4_ADC_TypeDef *pstcAdc) |
| Read Scan Conversion Status of ADC. More... | |
| en_result_t | Adc_PrioStatus (volatile FM4_ADC_TypeDef *pstcAdc) |
| Read Priority Conversion Status of ADC. More... | |
| en_result_t | Adc_Prio2Status (volatile FM4_ADC_TypeDef *pstcAdc) |
| Read Priority Level 2 Conversion Status of ADC. More... | |
| en_adc_fifo_status_t | Adc_ScanFifoStatus (volatile FM4_ADC_TypeDef *pstcAdc) |
| Read Scan Conversion FIFO state. More... | |
| en_result_t | Adc_ScanFifoClear (volatile FM4_ADC_TypeDef *pstcAdc) |
| Clears the Scan Conversion FIFO. More... | |
| en_adc_fifo_status_t | Adc_PrioFifoStatus (volatile FM4_ADC_TypeDef *pstcAdc) |
| Read Priority Conversion FIFO state. More... | |
| en_result_t | Adc_PrioFifoClear (volatile FM4_ADC_TypeDef *pstcAdc) |
| Clears the Priority Conversion FIFO. More... | |
| uint32_t | Adc_ReadScanFifo (volatile FM4_ADC_TypeDef *pstcAdc) |
| Reads out Scan Conversion FIFO. More... | |
| uint8_t | Adc_GetScanChannel (uint32_t u32FifoData) |
| Get Channel Number from FIFO data. More... | |
| en_adc_fifo_data_valid_t | Adc_GetScanDataValid (uint32_t u32FifoData) |
| Get Valid Data Flag from FIFO data. More... | |
| en_adc_fifo_start_cause_t | Adc_GetScanDataCause (uint32_t u32FifoData) |
| Get Scan Conversion Start Cause from FIFO data. More... | |
| uint32_t | Adc_ReadPrioFifo (volatile FM4_ADC_TypeDef *pstcAdc) |
| Reads out Priority Conversion FIFO. More... | |
| uint8_t | Adc_GetPrioChannel (uint32_t u32FifoData) |
| Get Channel Number from Priority FIFO data. More... | |
| en_adc_fifo_data_valid_t | Adc_GetPrioDataValid (uint32_t u32FifoData) |
| Get Valid Data Flag from Priority FIFO data. More... | |
| en_adc_fifo_start_cause_t | Adc_GetPrioDataCause (uint32_t u32FifoData) |
| Get Priority Conversion Start Cause from FIFO data. More... | |
| en_adc_range_result_t | Adc_GetRangeResultValid (volatile FM4_ADC_TypeDef *pstcAdc) |
| Read Raneg Comparison Result. More... | |
Variables | |
| stc_adc_instance_data_t | m_astcAdcInstanceDataLut [(uint8_t)(PDL_PERIPHERAL_ENABLE_ADC0==PDL_ON)+(uint8_t)(PDL_PERIPHERAL_ENABLE_ADC1==PDL_ON)+(uint8_t)(PDL_PERIPHERAL_ENABLE_ADC2==PDL_ON)] |
| Look-up table for all enabled ADC instances and their internal data. More... | |
| stc_adc_instance_data_t | m_astcAdcInstanceDataLut [(uint8_t)(PDL_PERIPHERAL_ENABLE_ADC0==PDL_ON)+(uint8_t)(PDL_PERIPHERAL_ENABLE_ADC1==PDL_ON)+(uint8_t)(PDL_PERIPHERAL_ENABLE_ADC2==PDL_ON)] |
| Look-up table for all enabled ADC instances and their internal data. More... | |
Provided functions of ADC module:
Adc_Init() initializes an ADC instance according the configuration of the structure type stc_adc_config_t. Adc_DeInit() de-initializes an ADC insstance.
For using the ADC instnace Adc_Enable() can be used. In this case the user has to poll the function Adc_Ready(). The advantage is that during polling the application can do other tasks. If this is not needed the function Adc_EnableWaitReady() can be used. Note that depending on the used device the time-out definition PDL_ADC_READY_WAIT_COUNT may be need to be adjusted.
Adc_ScanSwStart() and Adc_PrioSwStop() can be used for software trigger start for scan and priority conversion.
Adc_ForceStop() stops both ADC scan and priority conversion forcely.
Adc_ScanStatus(), Adc_PrioStatus(), Adc_Prio2Status() return the status of the scanning process (ongoing or ready).
Adc_ScanFifioStatus() and Adc_PrioFifioStatus() return the current status of the scan conversion and priority conversion result FIFO by the type en_adc_fifo_status_t.
Adc_ScanFifioClear() and Adc_PrioFifioClear() clear the FIFOs.
Adc_ReadScanFifo() and Adc_ReadPrioFifo() read out the FIFOs.
Adc_GetScanChannel() and Adc_GetPrioChannel() extract the channel number from the raw FIFO data.
Adc_GetScanDataValid() and Adc_GetPrioDataValid() check, if FIFO data is valid.
Adc_GetScanDataCause() and Adc_GetPrioDataCause() return the conversion factor from the FIFO data.
Adc_GetRangeResultValid() returns the range comparison factor of the type of en_adc_range_result_t.
| #define ADC0 (*((volatile stc_adcn_t *) FM4_ADC0_BASE)) |
Definition at line 159 of file adc.h.
Referenced by Adc_DeInitInterrupt(), and Adc_InitInterrupt().
| #define ADC1 (*((volatile stc_adcn_t *) FM4_ADC1_BASE)) |
Definition at line 160 of file adc.h.
Referenced by Adc_DeInitInterrupt(), and Adc_InitInterrupt().
| #define ADC2 (*((volatile stc_adcn_t *) FM4_ADC2_BASE)) |
Definition at line 161 of file adc.h.
Referenced by Adc_DeInitInterrupt(), and Adc_InitInterrupt().
| #define ADC_INSTANCE_COUNT |
Definition at line 165 of file adc.h.
Referenced by AdcGetInternDataPtr().
| #define PDL_ADC_READY_WAIT_COUNT 1000000u |
Time-out counter value for ADC ready bit polling.
Definition at line 163 of file adc.h.
Referenced by Adc_EnableWaitReady().
| #define stc_adcn_t FM4_ADC_TypeDef |
Definition at line 158 of file adc.h.
Referenced by Adc_DeInitInterrupt(), and Adc_InitInterrupt().
| typedef enum en_adc_fifo_data_valid en_adc_fifo_data_valid_t |
FIFO valid data result (Scan, Priority Conversion)
| typedef enum en_adc_fifo_start_cause en_adc_fifo_start_cause_t |
FIFO data start cause.
| typedef enum en_adc_fifo_status en_adc_fifo_status_t |
FIFO Status (Scan, Priority Conversion)
| typedef enum en_adc_instance_index en_adc_instance_index_t |
Enumeration to define an index for each enabled ADC instance.
| typedef enum en_adc_range_result en_adc_range_result_t |
Range Comparison Factor.
| typedef enum en_adc_sample_time_n en_adc_sample_time_n_t |
Priority Conversion Stage Count.
| typedef enum en_adc_scan_mode en_adc_scan_mode_t |
Scan Conversion Mode.
| typedef enum en_adc_timer_select en_adc_timer_select_t |
ADC scan/priority conversion timer trigger selection.
| typedef struct stc_ad_channel_list stc_ad_channel_list_t |
ADC Channel list with same sort order as the ER32 registers.
| typedef struct stc_adc_config stc_adc_config_t |
ADC configuration.
| typedef struct stc_adc_instance_data stc_adc_instance_data_t |
ADC instance data type.
| typedef struct stc_adc_intern_data stc_adc_intern_data_t |
ADC instance internal data, storing internal information for each enabled ADC instance.
FIFO data start cause.
| enum en_adc_fifo_status |
| enum en_adc_range_result |
| enum en_adc_sample_time_n |
| enum en_adc_scan_mode |
| enum en_adc_timer_select |
ADC scan/priority conversion timer trigger selection.
| en_result_t Adc_DeInit | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
De-Initialize ADC.
This function deinitializes an ADC module
| [in] | pstcAdc | ADC instance |
| Ok | ADC instance fully disabled and reset |
| ErrorInvalidParameter | pstcAdc == NULL |
Definition at line 637 of file adc.c.
References Adc_DeInitInterrupt(), ErrorInvalidParameter, and Ok.

|
static |
Clear NVIC Interrupt depending on ADC instance.
| pstcAdc | Pointer to ADC instance |
Definition at line 292 of file adc.c.
References ADC0, ADC1, ADC2, PDL_DEFAULT_INTERRUPT_LEVEL, and stc_adcn_t.
Referenced by Adc_DeInit().

| en_result_t Adc_Enable | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
Enable ADC.
This function enables an ADC instance (Does not wait for readiness)
| [in] | pstcAdc | ADC instance |
| Ok | ADC enable bit set (does not indicate readiness!) |
| ErrorInvalidParameter | pstcAdc == NULL |
Definition at line 734 of file adc.c.
References ErrorInvalidParameter, and Ok.
| en_result_t Adc_EnableWaitReady | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
Enable ADC and wait for Readiness.
This function enables an ADC instance and waits for readiness
| [in] | pstcAdc | ADC instance |
| Ok | ADC instance enabled and ready |
| ErrorTimeout | ADC instance not ready |
| ErrorInvalidParameter | pstcAdc == NULL |
Definition at line 696 of file adc.c.
References ErrorInvalidParameter, ErrorTimeout, Ok, PDL_ADC_READY_WAIT_COUNT, and TRUE.
| en_result_t Adc_ForceStop | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
ADC Software Stop.
This function request a stop of the ADC
| [in] | pstcAdc | ADC instance |
| Ok | ADC instance stop request |
| ErrorInvalidParameter | pstcAdc == NULL |
Definition at line 835 of file adc.c.
References ErrorInvalidParameter, and Ok.
| uint8_t Adc_GetPrioChannel | ( | uint32_t | u32FifoData | ) |
Get Channel Number from Priority FIFO data.
This function returns the Channel data from input data from Priority Conversion FIFO
| [in] | u32FifoData | Priority FIFO data |
| en_adc_fifo_start_cause_t Adc_GetPrioDataCause | ( | uint32_t | u32FifoData | ) |
Get Priority Conversion Start Cause from FIFO data.
This function returns the Priority Conversion Start Cause from FIFO Data
| [in] | u32FifoData | Priority FIFO data |
| AdcFifoSoftwareStart | Recent FIFO data cuased by Software Start |
| AdcFifoTimerStart | Recent FIFO data causde by Timer Start |
| AdcFifoExternalTrigger | Recent FIFO data causde by External Trigger |
| AdcFifoErrorStart | Recent FIFO data causde by unknown factor |
Definition at line 1257 of file adc.c.
References AdcFifoErrorStart, AdcFifoExternalTrigger, AdcFifoSoftwareStart, and AdcFifoTimerStart.
| en_adc_fifo_data_valid_t Adc_GetPrioDataValid | ( | uint32_t | u32FifoData | ) |
Get Valid Data Flag from Priority FIFO data.
This function returns the Channel data from input data from FIFO
| [in] | u32FifoData | Priority FIFO data |
| AdcFifoDataValid | Recent FIFO data valid |
| AdcFifoDataInvalid | Recent FIFO data invalid |
Definition at line 1232 of file adc.c.
References AdcFifoDataInvalid, and AdcFifoDataValid.
| en_adc_range_result_t Adc_GetRangeResultValid | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
Read Raneg Comparison Result.
This function reads out the Range Comparison Flag
| [in] | pstcAdc | ADC instance |
| AdcRangeResultValid | Range result valid (occurred) |
| AdcRangeResultInvalid | Range result invalid (not occurred) |
| AdcRangeResultError | pstcAdc == NULL |
Definition at line 1289 of file adc.c.
References AdcRangeResultError, AdcRangeResultInvalid, and AdcRangeResultValid.
| uint8_t Adc_GetScanChannel | ( | uint32_t | u32FifoData | ) |
Get Channel Number from FIFO data.
This function returns the Channel data from input data from Scan Conversion FIFO
| [in] | u32FifoData | FIFO data |
| en_adc_fifo_start_cause_t Adc_GetScanDataCause | ( | uint32_t | u32FifoData | ) |
Get Scan Conversion Start Cause from FIFO data.
This function returns the Scan Conversion Start Cause from FIFO Data
| [in] | u32FifoData | FIFO data |
| AdcFifoSoftwareStart | Recent FIFO data cuased by Software Start |
| AdcFifoTimerStart | Recent FIFO data caused by Timer Start |
| AdcFifoErrorStart | Recent FIFO data caused by unknown factor |
Definition at line 1161 of file adc.c.
References AdcFifoErrorStart, AdcFifoSoftwareStart, and AdcFifoTimerStart.
| en_adc_fifo_data_valid_t Adc_GetScanDataValid | ( | uint32_t | u32FifoData | ) |
Get Valid Data Flag from FIFO data.
This function returns the Channel data from input data from FIFO
| [in] | u32FifoData | FIFO data |
| AdcFifoDataValid | Recent FIFO data valid |
| AdcFifoDataInvalid | Recent FIFO data invalid |
Definition at line 1137 of file adc.c.
References AdcFifoDataInvalid, and AdcFifoDataValid.
| en_result_t Adc_Init | ( | volatile FM4_ADC_TypeDef * | pstcAdc, |
| stc_adc_config_t * | pstcConfig | ||
| ) |
Initialize ADC.
This function initializes an ADC module and sets up the internal data structures
| [in] | pstcAdc | ADC instance |
| [in] | pstcConfig | ADC module configuration |
| Ok | Internal data has been setup |
| ErrorInvalidParameter | pstcAdc == NULL pstcConfig == NULL Other invalid configuration |
Definition at line 334 of file adc.c.
References Adc_InitInterrupt(), AdcGetInternDataPtr(), stc_adc_config::bCompareAllChannels, stc_adc_config::bComparisonEnable, stc_adc_config::bCompIrqEqualGreater, stc_adc_config::bConversionCompIrqEnable, stc_adc_config::bFifoOverrunIrqEnable, stc_adc_config::bLsbAlignment, stc_adc_config::bOutOfRange, stc_adc_config::bPrioConversionIrqEnable, stc_adc_config::bPrioExtTrigEnable, stc_adc_config::bPrioExtTrigStartEnable, stc_adc_config::bPrioTimerStartEnable, stc_adc_config::bRangeCompareAllChannels, stc_adc_config::bRangeComparisonEnable, stc_adc_config::bRangeComparisonIrqEnable, stc_adc_config::bScanConversionIrqEnable, stc_adc_config::bScanTimerStartEnable, stc_adc_config::enPrioConversionTimerTrigger, stc_adc_config::enSamplingTimeN0, stc_adc_config::enSamplingTimeN1, stc_adc_config::enScanConversionTimerTrigger, stc_adc_config::enScanMode, ErrorInvalidParameter, Ok, PDL_ZERO_STRUCT, stc_adc_config::pfnComparisonCallback, stc_adc_intern_data::pfnComparisonCallback, stc_adc_config::pfnErrorCallbackAdc, stc_adc_intern_data::pfnErrorCallbackAdc, stc_adc_config::pfnPrioConversion, stc_adc_intern_data::pfnPrioConversion, stc_adc_config::pfnPrioErrorCallbackAdc, stc_adc_intern_data::pfnPrioErrorCallbackAdc, stc_adc_config::pfnRangeCallback, stc_adc_intern_data::pfnRangeCallback, stc_adc_config::pfnScanConversion, stc_adc_intern_data::pfnScanConversion, ScanRepeatConversion, ScanSingleConversion, TRUE, stc_adc_config::u16ComparisonValue, stc_adc_config::u16LowerLimitRangeValue, stc_adc_config::u16UpperLimitRangeValue, stc_adc_config::u32CannelSelect, stc_adc_config::u32SamplingTimeSelect, stc_adc_config::u8ComapreChannel, stc_adc_config::u8EnableTime, stc_adc_config::u8PrioFifoDepth, stc_adc_config::u8PrioLevel1AnalogChSel, stc_adc_config::u8PrioLevel2AnalogChSel, stc_adc_config::u8RangeComapreChannel, stc_adc_config::u8RangeCountValue, stc_adc_config::u8SamplingMultiplier, stc_adc_config::u8SamplingTime0, stc_adc_config::u8SamplingTime1, stc_adc_config::u8ScanFifoDepth, Value1, Value128, Value16, Value256, Value32, Value4, Value64, and Value8.

|
static |
Set NVIC Interrupt depending on ADC instance.
| pstcAdc | Pointer to ADC instance |
Definition at line 263 of file adc.c.
References ADC0, ADC1, ADC2, PDL_IRQ_LEVEL_ADC0, PDL_IRQ_LEVEL_ADC1, PDL_IRQ_LEVEL_ADC2, and stc_adcn_t.
Referenced by Adc_Init().

| en_result_t Adc_Prio2Status | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
Read Priority Level 2 Conversion Status of ADC.
This function reads out the Priority Level 2 Conversion Status odf the ADC
| [in] | pstcAdc | ADC instance |
| Ok | ADC instance no priority level 2 conversion ongoing |
| OperationInProgress | ADC instance priority level 2 conversion ongoing |
| ErrorInvalidParameter | pstcAdc == NULL |
Definition at line 918 of file adc.c.
References ErrorInvalidParameter, Ok, and OperationInProgress.
| en_result_t Adc_PrioFifoClear | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
Clears the Priority Conversion FIFO.
This function clears the Priority Conversion FIFO
| [in] | pstcAdc | ADC instance |
| Ok | Priority Conversion FIFO cleared |
| ErrorInvalidParameter | pstcAdc == NULL |
Definition at line 1068 of file adc.c.
References ErrorInvalidParameter, and Ok.
| en_adc_fifo_status_t Adc_PrioFifoStatus | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
Read Priority Conversion FIFO state.
This function reads out the state of the Priority Conversion FIFO
| [in] | pstcAdc | ADC instance |
| AdcFifoEmpty | Priority Conversion FIFO empty (no data) |
| AdcFifoFilled | Priority Conversion FIFO (partly) filled |
| AdcFifoFull | Priority Conversion FIFO full |
| AdcFifoOverrun | Priority Conversion FIFO overrun |
| AdcFifoError | Unknown error or pstcAdc == NULL |
Definition at line 1021 of file adc.c.
References AdcFifoEmpty, AdcFifoError, AdcFifoFilled, AdcFifoFull, AdcFifoOverrun, un_adc_pccr_t::stcAdcPccrReadout, and un_adc_pccr_t::u8AdcPccrReadout.
| en_result_t Adc_PrioStatus | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
Read Priority Conversion Status of ADC.
This function reads out the Priority Conversion Status odf the ADC
| [in] | pstcAdc | ADC instance |
| Ok | ADC instance no priority conversion ongoing |
| OperationInProgress | ADC instance priority conversion ongoing |
| ErrorInvalidParameter | pstcAdc == NULL |
Definition at line 888 of file adc.c.
References ErrorInvalidParameter, Ok, and OperationInProgress.
| en_result_t Adc_PrioSwTrigger | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
ADC Priority Software Start Trigger.
This function starts an AD Priority Conversion by Software trigger
| [in] | pstcAdc | ADC instance |
| Ok | ADC instance triggered (or re-triggered) |
| ErrorInvalidParameter | pstcAdc == NULL |
Definition at line 811 of file adc.c.
References ErrorInvalidParameter, and Ok.
| uint32_t Adc_ReadPrioFifo | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
Reads out Priority Conversion FIFO.
This function reads out the Priority Conversion FIFO.
| [in] | pstcAdc | ADC instance |
| uint32_t Adc_ReadScanFifo | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
Reads out Scan Conversion FIFO.
This function reads out the Scan Conversion FIFO.
| [in] | pstcAdc | ADC instance |
| en_result_t Adc_Ready | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
Check ADC Readiness.
This function checks for ADC instance readiness
| [in] | pstcAdc | ADC instance |
| Ok | ADC instance ready |
| ErrorNotReady | ADC instance not ready |
| ErrorInvalidParameter | pstcAdc == NULL |
Definition at line 760 of file adc.c.
References ErrorInvalidParameter, ErrorNotReady, FALSE, and Ok.
| en_result_t Adc_ScanFifoClear | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
Clears the Scan Conversion FIFO.
This function clears the Scan Conversion FIFO
| [in] | pstcAdc | ADC instance |
| Ok | Scan Conversion FIFO cleared |
| ErrorInvalidParameter | pstcAdc == NULL |
Definition at line 994 of file adc.c.
References ErrorInvalidParameter, and Ok.
| en_adc_fifo_status_t Adc_ScanFifoStatus | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
Read Scan Conversion FIFO state.
This function reads out the state of the Scan Conversion FIFO
| [in] | pstcAdc | ADC instance |
| AdcFifoEmpty | Scan Conversion FIFO empty (no data) |
| AdcFifoFilled | Scan Conversion FIFO (partly) filled |
| AdcFifoFull | Scan Conversion FIFO full |
| AdcFifoOverrun | Scan Conversion FIFO overrun |
| AdcFifoError | Unknown error or pstcAdc == NULL |
Definition at line 948 of file adc.c.
References AdcFifoEmpty, AdcFifoError, AdcFifoFilled, AdcFifoFull, AdcFifoOverrun, un_adc_sccr_t::stcAdcSccrReadout, and un_adc_sccr_t::u8AdcSccrReadout.
| en_result_t Adc_ScanStatus | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
Read Scan Conversion Status of ADC.
This function reads out the Scan Conversion Status odf the ADC
| [in] | pstcAdc | ADC instance |
| Ok | ADC instance ready |
| OperationInProgress | ADC instance not ready |
| ErrorInvalidParameter | pstcAdc == NULL |
Definition at line 860 of file adc.c.
References ErrorInvalidParameter, Ok, and OperationInProgress.
| en_result_t Adc_ScanSwTrigger | ( | volatile FM4_ADC_TypeDef * | pstcAdc | ) |
ADC Scan Software Start Trigger.
This function starts an AD Scan Conversion by Software trigger
| [in] | pstcAdc | ADC instance |
| Ok | ADC instance triggered (or re-triggered) |
| ErrorInvalidParameter | pstcAdc == NULL |
Definition at line 787 of file adc.c.
References ErrorInvalidParameter, and Ok.
|
static |
Return the internal data for a certain ADC instance.
| pstcAdc | Pointer to ADC instance |
Definition at line 156 of file adc.c.
References ADC_INSTANCE_COUNT, and stc_adc_instance_data::stcInternData.
Referenced by Adc_Init().

| void AdcIrqHandler | ( | volatile FM4_ADC_TypeDef * | pstcAdc, |
| stc_adc_intern_data_t * | pstcAdcInternData | ||
| ) |
ADC instance interrupt service routine.
ADC instance interrupt service routine, clear interrupt cause and
| pstcAdc | Pointer to ADC instance |
| pstcAdcInternData | Pointer to ADC intern data |
Definition at line 185 of file adc.c.
References stc_adc_intern_data::pfnComparisonCallback, stc_adc_intern_data::pfnErrorCallbackAdc, stc_adc_intern_data::pfnPrioConversion, stc_adc_intern_data::pfnPrioErrorCallbackAdc, stc_adc_intern_data::pfnRangeCallback, and stc_adc_intern_data::pfnScanConversion.
| stc_adc_instance_data_t m_astcAdcInstanceDataLut[(uint8_t)(PDL_PERIPHERAL_ENABLE_ADC0==PDL_ON)+(uint8_t)(PDL_PERIPHERAL_ENABLE_ADC1==PDL_ON)+(uint8_t)(PDL_PERIPHERAL_ENABLE_ADC2==PDL_ON)] |
Look-up table for all enabled ADC instances and their internal data.
| stc_adc_instance_data_t m_astcAdcInstanceDataLut[(uint8_t)(PDL_PERIPHERAL_ENABLE_ADC0==PDL_ON)+(uint8_t)(PDL_PERIPHERAL_ENABLE_ADC1==PDL_ON)+(uint8_t)(PDL_PERIPHERAL_ENABLE_ADC2==PDL_ON)] |