![]() |
simple FS
v0.1.0
|
module for Analog-Digital converter More...
Macros | |
#define | ADC_RESOLUTION 12 |
Physically resolution of ADC peripheral. More... | |
#define | ADC_Q_RESOLUTION 5 |
Precision of converted value. More... | |
#define | ADC_HW_MULTIPLYER 8 |
Physically placed voltage divider in measuring circuit. | |
#define | Q_FORMAT_ADC (((8-ADC_Q_RESOLUTION)<<8) | ADC_Q_RESOLUTION) |
#define | ADC_VALUE_CONSTANT (10*(2<<(ADC_RESOLUTION-ADC_Q_RESOLUTION-1))) |
Functions | |
void | adc_init (void *handle, uint16_t adc_dummy) |
Initialization of ADC module. More... | |
SensorID_t * | get_adc_sensor_id (uint8_t index) |
Return ID of sensor. More... | |
RecordDescriptor_t | adc_getType () |
Return format specification of this senor. More... | |
SensorValue_t * | get_adc_value () |
Read measured value from ADC. More... | |
void | adc_reset (void) |
Reset ADC peripheral. More... | |
void | adc_doMeasure (void) |
Start the measure procedure in blocking mode. More... | |
uint8_t | adc_count (void) |
Return number of sensors in this peripheral. More... | |
Variables | |
SensorInterface_t | adcSensor |
Interface to ADC sensor. More... | |
volatile RecordDescriptor_t | adcFormatDescriptor |
SensorID_t | adc_sid |
SensorValue_t | adc_data |
SensorInterface_t | adcSensor |
Interface to ADC sensor. More... | |
module for Analog-Digital converter
#define ADC_Q_RESOLUTION 5 |
Precision of converted value.
It will be used in value conversion.
#define ADC_RESOLUTION 12 |
Physically resolution of ADC peripheral.
This value have to be same as a resolution of real ADC.
uint8_t adc_count | ( | void | ) |
Return number of sensors in this peripheral.
void adc_doMeasure | ( | void | ) |
Start the measure procedure in blocking mode.
User this function before read a measured value!
RecordDescriptor_t adc_getType | ( | ) |
Return format specification of this senor.
format | specification |
void adc_init | ( | void * | handle, |
uint16_t | adc_dummy | ||
) |
Initialization of ADC module.
Set-up the parameters of module as a formats, resolution and HW structure.
handle | pointer to initialized ADC_HandleTypeDef structure. In simulation mode use NULL. |
adc_dummy | dummy param, due compatibility. Use DUMMY_VALUE value. |
void adc_reset | ( | void | ) |
Reset ADC peripheral.
Do nothing.
SensorID_t * get_adc_sensor_id | ( | uint8_t | index | ) |
Return ID of sensor.
ID for ADC is hardcoded as 0x0432ADC
index | Not used (due compatibility of other sensors) |
pointer | to SensorID_t structure |
SensorValue_t * get_adc_value | ( | ) |
Read measured value from ADC.
Note, that before this function, have to call measure method.
pointer | to ref{SensorValue_t} that contains measured value |
SensorInterface_t adcSensor |
SensorInterface_t adcSensor |
Interface to ADC sensor.
For details see SensorInterface_t