|
| #define | Def_VBatFactor (2.0f) |
| | 2x factor
|
| #define | STM32_VREF_CAL (VAL_AT(VREF_CAL_ADDR, uint16_t)) |
| | VRef (ADC) calibration address content.
|
| #define | STM32_TS_CAL1 (VAL_AT(TS_CAL1_ADDR, uint16_t)) |
| | Temp sensor ADC raw data acquired at Lower temperature address content.
|
| #define | STM32_TS_CAL2 (VAL_AT(TS_CAL2_ADDR, uint16_t)) |
| | Temp sensor ADC raw data acquired at Higher temperature address content.
|
| #define | ADC_NB 1UL |
| | Number of ADC peripherals used.
|
| #define | ADC_NB_CHAN 2UL |
| | Number of ADC channels used (per peripheral).
|
| #define | TOTAL_ADC_CHANS (ADC_NB * ADC_NB_CHAN) |
| | Total number of ADC channels.
|
| #define | ADC_SAMP_BUF_SIZE 4UL |
| #define | ADC_REFRESH_PERIOD 20UL |
| | ADC conversions results refreshing period (default value).
|
|
| uint16_t | ADC_GetRawVal (const eAnalogInput input) |
| | Get ADC channel raw value.
|
| float | ADC_GetConvertedVal (const eAnalogInput input) |
| | Get ADC channel converted value.
|
| void | ADC_SetPeriod (const uint32_t period) |
| | Set ADC Sampling or Conversion period.
|
| FctERR | ADC_Start (void) |
| | Start ADC acquisitions.
|
| FctERR | ADC_Stop (void) |
| | Stop ADC acquisitions.
|
| void | ADC_handler (void) |
| | ADC_ex handler.
|
| __STATIC bool | _ADC_chan_check (const eAnalogInput channel, const uint16_t target) |
| | Check ADC channel raw value for range and stability around given value.
|
| bool | ADC_chan_check (const eAnalogInput channel, const uint16_t target) |
| | Check ADC channel raw value for range and stability around given value.
|
| bool | ADC_chan_check_custom (const eAnalogInput channel, const uint16_t target, const ADCChanChk_Cfg *const pCfg) |
| | Check ADC channel raw value for range and stability around given value (custom check parameters).
|
| void | HAL_ADC_ConvCpltCallback (ADC_HandleTypeDef *hadc) |
| | Conversion complete callback in non blocking mode.
|
Simple extension for ADCs.
- Author
- SMFSW
- Copyright
- MIT (c) 2017-2026, SMFSW
ADC_ex is meant to automate ADC conversions using DMA.
- DMA must be configured for ADC peripherals:
- Peripheral to Memory
- Circular Mode
- Increment Memory
- Data width Word for both peripheral and memory
- ADC configuration (no need to active ADC global interrupt, DMA will handle conversion complete callback):
- Scan conversion mode across channels enabled
- Continuous conversion is optional (as DMA continuous request handles the behavior)
- DMA continuous request when available (if disabled, user has to start conversions manually when needed)
- Interrupt generated at end of sequence of conversion
- Note
- Define
USE_ADC_EX symbol at project level to use ADC_ex functionalities
-
Configuration done including ADC_cfg.h file