Implemented first Hangar-Service
Dependencies: CalibrateMagneto QuaternionMath
Fork of SML2 by
Gyroscope.h@5:b9f2f62a8f90, 2015-02-12 (annotated)
- Committer:
- pvaibhav
- Date:
- Thu Feb 12 17:17:35 2015 +0000
- Revision:
- 5:b9f2f62a8f90
- Parent:
- 4:e759b8c756da
- Child:
- 6:c12cea26842d
Gyro data can now be read fine. 100 Hz.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pvaibhav | 4:e759b8c756da | 1 | #ifndef _H_GYROSCOPE_H |
pvaibhav | 4:e759b8c756da | 2 | #define _H_GYROSCOPE_H |
pvaibhav | 4:e759b8c756da | 3 | |
pvaibhav | 4:e759b8c756da | 4 | #include "I2CPeripheral.h" |
pvaibhav | 4:e759b8c756da | 5 | |
pvaibhav | 5:b9f2f62a8f90 | 6 | extern uint32_t ticks; |
pvaibhav | 5:b9f2f62a8f90 | 7 | |
pvaibhav | 5:b9f2f62a8f90 | 8 | typedef struct { |
pvaibhav | 5:b9f2f62a8f90 | 9 | int16_t x; |
pvaibhav | 5:b9f2f62a8f90 | 10 | int16_t y; |
pvaibhav | 5:b9f2f62a8f90 | 11 | int16_t z; |
pvaibhav | 5:b9f2f62a8f90 | 12 | } frame_t; |
pvaibhav | 5:b9f2f62a8f90 | 13 | |
pvaibhav | 5:b9f2f62a8f90 | 14 | extern frame_t frame; |
pvaibhav | 5:b9f2f62a8f90 | 15 | |
pvaibhav | 4:e759b8c756da | 16 | class Gyroscope : public I2CPeripheral { |
pvaibhav | 4:e759b8c756da | 17 | public: |
pvaibhav | 4:e759b8c756da | 18 | Gyroscope(I2C &i2c); |
pvaibhav | 5:b9f2f62a8f90 | 19 | void handleInterrupt(void); |
pvaibhav | 5:b9f2f62a8f90 | 20 | void deepSuspend(); |
pvaibhav | 5:b9f2f62a8f90 | 21 | void powerOn(); |
pvaibhav | 5:b9f2f62a8f90 | 22 | void startDataCapture(); |
pvaibhav | 5:b9f2f62a8f90 | 23 | |
pvaibhav | 5:b9f2f62a8f90 | 24 | protected: |
pvaibhav | 5:b9f2f62a8f90 | 25 | InterruptIn int1; |
pvaibhav | 4:e759b8c756da | 26 | }; |
pvaibhav | 4:e759b8c756da | 27 | |
pvaibhav | 4:e759b8c756da | 28 | #endif//_H_GYROSCOPE_H |