ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
ruuvi_task_adc.h
Go to the documentation of this file.
1 #ifndef RUUVI_TASK_ADC_H
2 #define RUUVI_TASK_ADC_H
3 
55 #include "ruuvi_driver_error.h"
56 #include "ruuvi_driver_sensor.h"
57 #include "ruuvi_interface_log.h"
58 
59 typedef enum
60 {
62  ABSOLUTE
64 
72 
80 
87 bool rt_adc_is_init (void);
88 
107  const uint8_t handle, const rt_adc_mode_t mode);
108 
119 
131 
145 
146 
158 
169 
180 rd_status_t rt_adc_vdd_get (float * const vdd);
181 
195  const uint8_t handle, float * const sample);
196 
212  const uint8_t handle, float * const sample);
214 #endif // TASK_ADC_H
uint32_t rd_status_t
bitfield for representing errors
rd_status_t rt_adc_vdd_get(float *const vdd)
Get VDD.
rd_status_t rt_adc_configure_se(rd_sensor_configuration_t *const config, const uint8_t handle, const rt_adc_mode_t mode)
Configure ADC before sampling.
rd_status_t rt_adc_init(void)
Reserve ADC.
rt_adc_mode_t
rd_status_t rt_adc_absolute_sample(rd_sensor_configuration_t *const configuration, const uint8_t handle, float *const sample)
Get absolute Voltage Sample from selected ADC handle.
rd_status_t rt_adc_vdd_prepare(rd_sensor_configuration_t *const vdd_adc_configuration)
Prepare for sampling VDD.
rd_status_t rt_adc_ratiometric_sample(rd_sensor_configuration_t *const configuration, const uint8_t handle, float *const sample)
Get ratiometric VDD Sample from selected ADC handle.
rd_status_t rt_adc_uninit(void)
Uninitialize ADC to release it for other users.
rd_status_t rt_adc_sample(void)
Take a new sample on ADC configured in single-shot/sleep mode.
rd_status_t rt_adc_ratio_get(rd_sensor_data_t *const data)
Populate data with latest ratiometric value.
bool rt_adc_is_init(void)
Check if ADC is initialized.
rd_status_t rt_adc_voltage_get(rd_sensor_data_t *const data)
Populate data with latest sample.
rd_status_t rt_adc_vdd_sample(void)
Sample VDD.
@ RATIOMETRIC
ADC compares value to VDD.
@ ABSOLUTE
ADC measures absolute voltage in volts.
Ruuvi error codes and error check function.
Ruuvi sensor interface Lifecycle: Beta
All sensors must implement configuration functions which accept this struct.
Generic sensor data struct.