Modified for compatibility with Rev.E. hardware
Fork of AkmSensor by
Diff: akmakd.h
- Revision:
- 24:1d37438f31a9
- Parent:
- 23:50c98b286e41
- Parent:
- 20:2fca76521680
- Child:
- 34:1ea3357c8d9a
--- a/akmakd.h Thu Apr 13 22:15:54 2017 +0000 +++ b/akmakd.h Thu Apr 13 22:50:02 2017 +0000 @@ -6,6 +6,9 @@ #include "akmsensor.h" #include "akmecompass.h" +#define AKDP_MAG_SENSITIVITY (0.15) // [uT/LSB] +#define AKDP_POLLING_FREQUENCY (200.0) // [Hz] + /** * Collection class for handling commands to all of the specialty AKM * daughter board adapter modules. @@ -30,8 +33,15 @@ SUB_ID_AK09916C = 0x0E, /**< AK09916C: ID = 0Eh (14) */ SUB_ID_AK09916D = 0x0F, /**< AK09916D: ID = 0Fh (15) */ SUB_ID_AK09915D = 0x10, /**< AK09915D: ID = 10h (16) */ + SUB_ID_AK09918 = 0x11, /**< AK09918: ID = 11h (17) */ } SubIdAkd; + typedef enum { + INTERRUPT_DISABLED = 0x00, // Polling + INTERRUPT_ENABLED_PP = 0x01, // Push-Pull + INTERRUPT_ENABLED_OD = 0x02, // Open drain + } InterruptMode; + /** * Constructor. * @@ -119,7 +129,9 @@ * For AK8963, returns the type of sensor. */ int getSensorType(); - + InterruptMode getInterrupt(uint8_t primaryId, uint8_t subId); + AkmSensor::Status checkSensor( const uint8_t primaryid, const uint8_t subid, AkmECompass::DeviceId* devid); + private: bool event; uint8_t primaryId; @@ -131,7 +143,7 @@ InterruptIn* drdy; AkmECompass::OperationMode mode; AkmECompass::Nsf nsf; - AkmECompass::Sdr sdr; + AkmECompass::Sdr sdr; }; #endif