Modified for compatibility with Rev.E. hardware
Fork of AkmSensor by
Diff: ak9752ctrl.h
- Revision:
- 10:5c69b067d88a
- Child:
- 13:d008249f0359
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ak9752ctrl.h Fri Jul 08 22:26:26 2016 +0000 @@ -0,0 +1,52 @@ +#ifndef AK9752CTRL_H +#define AK9752CTRL_H + +#include "mbed.h" +#include "akmsensor.h" +#include "AK9752.h" + +class Ak9752Ctrl : public AkmSensor +{ + +public: + + typedef enum { + SUB_ID_AK9752 = 0x02 + } SubIdAk9752; + + /** + * Constructor. + * + */ + Ak9752Ctrl(); + + /** + * Destructor. + * + */ + virtual ~Ak9752Ctrl(); + 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 AkmSensor::Status requestCommand(Message* in, Message* out); + + void detectINT(); + +private: + bool event; + uint8_t primaryId; + uint8_t subId; + AK9752* ak9752; + InterruptIn* interrupt; + Ticker ticker; + + // hold settings + AK9752::OperationMode mode; + AK9752::FcTmp fc_tmp; + AK9752::FcIr fc_ir; +}; + +#endif