measuringwheel関数がついかされています。
R1370.h@4:ee51008e03e2, 2018-12-18 (annotated)
- Committer:
- UCHITAKE
- Date:
- Tue Dec 18 18:51:58 2018 +0900
- Revision:
- 4:ee51008e03e2
- Parent:
- 1:ec87437c2029
ring buffering
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
UCHITAKE | 0:243364135087 | 1 | #ifndef R1370_H |
UCHITAKE | 0:243364135087 | 2 | #define R1370_H |
UCHITAKE | 0:243364135087 | 3 | |
UCHITAKE | 0:243364135087 | 4 | #include "mbed.h" |
UCHITAKE | 0:243364135087 | 5 | #include <vector> |
UCHITAKE | 0:243364135087 | 6 | |
UCHITAKE | 0:243364135087 | 7 | #define R1370_BUFFER_SIZE 15 |
UCHITAKE | 0:243364135087 | 8 | #define R1370_HEADER0 0xAA |
UCHITAKE | 0:243364135087 | 9 | #define R1370_HEADER1 0x00 |
UCHITAKE | 0:243364135087 | 10 | |
UCHITAKE | 0:243364135087 | 11 | class R1370 : public RawSerial |
UCHITAKE | 0:243364135087 | 12 | { |
UCHITAKE | 0:243364135087 | 13 | public : |
UCHITAKE | 0:243364135087 | 14 | R1370(PinName tx, PinName rx); |
UCHITAKE | 0:243364135087 | 15 | |
UCHITAKE | 0:243364135087 | 16 | float getAngle(); |
UCHITAKE | 0:243364135087 | 17 | float getRate(); |
UCHITAKE | 0:243364135087 | 18 | int16_t getAcc(char l); |
UCHITAKE | 0:243364135087 | 19 | int16_t getAcc(int i); |
UCHITAKE | 0:243364135087 | 20 | int16_t getAccX(); |
UCHITAKE | 0:243364135087 | 21 | int16_t getAccY(); |
UCHITAKE | 0:243364135087 | 22 | int16_t getAccZ(); |
UCHITAKE | 0:243364135087 | 23 | |
tanabe2000 | 1:ec87437c2029 | 24 | unsigned char upbit(); |
tanabe2000 | 1:ec87437c2029 | 25 | unsigned char downbit(); |
tanabe2000 | 1:ec87437c2029 | 26 | |
UCHITAKE | 0:243364135087 | 27 | |
UCHITAKE | 0:243364135087 | 28 | private : |
UCHITAKE | 0:243364135087 | 29 | void receiveByte(); |
UCHITAKE |
4:ee51008e03e2 | 30 | void checkData(); |
UCHITAKE | 0:243364135087 | 31 | void assembleLoop(); |
UCHITAKE | 0:243364135087 | 32 | void assemble(); |
UCHITAKE | 0:243364135087 | 33 | |
UCHITAKE | 0:243364135087 | 34 | uint8_t index; |
UCHITAKE | 0:243364135087 | 35 | int16_t angle; |
UCHITAKE | 0:243364135087 | 36 | int16_t rate; |
UCHITAKE | 0:243364135087 | 37 | int16_t acc[3]; |
UCHITAKE | 0:243364135087 | 38 | uint8_t reserved; |
UCHITAKE |
4:ee51008e03e2 | 39 | uint8_t buffer[R1370_BUFFER_SIZE]; |
UCHITAKE |
4:ee51008e03e2 | 40 | uint8_t data[R1370_BUFFER_SIZE-3]; |
UCHITAKE |
4:ee51008e03e2 | 41 | uint8_t bufferPoint; |
UCHITAKE |
4:ee51008e03e2 | 42 | uint8_t receivedBytes; |
tanabe2000 | 1:ec87437c2029 | 43 | |
tanabe2000 | 1:ec87437c2029 | 44 | unsigned char upbit_, downbit_; |
UCHITAKE | 0:243364135087 | 45 | }; |
UCHITAKE | 0:243364135087 | 46 | |
UCHITAKE |
4:ee51008e03e2 | 47 | #endif |