Linux: connected gyrosim to Simulator

Simulator gets incoming MPU data and gives raw MPU data to the
gyrosim sensor when read.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-04-20 11:37:50 -07:00
parent facc2faf04
commit 89bc1b86b2
3 changed files with 99 additions and 233 deletions
+18 -1
View File
@@ -60,7 +60,7 @@ public:
static int start(int argc, char *argv[]);
int getSample(sim_dev_t dev, sample &val);
bool getMPUReport(uint8_t *buf, int len);
private:
Simulator();
~Simulator() { _instance=NULL; }
@@ -82,5 +82,22 @@ private:
sem_t _lock;
const int _max_readers;
#pragma pack(push, 1)
/**
* Report conversation within the GYROSIM, including command byte and
* interrupt status.
*/
struct MPUReport {
uint8_t accel_x[2];
uint8_t accel_y[2];
uint8_t accel_z[2];
uint8_t temp[2];
uint8_t gyro_x[2];
uint8_t gyro_y[2];
uint8_t gyro_z[2];
};
#pragma pack(pop)
MPUReport _mpureport[2];
};