PDL for FM4  Version1.2
Peripheral Driverl Library for FM4
adc.c File Reference
#include "adc.h"
Include dependency graph for adc.c:

Go to the source code of this file.

Data Structures

union  un_adc_sccr_t
 
union  un_adc_pccr_t
 

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...
 

Detailed Description

A detailed description is available at ADC description

History:

  • 2013-03-26 1.0 MWi First version.
  • 2013-07-22 1.1 MWi func_ptr_adc_arg32_t changed to func_ptr_adc_parg32_t for pointing to FIFO result register
  • 2013-11-22 1.2 EZ Correct Priority FIFO length location in the structure of stc_adc_config_t Add the software trigger function of Priority Conversion
  • 2014-01-15 1.3 MWi Fifio typo corrected to Fifo in Adc_ScanFifoStatus(), Adc_ScanFifoClear(), Adc_PrioFifoStatus(), Adc_PrioFifoClear()

Definition in file adc.c.