Modified for compatibility with Rev.E. hardware
Fork of AkmSensor by
akmakd.h
- Committer:
- masahikofukasawa
- Date:
- 2016-07-08
- Revision:
- 10:5c69b067d88a
- Parent:
- 9:6fa3e7b17c27
- Child:
- 13:d008249f0359
File content as of revision 10:5c69b067d88a:
#ifndef AKMAKD_H #define AKMAKD_H #include "mbed.h" #include "SerialNano.h" #include "akmsensor.h" #include "akmecompass.h" class AkmAkd : public AkmSensor { public: // SUB ID typedef enum { // 5bit ID SUB_ID_AK8963N = 0x1A, // 26 SUB_ID_AK8963C = 0x1C, // 28 SUB_ID_AK09911C = 0x0A, // 10 SUB_ID_AK09912C = 0x09, // 9 SUB_ID_AK09915C = 0x0D, // 13 SUB_ID_AK09916C = 0x0E, // 14 SUB_ID_AK09916D = 0x0F, // 15 SUB_ID_AK09915D = 0x10, // 16 } SubIdAkd; /** * Constructor. * */ AkmAkd(); /** * Destructor. * */ virtual ~AkmAkd(); 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 checkDRDY(); void detectDRDY(); int getSensorType(); char* getSensorName(); private: bool event; uint8_t primaryId; uint8_t subId; Ticker ticker; AkmECompass* compass; InterruptIn* drdy; AkmECompass::OperationMode mode; AkmECompass::Nsf nsf; AkmECompass::Sdr sdr; char* sensorName; }; #endif