First draft HMC5883 magnetometer sensor using physical quantities, outputting via serial port using std::cout on mbed os 5
Diff: Sensor.h
- Revision:
- 3:2834be4e10ef
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sensor.h Tue Mar 24 22:43:44 2020 +0000 @@ -0,0 +1,24 @@ +#ifndef SKYSCRAPER_MBED_SENSOR_H_INCLUDED +#define SKYSCRAPER_MBED_SENSOR_H_INCLUDED + + namespace detail{ + template <typename Quantity> + struct SensorBackEnd; + } + + template <typename Quantity> + struct Sensor{ + + static bool open(Sensor& sensor, const char* name); + bool connected()const; + bool running() const; + bool idle() const + void close(); + bool read(Quantity & q)const; + bool setUpdateCallback(void(*pFun)(Sensor & )); + + private : + SensorBackEnd<Quantity> * m_device; + }; + +#endif \ No newline at end of file