simple FS  v0.1.0
Macros | Functions | Variables
module_adc.h File Reference

Module for communication Analog-digital peripheral used on MCU. More...

#include "sensor.h"
#include "simplefs_config.h"
Include dependency graph for module_adc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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_tget_adc_sensor_id (uint8_t index)
 Return ID of sensor. More...
 
RecordDescriptor_t adc_getType ()
 Return format specification of this senor. More...
 
SensorValue_tget_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...
 

Detailed Description

Module for communication Analog-digital peripheral used on MCU.

Date
17. 5. 2021
Author
Juraj Dudak

Supported modes:

Configuration of this module:

#Properties of ADC module

Interface specification:

Example of ADC record format stored in META area:

Sensor ID TYPE META_FORMAT Q_m Q_n
0 .. 7B 8B 9B 10B 11B
0x0ADC043200000000 0x0B 0x41 => FORMAT_META_FMT_Q + FORMAT_META_LENGTH_1B 0x03 0x05