A library to read from an Epson IMU
USBIMU.h@1:a2b5b17c949d, 2013-12-13 (annotated)
- Committer:
- GijsB
- Date:
- Fri Dec 13 10:58:02 2013 +0000
- Revision:
- 1:a2b5b17c949d
rsse
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
GijsB | 1:a2b5b17c949d | 1 | #ifndef USBIMU_H |
GijsB | 1:a2b5b17c949d | 2 | #define USBIMU_H |
GijsB | 1:a2b5b17c949d | 3 | |
GijsB | 1:a2b5b17c949d | 4 | #include "mbed.h" |
GijsB | 1:a2b5b17c949d | 5 | #include "USBHostSerial.h" |
GijsB | 1:a2b5b17c949d | 6 | |
GijsB | 1:a2b5b17c949d | 7 | #define TEMP_OUT 0x02 |
GijsB | 1:a2b5b17c949d | 8 | #define XGYRO_OUT 0x04 |
GijsB | 1:a2b5b17c949d | 9 | #define YGYRO_OUT 0x06 |
GijsB | 1:a2b5b17c949d | 10 | #define ZGYRO_OUT 0x08 |
GijsB | 1:a2b5b17c949d | 11 | #define XACCL_OUT 0x0A |
GijsB | 1:a2b5b17c949d | 12 | #define YACCL_OUT 0x0C |
GijsB | 1:a2b5b17c949d | 13 | #define ZACCL_OUT 0x0E |
GijsB | 1:a2b5b17c949d | 14 | |
GijsB | 1:a2b5b17c949d | 15 | #define CR 0x0D |
GijsB | 1:a2b5b17c949d | 16 | |
GijsB | 1:a2b5b17c949d | 17 | |
GijsB | 1:a2b5b17c949d | 18 | class USBIMU { |
GijsB | 1:a2b5b17c949d | 19 | |
GijsB | 1:a2b5b17c949d | 20 | public: |
GijsB | 1:a2b5b17c949d | 21 | USBIMU(); |
GijsB | 1:a2b5b17c949d | 22 | ~USBIMU(); |
GijsB | 1:a2b5b17c949d | 23 | signed int getParam(unsigned char par); |
GijsB | 1:a2b5b17c949d | 24 | float getScaledParam(unsigned char par); |
GijsB | 1:a2b5b17c949d | 25 | bool getFaulty(); |
GijsB | 1:a2b5b17c949d | 26 | |
GijsB | 1:a2b5b17c949d | 27 | |
GijsB | 1:a2b5b17c949d | 28 | private: |
GijsB | 1:a2b5b17c949d | 29 | USBHostSerial *s_; |
GijsB | 1:a2b5b17c949d | 30 | bool faulty; |
GijsB | 1:a2b5b17c949d | 31 | |
GijsB | 1:a2b5b17c949d | 32 | void init(USBHostSerial *s); |
GijsB | 1:a2b5b17c949d | 33 | bool isReady(); |
GijsB | 1:a2b5b17c949d | 34 | bool isFaulty(); |
GijsB | 1:a2b5b17c949d | 35 | void goToStartOfSentence(unsigned char par); |
GijsB | 1:a2b5b17c949d | 36 | |
GijsB | 1:a2b5b17c949d | 37 | |
GijsB | 1:a2b5b17c949d | 38 | }; |
GijsB | 1:a2b5b17c949d | 39 | |
GijsB | 1:a2b5b17c949d | 40 | #endif |