Modified for compatibility with Rev.E. hardware

Fork of AkmSensor by AKM Development Platform

Committer:
masahikofukasawa
Date:
Sat Mar 11 01:14:15 2017 +0000
Revision:
27:41aa9fb23a2f
Parent:
13:d008249f0359
Child:
29:b488d2c89fba
modified for multi sensor demo

Who changed what in which revision?

UserRevisionLine numberNew contents of line
masahikofukasawa 11:cef8dc1cf010 1 #ifndef AK7451CTRL_H
masahikofukasawa 11:cef8dc1cf010 2 #define AK7451CTRL_H
masahikofukasawa 0:7a00359e701e 3
masahikofukasawa 0:7a00359e701e 4 #include "mbed.h"
masahikofukasawa 0:7a00359e701e 5 #include "SerialNano.h"
masahikofukasawa 0:7a00359e701e 6 #include "akmsensor.h"
masahikofukasawa 0:7a00359e701e 7 #include "ak7451.h"
masahikofukasawa 0:7a00359e701e 8
masahikofukasawa 11:cef8dc1cf010 9 class Ak7451Ctrl : public AkmSensor
masahikofukasawa 0:7a00359e701e 10 {
masahikofukasawa 0:7a00359e701e 11
masahikofukasawa 0:7a00359e701e 12 public:
masahikofukasawa 0:7a00359e701e 13
masahikofukasawa 0:7a00359e701e 14 typedef enum {
masahikofukasawa 10:5c69b067d88a 15 SUB_ID_AK7451 = 0x01,
masahikofukasawa 0:7a00359e701e 16 } SubIdAngleSensor;
masahikofukasawa 0:7a00359e701e 17
masahikofukasawa 0:7a00359e701e 18 /**
masahikofukasawa 0:7a00359e701e 19 * Constructor.
masahikofukasawa 0:7a00359e701e 20 *
masahikofukasawa 0:7a00359e701e 21 */
masahikofukasawa 11:cef8dc1cf010 22 Ak7451Ctrl();
masahikofukasawa 0:7a00359e701e 23
masahikofukasawa 0:7a00359e701e 24 /**
masahikofukasawa 0:7a00359e701e 25 * Destructor.
masahikofukasawa 0:7a00359e701e 26 *
masahikofukasawa 0:7a00359e701e 27 */
masahikofukasawa 11:cef8dc1cf010 28 virtual ~Ak7451Ctrl();
masahikofukasawa 0:7a00359e701e 29 virtual AkmSensor::Status init(const uint8_t id, const uint8_t subid);
masahikofukasawa 0:7a00359e701e 30 virtual AkmSensor::Status startSensor();
masahikofukasawa 0:7a00359e701e 31 virtual AkmSensor::Status startSensor(const float sec);
masahikofukasawa 0:7a00359e701e 32 virtual AkmSensor::Status stopSensor();
masahikofukasawa 0:7a00359e701e 33 virtual AkmSensor::Status readSensorData(Message* msg);
masahikofukasawa 0:7a00359e701e 34 virtual Status requestCommand(Message* in, Message* out);
masahikofukasawa 13:d008249f0359 35
masahikofukasawa 0:7a00359e701e 36 void eventCallback();
masahikofukasawa 0:7a00359e701e 37
masahikofukasawa 0:7a00359e701e 38 private:
masahikofukasawa 0:7a00359e701e 39 Ticker ticker;
masahikofukasawa 0:7a00359e701e 40 AK7451* ak7451;
masahikofukasawa 0:7a00359e701e 41 float interval;
masahikofukasawa 0:7a00359e701e 42 };
masahikofukasawa 0:7a00359e701e 43
masahikofukasawa 0:7a00359e701e 44 #endif