driver for gyro

Dependencies:   COG4050_ADT7420

Fork of COG4050_adxl355_adxl357-ver2 by ADI_CAC

Revision:
9:1afd906c5ed2
Parent:
6:45d2393ef468
--- a/ADXRS290/ADXRS290.h	Tue Aug 21 13:25:37 2018 +0000
+++ b/ADXRS290/ADXRS290.h	Fri Sep 07 15:49:25 2018 +0000
@@ -5,16 +5,16 @@
 class ADXRS290
 {
 public: 
-    float gyro_sens;  
-    float t_sens;  
+    #define  gyro_sens 0.005; // 200 [LSB/°/s]   
+    #define  t_sens 0.1;      // 10 [LSB/°C]  
     // -------------------------- //
     // REGISTERS                  // 
     // -------------------------- //
     typedef enum {
-        DEVID_AD = 0x00,
-        DEVID_MST = 0x01,
-        PARTID = 0x02,
-        REVID = 0x03,
+        ADI_ID = 0x00,
+        MEMS_ID = 0x01,
+        DEV_ID = 0x02,
+        REV_ID = 0x03,
         SN0 = 0x04,
         SN1 = 0x05,
         SN2 = 0x06,
@@ -72,7 +72,15 @@
         ANAL_SYNC = 0x00,
         DIGI_SYNC = 0x01
     } ADXRS290_dataready_ctl_t;
-    
+    // -------------------------- //
+    // OUTPUT DATA                //
+    // -------------------------- //
+    typedef struct  {
+        float rt_x;
+        float rt_y;
+        float rt_z;
+    } ADXRS290_rate_t;
+    ADXRS290_rate_t rate_data; 
     // -------------------------- //
     // FUNCTIONS                  //  
     // -------------------------- //
@@ -91,10 +99,10 @@
     uint16_t scanx();
     uint16_t scany();
     uint16_t scant();
-    // ADXRS tilt methods and calibration
-    // TBD
+    ADXRS290_rate_t scan();
 private:
     // SPI adxl355;                 ///< SPI instance of the ADXL
+    Timeout conv_time;
     SPI adxrs290; DigitalOut cs;
     const static uint8_t _DEVICE_AD = 0x92;     // contect of DEVID_AD (only-read) register 
     const static uint8_t _DUMMY_BYTE = 0xAA;    // 10101010