Modified for compatibility with Rev.E. hardware
Fork of AkmSensor by
akmhallswitch.h
- Committer:
- masahikofukasawa
- Date:
- 2017-03-17
- Revision:
- 29:b488d2c89fba
- Parent:
- 27:41aa9fb23a2f
- Child:
- 34:1ea3357c8d9a
File content as of revision 29:b488d2c89fba:
#ifndef AKMHALLSWITCH_H #define AKMHALLSWITCH_H #include "mbed.h" #include "SerialNano.h" #include "akmsensor.h" class AkmHallSwitch : public AkmSensor { public: typedef AkmSensor base; typedef enum { SUB_ID_EM1771 = 0x01, SUB_ID_EW453 = 0x03, SUB_ID_EW652B = 0x0C, SUB_ID_EW6672 = 0x0D, } SubIdUnipolarSwitch; typedef enum { SUB_ID_EM1781 = 0x03, SUB_ID_AK8788A = 0x04, SUB_ID_EM6781 = 0x05, } SubIdOmnipolarSwitch; typedef enum { SUB_ID_AK8771 = 0x01, SUB_ID_EZ470 = 0x03, SUB_ID_EZ471 = 0x04, SUB_ID_EW432 = 0x08, SUB_ID_EW612B = 0x0C, SUB_ID_EW632 = 0x0D, } SubIdBipolarLatch; typedef enum { SUB_ID_AK8789 = 0x03, SUB_ID_EM1791 = 0x04, } SubIdDualSwitch; typedef enum { SUB_ID_AK8775 = 0x01, SUB_ID_AK8779A = 0x0B, SUB_ID_AK8779B = 0x0C, SUB_ID_AK8776 = 0x0F, } SubIdOnechipEncoder; /** * Constructor. * */ AkmHallSwitch(); /** * Destructor. * */ virtual ~AkmHallSwitch(); virtual AkmSensor::Status init(const uint8_t id, const uint8_t subid); 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 riseEventD0(); void fallEventD0(); void riseEventD1(); void fallEventD1(); private: uint8_t d0; uint8_t d1; InterruptIn* sw0; InterruptIn* sw1; }; #endif