|
HARMcksL: ARM HAL toolbox (yet STM32 oriented) 1.6
SMFSW collection of HAL hacks for STM32
|
Simple extension for ADCs. More...
#include "sarmfsw.h"#include "ADC_cfg.h"

Data Structures | |
| struct | ADC_Cfg |
| ADC channel declaration config structure. More... | |
| struct | ADCChanChk_Cfg |
| ADC channel check configuration structure. More... | |
Macros | |
| #define | Def_VAlim VDD_VALUE |
| < Alias for legacy code using TEMP_CALC_V25 or TEMP_CALC_V30 | |
| #define | ADC_RESOLUTION 12U |
| ADC resolution in bits (defaults to 12 if not set). | |
| #define | DefRangeADC (LSHIFT(1U, ADC_RESOLUTION) - 1U) |
| ADC digital range. | |
| #define | DefStepADC(mv) |
Step value (in mV) following given mv. | |
| #define | DefExpectedVREF(mv) |
Expected Vref value for nominal voltage mv. | |
Enumerations | |
| enum | eADCidx { ADC_MAX } |
| ADC peripheral instance indexes. More... | |
Functions | |
| 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. | |
| 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). | |
| bool | ADC_VREF_check (void) |
| Check VREFINT near its expected value. | |
| bool | ADC_VREF_check_custom (const ADCChanChk_Cfg *const pCfg) |
| Check VREFINT near its expected value (custom check parameters). | |
Simple extension for ADCs.
ADC_ex is meant to automate ADC conversions using DMA.
USE_ADC_EX symbol at project level to use ADC_ex functionalities | #define ADC_RESOLUTION 12U |
ADC resolution in bits (defaults to 12 if not set).
| #define Def_VAlim VDD_VALUE |
< Alias for legacy code using TEMP_CALC_V25 or TEMP_CALC_V30
Def_VAlim needs to be defined (in mV) if special power supply voltage used (eg. U5 variable power supply range)
| #define DefExpectedVREF | ( | mv | ) |
Expected Vref value for nominal voltage mv.
| #define DefRangeADC (LSHIFT(1U, ADC_RESOLUTION) - 1U) |
ADC digital range.
| #define DefStepADC | ( | mv | ) |
Step value (in mV) following given mv.
| enum eADCidx |
| bool ADC_chan_check | ( | const eAnalogInput | channel, |
| const uint16_t | target ) |
Check ADC channel raw value for range and stability around given value.
!
| [in] | channel | - ADC channel to check |
| [in] | target | - Target raw 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).
!
| [in] | channel | - ADC channel to check |
| [in] | target | - Target raw value |
| [in] | pCfg | - Pointer to custom configuration structure |

| float ADC_GetConvertedVal | ( | const eAnalogInput | input | ) |
Get ADC channel converted value.
| [in] | input | - Input index |
| uint16_t ADC_GetRawVal | ( | const eAnalogInput | input | ) |
Get ADC channel raw value.
| [in] | input | - Input index |
| void ADC_handler | ( | void | ) |
ADC_ex handler.

| void ADC_SetPeriod | ( | const uint32_t | period | ) |
Set ADC Sampling or Conversion period.
| [in] | period | - Sampling or Conversion period (in ms) |
| FctERR ADC_Start | ( | void | ) |
Start ADC acquisitions.

| FctERR ADC_Stop | ( | void | ) |
Stop ADC acquisitions.

| bool ADC_VREF_check | ( | void | ) |
Check VREFINT near its expected value.
!
| bool ADC_VREF_check_custom | ( | const ADCChanChk_Cfg *const | pCfg | ) |
Check VREFINT near its expected value (custom check parameters).
!
| [in] | pCfg | - Pointer to custom configuration structure |