28 #include <mraa/firmata.h>
57 #define FIRMATA_START_SYSEX 0xF0
58 #define FIRMATA_END_SYSEX 0xF7
59 #define FIRMATA_CURIE_IMU 0x11
60 #define FIRMATA_CURIE_IMU_READ_ACCEL 0x00
61 #define FIRMATA_CURIE_IMU_READ_GYRO 0x01
62 #define FIRMATA_CURIE_IMU_READ_TEMP 0x02
63 #define FIRMATA_CURIE_IMU_SHOCK_DETECT 0x03
64 #define FIRMATA_CURIE_IMU_STEP_COUNTER 0x04
65 #define FIRMATA_CURIE_IMU_TAP_DETECT 0x05
66 #define FIRMATA_CURIE_IMU_READ_MOTION 0x06
85 CurieImu (
int subplatform_offset=512);
290 mraa_firmata_context m_firmata;
291 pthread_mutex_t m_responseLock;
292 pthread_cond_t m_responseCond;
295 std::queue<IMUDataItem*> m_shockData;
296 std::queue<int> m_stepData;
297 std::queue<IMUDataItem*> m_tapData;
int16_t * getGyro()
Definition: curieimu.cpp:183
void lock()
Definition: curieimu.cpp:70
void setResults(uint8_t *buf, int length)
Definition: curieimu.cpp:95
void updateMotion()
Definition: curieimu.cpp:267
void processResponse()
Definition: curieimu.cpp:128
bool isStepDetected()
Definition: curieimu.cpp:404
int16_t getStepCount()
Definition: curieimu.cpp:410
void proceed()
Definition: curieimu.cpp:89
bool isTapDetected()
Definition: curieimu.cpp:443
bool isShockDetected()
Definition: curieimu.cpp:364
void enableStepCounter(bool enable)
Definition: curieimu.cpp:382
int16_t getAccelY()
Definition: curieimu.cpp:171
int16_t getAccelX()
Definition: curieimu.cpp:165
void enableShockDetection(bool enable)
Definition: curieimu.cpp:342
CurieImu(int subplatform_offset=512)
Definition: curieimu.cpp:41
int16_t getTemperature()
Definition: curieimu.cpp:303
void waitForResponse()
Definition: curieimu.cpp:82
Definition: curieimu.hpp:72
void unlock()
Definition: curieimu.cpp:76
int16_t * getAccel()
Definition: curieimu.cpp:159
void updateAccel()
Definition: curieimu.cpp:213
~CurieImu()
Definition: curieimu.cpp:63
void updateGyro()
Definition: curieimu.cpp:240
void getNextTap()
Definition: curieimu.cpp:449
int16_t getDirection()
Definition: curieimu.cpp:336
int16_t getAxis()
Definition: curieimu.cpp:330
void enableTapDetection(bool enable)
Definition: curieimu.cpp:421
int16_t getGyroY()
Definition: curieimu.cpp:195
Definition: curieimu.hpp:77
int16_t getGyroX()
Definition: curieimu.cpp:189
void getNextShock()
Definition: curieimu.cpp:370
int16_t getGyroZ()
Definition: curieimu.cpp:201
int16_t * getMotion()
Definition: curieimu.cpp:207
int16_t getAccelZ()
Definition: curieimu.cpp:177