| PDL for FM0+ Version1.0 Peripheral Driverl Library for FM0+

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Defines | Typedefs | Enumerations | Functions | Variables
C:/pdl_v10/library/driver/adc/adc.h File Reference
`#include "mcu.h"`
`#include "pdl_user.h"`
Include dependency graph for adc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | stc_ad_channel_list
| ADC Channel list with same sort order as the ER32 registers. More...
union | stc_ad_channel_list::unAdcChannels
struct | stc_ad_channel_list::unAdcChannels::stcChannelBits
struct | stc_adc_scan
| Scan Conversion configuration. More...
struct | stc_adc_prio
| Priority Conversion configuration. More...
struct | stc_adc_comapre
| Comparison configuration. More...
struct | stc_adc_range_compare
| Range comparison configuration. More...
struct | stc_adc_config
| ADC configuration. More...
struct | stc_adc_int_sel
| ADC interrupt selection. More...
struct | stc_scan_fifo_info
| Scan conversion FIFO information. More...
struct | stc_prio_fifo_info
| Priority conversion FIFO information. More...
struct | stc_adc_int_callback
| ADC interrupt callback function. 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...
## Defines
#define | stc_adcn_t FM0P_ADC_TypeDef
#define | ADC0 (*((volatile stc_adcn_t *) FM0P_ADC0_BASE))
#define | ADC1 (*((volatile stc_adcn_t *) FM0P_ADC1_BASE))
#define | ADC2 (*((volatile stc_adcn_t *) FM0P_ADC2_BASE))
#define | PDL_ADC_READY_WAIT_COUNT 1000000u
| Time-out counter value for ADC ready bit polling.
#define | ADC_INSTANCE_COUNT
#define | ADC0_SCAN_FIFO_ADDR (uint32_t)(&FM0P_ADC0->SCFD)
#define | ADC1_SCAN_FIFO_ADDR (uint32_t)(&FM0P_ADC1->SCFD)
#define | ADC2_SCAN_FIFO_ADDR (uint32_t)(&FM0P_ADC2->SCFD)
## Typedefs
typedef void(* | func_ptr_adc_parg32_t )(volatile uint32_t *pu32Argument)
typedef enum en_adc_scan_mode | en_adc_scan_mode_t
| Scan Conversion Mode.
typedef enum en_adc_sample_time_n | en_adc_sample_time_n_t
| Priority Conversion Stage Count.
typedef enum en_adc_fifo_status | en_adc_fifo_status_t
| FIFO Status (Scan, Priority Conversion)
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_scan | stc_adc_scan_t
| Scan Conversion configuration.
typedef struct stc_adc_prio | stc_adc_prio_t
| Priority Conversion configuration.
typedef struct stc_adc_comapre | stc_adc_comapre_t
| Comparison configuration.
typedef struct stc_adc_range_compare | stc_adc_range_compare_t
| Range comparison configuration.
typedef struct stc_adc_config | stc_adc_config_t
| ADC configuration.
typedef struct stc_adc_int_sel | stc_adc_int_sel_t
| ADC interrupt selection.
typedef enum en_scan_start_cause | en_scan_start_cause_t
| Scan conversion start cause.
typedef struct stc_scan_fifo_info | stc_scan_fifo_info_t
| Scan conversion FIFO information.
typedef enum en_prio_start_cause | en_prio_start_cause_t
| Priority conversion start cause.
typedef struct stc_prio_fifo_info | stc_prio_fifo_info_t
| Priority conversion FIFO information.
typedef struct stc_adc_int_callback | stc_adc_int_callback_t
| ADC interrupt callback function.
typedef enum en_adc_status | en_adc_status_t
| ADC status list.
typedef enum en_adc_int | en_adc_int_t
| ADC interrupt type.
typedef enum en_adc_instance_index | en_adc_instance_index_t
| Enumeration to define an index for each enabled ADC instance.
typedef struct stc_adc_intern_data | stc_adc_intern_data_t
| ADC instance internal data, storing internal information for each enabled ADC instance.
typedef struct stc_adc_instance_data | stc_adc_instance_data_t
| ADC instance data type.
## Enumerations
enum | en_adc_scan_mode { ScanSingleConversion = 0, ScanRepeatConversion = 1 }
| Scan Conversion Mode. More...
enum | en_adc_sample_time_n { Value1 = 0, Value4 = 1, Value8 = 2, Value16 = 3, Value32 = 4, Value64 = 5, Value128 = 6, Value256 = 7 }
| Priority Conversion Stage Count. More...
enum | en_adc_fifo_status { AdcFifoEmpty = 0, AdcFifoFilled = 1, AdcFifoFull = 2, AdcFifoOverrun = 3, AdcFifoError = 4 }
| FIFO Status (Scan, Priority Conversion) More...
enum | en_adc_timer_select { AdcNoTimer = 0, AdcMft = 1, AdcBt0 = 2, AdcBt1 = 3, AdcBt2 = 4, AdcBt3 = 5, AdcBt4 = 6, AdcBt5 = 7, AdcBt6 = 8, AdcBt7 = 9 }
| ADC scan/priority conversion timer trigger selection. More...
enum | en_scan_start_cause { ScanStartBySw = 0, ScanStartByTimer = 1 }
| Scan conversion start cause. More...
enum | en_prio_start_cause { PrioStartBySw = 0, PrioStartByTimer = 1, PrioStartByExtTrig = 2 }
| Priority conversion start cause. More...
enum | en_adc_status { ScanFifoEmptyStatus = 0, ScanFifoFullStatus = 1, PrioFifoEmptyStatus = 2, PrioFifoFullStatus = 3, Prio2PendingStatus = 4, PrioStatus = 5, ScanStatus = 6, RangeThresholdExcessFlag = 7 }
| ADC status list. More...
enum | en_adc_int { AdcScanInt = 0, AdcPrioInt = 1, AdcScanFifoOverrunInt = 2, AdcPrioFifoOverrunInt = 3, AdcComparisonInt = 4, AdcRangeComparisonInt = 5 }
| ADC interrupt type. More...
enum | en_adc_instance_index { AdcInstanceIndexAdc0, AdcInstanceIndexAdc1, AdcInstanceIndexAdc2, AdcInstanceIndexMax }
| Enumeration to define an index for each enabled ADC instance. More...
## Functions
en_result_t | Adc_Init (volatile FM0P_ADC_TypeDef *pstcAdc, stc_adc_config_t *pstcConfig)
| Initialize ADC.
en_result_t | Adc_DeInit (volatile FM0P_ADC_TypeDef *pstcAdc)
| De-Initialize ADC.
en_result_t | Adc_EnableInt (volatile FM0P_ADC_TypeDef *pstcAdc, stc_adc_int_sel_t *pstcIntSel, stc_adc_int_callback_t *pstcIntCallback)
| Enable ADC interrupt.
en_result_t | Adc_DisableInt (volatile FM0P_ADC_TypeDef *pstcAdc, stc_adc_int_sel_t *pstcIntSel)
| Disable ADC interrupt.
boolean_t | Adc_GetIntFlag (volatile FM0P_ADC_TypeDef *pstcAdc, en_adc_int_t enInt)
| Get ADC interrupt flag.
en_result_t | Adc_ClrIntFlag (volatile FM0P_ADC_TypeDef *pstcAdc, en_adc_int_t enInt)
| Clear ADC interrupt flag.
en_result_t | Adc_Enable (volatile FM0P_ADC_TypeDef *pstcAdc)
| Enable ADC and wait for ADC operation ready.
en_result_t | Adc_Disable (volatile FM0P_ADC_TypeDef *pstcAdc)
| Disable ADC.
en_result_t | Adc_SwTriggerScan (volatile FM0P_ADC_TypeDef *pstcAdc)
| ADC Scan Software Start Trigger.
en_result_t | Adc_StopScanRepeat (volatile FM0P_ADC_TypeDef *pstcAdc)
| Stop Scan conversion with repeat mode.
en_result_t | Adc_SwTriggerPrio (volatile FM0P_ADC_TypeDef *pstcAdc)
| ADC Priority Software Start Trigger.
en_result_t | Adc_ForceStop (volatile FM0P_ADC_TypeDef *pstcAdc)
| ADC Software Stop.
boolean_t | Adc_GetStatus (volatile FM0P_ADC_TypeDef *pstcAdc, en_adc_status_t enStatus)
| Get ADC conversion status.
uint32_t | Adc_GetScanFifo (volatile FM0P_ADC_TypeDef *pstcAdc)
| Reads out Scan Conversion FIFO.
en_result_t | Adc_ClrScanFifo (volatile FM0P_ADC_TypeDef *pstcAdc)
| Clear scan FIFO.
en_result_t | Adc_ExtractScanFifo (volatile FM0P_ADC_TypeDef *pstcAdc, uint32_t u32FifoData, stc_scan_fifo_info_t *pstcFifo)
| Extract scan conversion data information from FIFO data.
uint32_t | Adc_GetPrioFifo (volatile FM0P_ADC_TypeDef *pstcAdc)
| Reads out Priority Conversion FIFO.
en_result_t | Adc_ClrPrioFifo (volatile FM0P_ADC_TypeDef *pstcAdc)
| Clear priority FIFO.
en_result_t | Adc_ExtractPrioFifo (volatile FM0P_ADC_TypeDef *pstcAdc, uint32_t u32FifoData, stc_prio_fifo_info_t *pstcFifo)
| Extract priority conversion data information from FIFO data.
void | AdcIrqHandler (volatile FM0P_ADC_TypeDef *pstcAdc, stc_adc_intern_data_t *pstcAdcInternData)
| ADC instance interrupt service routine.
## 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.

## Detailed Description

Headerfile for ADC functions

History:

- 2014-01-14 1.0 Edison Zhang First version.
- 2014-03-06 1.1 Edison Zhang Add the SCFD register address defnition

Definition in file adc.h.