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... | |
Macros | |
#define | Def_VAlim VDD_VALUE |
< Alias for legacy code using TEMP_CALC_V25 or TEMP_CALC_V30 | |
#define | ADC_RESOLUTION 12 |
ADC resolution in bits (defaults to 12 if not set) | |
#define | DefRangeADC (LSHIFT(1U, ADC_RESOLUTION) - 1) |
ADC digital range. | |
#define | Def_ADCStep(mv) ((mv) / (float) (DefRangeADC * 1000)) |
Step value (in mV) following given v. | |
Typedefs | |
typedef enum eADCidx | eADCidx |
typedef struct ADC_Cfg | ADC_Cfg |
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. | |
FctERR | ADC_Start (void) |
Start ADC conversions. | |
FctERR | ADC_Stop (void) |
Stop ADC conversions. | |
Simple extension for ADCs.
ADC_ex is meant to automate ADC conversions using DMA.
#define ADC_RESOLUTION 12 |
ADC resolution in bits (defaults to 12 if not set)
#define Def_ADCStep | ( | mv | ) | ((mv) / (float) (DefRangeADC * 1000)) |
Step value (in mV) following given v.
#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 DefRangeADC (LSHIFT(1U, ADC_RESOLUTION) - 1) |
ADC digital range.
typedef struct ADC_Cfg ADC_Cfg |
enum eADCidx |
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 |
FctERR ADC_Start | ( | void | ) |
Start ADC conversions.
FctERR ADC_Stop | ( | void | ) |
Stop ADC conversions.