SimpleFOClibrary 2.4.0
Loading...
Searching...
No Matches
GenericSensor.h
Go to the documentation of this file.
1#ifndef GENERIC_SENSOR_LIB_H
2#define GENERIC_SENSOR_LIB_H
3
4#include "Arduino.h"
5#include "../common/foc_utils.h"
6#include "../common/time_utils.h"
7#include "../common/base_classes/Sensor.h"
8
9
10class GenericSensor: public Sensor{
11 public:
12 /**
13 GenericSensor class constructor
14 * @param readCallback pointer to the function reading the sensor angle
15 * @param initCallback pointer to the function initialising the sensor
16 */
17 GenericSensor(float (*readCallback)() = nullptr, void (*initCallback)() = nullptr);
18
19 float (*readCallback)() = nullptr; //!< function pointer to sensor reading
20 void (*initCallback)() = nullptr; //!< function pointer to sensor initialisation
21
22 void init() override;
23
24 // Abstract functions of the Sensor class implementation
25 /** get current angle (rad) */
26 float getSensorAngle() override;
27
28};
29
30
31#endif
void init() override
float getSensorAngle() override
float(* readCallback)()
function pointer to sensor reading
void(* initCallback)()
function pointer to sensor initialisation