Modified for compatibility with Rev.E. hardware
Fork of AkmSensor by
ak7451ctrl.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:
- 34:1ea3357c8d9a
Modified for multi sensor demo.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
masahikofukasawa | 11:cef8dc1cf010 | 1 | #ifndef AK7451CTRL_H |
masahikofukasawa | 11:cef8dc1cf010 | 2 | #define AK7451CTRL_H |
masahikofukasawa | 0:7a00359e701e | 3 | |
masahikofukasawa | 0:7a00359e701e | 4 | #include "mbed.h" |
masahikofukasawa | 0:7a00359e701e | 5 | #include "SerialNano.h" |
masahikofukasawa | 0:7a00359e701e | 6 | #include "akmsensor.h" |
masahikofukasawa | 0:7a00359e701e | 7 | #include "ak7451.h" |
masahikofukasawa | 0:7a00359e701e | 8 | |
masahikofukasawa | 11:cef8dc1cf010 | 9 | class Ak7451Ctrl : public AkmSensor |
masahikofukasawa | 0:7a00359e701e | 10 | { |
masahikofukasawa | 0:7a00359e701e | 11 | |
masahikofukasawa | 0:7a00359e701e | 12 | public: |
masahikofukasawa | 29:b488d2c89fba | 13 | |
masahikofukasawa | 29:b488d2c89fba | 14 | typedef AkmSensor base; |
masahikofukasawa | 0:7a00359e701e | 15 | |
masahikofukasawa | 0:7a00359e701e | 16 | typedef enum { |
masahikofukasawa | 10:5c69b067d88a | 17 | SUB_ID_AK7451 = 0x01, |
masahikofukasawa | 0:7a00359e701e | 18 | } SubIdAngleSensor; |
masahikofukasawa | 0:7a00359e701e | 19 | |
masahikofukasawa | 0:7a00359e701e | 20 | /** |
masahikofukasawa | 0:7a00359e701e | 21 | * Constructor. |
masahikofukasawa | 0:7a00359e701e | 22 | * |
masahikofukasawa | 0:7a00359e701e | 23 | */ |
masahikofukasawa | 11:cef8dc1cf010 | 24 | Ak7451Ctrl(); |
masahikofukasawa | 0:7a00359e701e | 25 | |
masahikofukasawa | 0:7a00359e701e | 26 | /** |
masahikofukasawa | 0:7a00359e701e | 27 | * Destructor. |
masahikofukasawa | 0:7a00359e701e | 28 | * |
masahikofukasawa | 0:7a00359e701e | 29 | */ |
masahikofukasawa | 11:cef8dc1cf010 | 30 | virtual ~Ak7451Ctrl(); |
masahikofukasawa | 0:7a00359e701e | 31 | virtual AkmSensor::Status init(const uint8_t id, const uint8_t subid); |
masahikofukasawa | 0:7a00359e701e | 32 | virtual AkmSensor::Status startSensor(); |
masahikofukasawa | 0:7a00359e701e | 33 | virtual AkmSensor::Status startSensor(const float sec); |
masahikofukasawa | 0:7a00359e701e | 34 | virtual AkmSensor::Status stopSensor(); |
masahikofukasawa | 0:7a00359e701e | 35 | virtual AkmSensor::Status readSensorData(Message* msg); |
masahikofukasawa | 0:7a00359e701e | 36 | virtual Status requestCommand(Message* in, Message* out); |
masahikofukasawa | 13:d008249f0359 | 37 | |
masahikofukasawa | 0:7a00359e701e | 38 | private: |
masahikofukasawa | 0:7a00359e701e | 39 | Ticker ticker; |
masahikofukasawa | 0:7a00359e701e | 40 | AK7451* ak7451; |
masahikofukasawa | 0:7a00359e701e | 41 | float interval; |
masahikofukasawa | 0:7a00359e701e | 42 | }; |
masahikofukasawa | 0:7a00359e701e | 43 | |
masahikofukasawa | 0:7a00359e701e | 44 | #endif |