Revision b4885314 include/amiro/gyro/l3g4200d.hpp

View differences:

include/amiro/gyro/l3g4200d.hpp
15 15
    DR_200_HZ   = 0x40,
16 16
    DR_400_HZ   = 0x80,
17 17
    DR_800_HZ   = 0xC0,
18
    DR_MASK     = 0xC0,
18 19
  };
19 20
  enum {
20 21
    BW_12_5  = 0x00,
......
25 26
    BW_50    = 0x20,
26 27
    BW_70    = 0x30,
27 28
    BW_110   = 0x30,
29
    BW_MASK  = 0x30,
28 30
  };
29 31
  enum {
30
    PD  = 0x08,
31
    ZEN = 0x04,
32
    YEN = 0x02,
33
    XEN = 0x01,
32
    PD       = 0x08,
33
    ZEN      = 0x04,
34
    YEN      = 0x02,
35
    XEN      = 0x01,
36
    EN_MASK  = 0x0F,
34 37
  };
35 38
  enum {
36 39
    HPM_NORMAL_RST = 0x00,
......
73 76
    ST_EN       = 0x02,
74 77
    SIM_3W      = 0x01,
75 78
    SIM_4W      = 0x00,
79
    FS_MASK     = 0x20,
76 80
  };
77 81
  enum {
78 82
    BOOT          = 0x80,
......
224 228
  chibios_rt::EvtSource* getEventSource();
225 229
  msg_t configure(const L3G4200DConfig* config);
226 230
  int16_t angularRate[AXIS_Z - AXIS_X + 1];
231
  int32_t angular[AXIS_Z - AXIS_X + 1];
227 232

  
228 233
  int16_t getAngularRate(const uint8_t axis);
234
  
235
  int32_t getAngularRate_udps(const uint8_t axis);
236
  int32_t getAngular(const uint8_t axis);
237
  int32_t getAngular_ud(const uint8_t axis);
238
  void angularReset();
229 239

  
230 240

  
231 241
  /**
......
240 250

  
241 251
 private:
242 252
  inline void updateSensorData();
253
  inline void calcAngular();
243 254

  
244 255
 private:
245 256

  
246 257
  HWSPIDriver* driver;
247 258
  chibios_rt::EvtSource eventSource;
259
  uint32_t integrationTic;
260
  uint32_t udpsPerTic; // Resolution: Micro-degree-per-second per digit
261
  uint32_t period_us;
262
  uint32_t period_ms;
263
  systime_t period_st;
248 264

  
249 265
};
250 266

  

Also available in: Unified diff