MCU
Loading...
Searching...
No Matches
AnalogSensorsInterface.h
Go to the documentation of this file.
1#ifndef __ANALOGSENSOR_H__
2#define __ANALOGSENSOR_H__
3
4#include <tuple>
5#include <algorithm>
6
7#include "SharedDataTypes.h"
8
10{
11public:
12// Data
14// Functions
17 AnalogConversion_s convert();
18};
19
20template <int N>
22{
23public:
24 AnalogConversionPacket_s<N> data;
25// Functions
26
29 const AnalogConversionPacket_s<N>& get()
30 {
31 return data;
32 }
33
35 void convert()
36 {
37 // for (int i = 0; i < N; i++)
38 // {
39 // data.conversions[i] = channels_[i].convert();
40 // }
41 }
42
44 void sample();
45};
46
47#endif /* __ANALOGSENSOR_H__ */
AnalogConversion_s convert()
Calculate sensor output and whether result is in sensor's defined bounds. DOES NOT SAMPLE.
AnalogConversionPacket_s< N > data
void sample()
Commands the underlying device to sample all channels and internally store the results.
const AnalogConversionPacket_s< N > & get()
Used by systems to get data out of this device when it's self-actualizing sampling & conversion.
void convert()
Performs unit conversions on all channels.