Modified for compatibility with Rev.E. hardware
Fork of AkmSensor by
ak9750ctrl.h@29:b488d2c89fba, 2017-03-17 (annotated)
- Committer:
- masahikofukasawa
- Date:
- Fri Mar 17 23:29:20 2017 +0000
- Revision:
- 29:b488d2c89fba
- Parent:
- 27:41aa9fb23a2f
- Child:
- 30:5a241d9b3262
Modified for multi sensor demo.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
masahikofukasawa | 10:5c69b067d88a | 1 | #ifndef AK9750CTRL_H |
masahikofukasawa | 10:5c69b067d88a | 2 | #define AK9750CTRL_H |
masahikofukasawa | 10:5c69b067d88a | 3 | |
masahikofukasawa | 10:5c69b067d88a | 4 | #include "mbed.h" |
masahikofukasawa | 10:5c69b067d88a | 5 | #include "akmsensor.h" |
masahikofukasawa | 10:5c69b067d88a | 6 | #include "AK9750.h" |
masahikofukasawa | 10:5c69b067d88a | 7 | |
masahikofukasawa | 10:5c69b067d88a | 8 | class Ak9750Ctrl : public AkmSensor |
masahikofukasawa | 10:5c69b067d88a | 9 | { |
masahikofukasawa | 10:5c69b067d88a | 10 | |
masahikofukasawa | 10:5c69b067d88a | 11 | public: |
masahikofukasawa | 29:b488d2c89fba | 12 | |
masahikofukasawa | 29:b488d2c89fba | 13 | typedef AkmSensor base; |
masahikofukasawa | 10:5c69b067d88a | 14 | |
masahikofukasawa | 10:5c69b067d88a | 15 | typedef enum { |
masahikofukasawa | 13:d008249f0359 | 16 | SUB_ID_AK9750 = 0x01, |
masahikofukasawa | 13:d008249f0359 | 17 | SUB_ID_AK9753 = 0x03, |
masahikofukasawa | 10:5c69b067d88a | 18 | } SubIdIrSensor; |
masahikofukasawa | 10:5c69b067d88a | 19 | |
masahikofukasawa | 10:5c69b067d88a | 20 | /** |
masahikofukasawa | 10:5c69b067d88a | 21 | * Constructor. |
masahikofukasawa | 10:5c69b067d88a | 22 | * |
masahikofukasawa | 10:5c69b067d88a | 23 | */ |
masahikofukasawa | 10:5c69b067d88a | 24 | Ak9750Ctrl(); |
masahikofukasawa | 10:5c69b067d88a | 25 | |
masahikofukasawa | 10:5c69b067d88a | 26 | /** |
masahikofukasawa | 10:5c69b067d88a | 27 | * Destructor. |
masahikofukasawa | 10:5c69b067d88a | 28 | * |
masahikofukasawa | 10:5c69b067d88a | 29 | */ |
masahikofukasawa | 10:5c69b067d88a | 30 | virtual ~Ak9750Ctrl(); |
masahikofukasawa | 10:5c69b067d88a | 31 | virtual AkmSensor::Status init(const uint8_t id, const uint8_t subid); |
masahikofukasawa | 10:5c69b067d88a | 32 | virtual AkmSensor::Status startSensor(); |
masahikofukasawa | 10:5c69b067d88a | 33 | virtual AkmSensor::Status startSensor(const float sec); |
masahikofukasawa | 10:5c69b067d88a | 34 | virtual AkmSensor::Status stopSensor(); |
masahikofukasawa | 10:5c69b067d88a | 35 | virtual AkmSensor::Status readSensorData(Message* msg); |
masahikofukasawa | 10:5c69b067d88a | 36 | virtual AkmSensor::Status requestCommand(Message* in, Message* out); |
masahikofukasawa | 29:b488d2c89fba | 37 | virtual void setEvent(); |
masahikofukasawa | 10:5c69b067d88a | 38 | |
masahikofukasawa | 10:5c69b067d88a | 39 | private: |
masahikofukasawa | 10:5c69b067d88a | 40 | AK9750* ak9750; |
masahikofukasawa | 29:b488d2c89fba | 41 | // InterruptIn* interrupt; |
masahikofukasawa | 10:5c69b067d88a | 42 | Ticker ticker; |
masahikofukasawa | 10:5c69b067d88a | 43 | |
masahikofukasawa | 10:5c69b067d88a | 44 | // hold settings |
masahikofukasawa | 10:5c69b067d88a | 45 | AK9750::OperationMode mode; |
masahikofukasawa | 10:5c69b067d88a | 46 | AK9750::DigitalFilter filter; |
masahikofukasawa | 10:5c69b067d88a | 47 | }; |
masahikofukasawa | 10:5c69b067d88a | 48 | |
masahikofukasawa | 10:5c69b067d88a | 49 | #endif |