Modified for compatibility with Rev.E. hardware
Fork of AkmSensor by
Diff: ak7401ctrl.h
- Revision:
- 10:5c69b067d88a
- Child:
- 13:d008249f0359
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ak7401ctrl.h Fri Jul 08 22:26:26 2016 +0000 @@ -0,0 +1,48 @@ +#ifndef AK7401CTRL_H +#define AK7401CTRL_H + +#include "mbed.h" +#include "SerialNano.h" +#include "akmsensor.h" +#include "ak7401.h" + +class Ak7401Ctrl : public AkmSensor +{ + +public: + + typedef enum { + SUB_ID_AK7401 = 0x02, + } SubIdAngleSensor; + + /** + * Constructor. + * + */ + Ak7401Ctrl(); + + /** + * Destructor. + * + */ + virtual ~Ak7401Ctrl(); + virtual AkmSensor::Status init(const uint8_t id, const uint8_t subid); + virtual bool isEvent(); + virtual AkmSensor::Status startSensor(); + virtual AkmSensor::Status startSensor(const float sec); + virtual AkmSensor::Status stopSensor(); + virtual AkmSensor::Status readSensorData(Message* msg); + virtual Status requestCommand(Message* in, Message* out); + void eventCallback(); + +private: + bool event; + uint8_t primaryId; + uint8_t subId; + + Ticker ticker; + AK7401* ak7401; + float interval; +}; + +#endif