Modified for compatibility with Rev.E. hardware

Fork of AkmSensor by AKM Development Platform

Committer:
masahikofukasawa
Date:
Thu Apr 28 21:12:04 2016 +0000
Revision:
0:7a00359e701e
Child:
10:5c69b067d88a
First commit;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
masahikofukasawa 0:7a00359e701e 1 #ifndef AKMANGLESENSOR_H
masahikofukasawa 0:7a00359e701e 2 #define AKMANGLESENSOR_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 0:7a00359e701e 9 class AkmAngleSensor : 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 0:7a00359e701e 15 // SUB_ID_AK7451 = 0x00, // ????
masahikofukasawa 0:7a00359e701e 16 SUB_ID_AK7451 = 0x01, // ????
masahikofukasawa 0:7a00359e701e 17 } SubIdAngleSensor;
masahikofukasawa 0:7a00359e701e 18
masahikofukasawa 0:7a00359e701e 19 /**
masahikofukasawa 0:7a00359e701e 20 * Constructor.
masahikofukasawa 0:7a00359e701e 21 *
masahikofukasawa 0:7a00359e701e 22 */
masahikofukasawa 0:7a00359e701e 23 AkmAngleSensor();
masahikofukasawa 0:7a00359e701e 24
masahikofukasawa 0:7a00359e701e 25 /**
masahikofukasawa 0:7a00359e701e 26 * Destructor.
masahikofukasawa 0:7a00359e701e 27 *
masahikofukasawa 0:7a00359e701e 28 */
masahikofukasawa 0:7a00359e701e 29 virtual ~AkmAngleSensor();
masahikofukasawa 0:7a00359e701e 30 virtual AkmSensor::Status init(const uint8_t id, const uint8_t subid);
masahikofukasawa 0:7a00359e701e 31 virtual bool isEvent();
masahikofukasawa 0:7a00359e701e 32 virtual AkmSensor::Status startSensor();
masahikofukasawa 0:7a00359e701e 33 virtual AkmSensor::Status startSensor(const float sec);
masahikofukasawa 0:7a00359e701e 34 virtual AkmSensor::Status stopSensor();
masahikofukasawa 0:7a00359e701e 35 virtual AkmSensor::Status readSensorData(Message* msg);
masahikofukasawa 0:7a00359e701e 36 virtual Status requestCommand(Message* in, Message* out);
masahikofukasawa 0:7a00359e701e 37 void eventCallback();
masahikofukasawa 0:7a00359e701e 38
masahikofukasawa 0:7a00359e701e 39 private:
masahikofukasawa 0:7a00359e701e 40 bool event;
masahikofukasawa 0:7a00359e701e 41 uint8_t primaryId;
masahikofukasawa 0:7a00359e701e 42 uint8_t subId;
masahikofukasawa 0:7a00359e701e 43
masahikofukasawa 0:7a00359e701e 44 Ticker ticker;
masahikofukasawa 0:7a00359e701e 45 AK7451* ak7451;
masahikofukasawa 0:7a00359e701e 46 float interval;
masahikofukasawa 0:7a00359e701e 47 // char latest_angle_data[2];
masahikofukasawa 0:7a00359e701e 48 };
masahikofukasawa 0:7a00359e701e 49
masahikofukasawa 0:7a00359e701e 50 #endif