Modified for compatibility with Rev.E. hardware
Fork of AkmSensor by
akmhallswitch.h
- Committer:
- masahikofukasawa
- Date:
- 2016-05-13
- Revision:
- 6:c4401549d68f
- Parent:
- 0:7a00359e701e
- Child:
- 13:d008249f0359
File content as of revision 6:c4401549d68f:
#ifndef AKMHALLSWITCH_H #define AKMHALLSWITCH_H #include "mbed.h" #include "SerialNano.h" #include "akmsensor.h" class AkmHallSwitch : public AkmSensor { public: typedef enum { SUB_ID_EM1771 = 0x00, SUB_ID_EW453 = 0x03, SUB_ID_EW652B = 0x0C, SUB_ID_EW6672 = 0x0D, } SubIdUnipolarSwitch; typedef enum { SUB_ID_EM1781 = 0x00, SUB_ID_AK8788A = 0x03, SUB_ID_EM6781 = 0x0C, } SubIdOmnipolarSwitch; typedef enum { SUB_ID_AK8771 = 0x00, 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_AK8776 = 0x00, SUB_ID_AK8775 = 0x01, SUB_ID_AK8779A = 0x0B, SUB_ID_AK8779B = 0x0C, } SubIdOnechipEncoder; /** * Constructor. * */ AkmHallSwitch(); /** * Destructor. * */ virtual ~AkmHallSwitch(); 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 riseEventD0(); void fallEventD0(); void riseEventD1(); void fallEventD1(); private: bool event; uint8_t primaryId; uint8_t subId; uint8_t d0; uint8_t d1; InterruptIn* sw0; InterruptIn* sw1; }; #endif