Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef __L3G4200D_H__
- #define __L3G4200D_H__
- #include "stm32f10x.h"
- #define GYRO_REG_ID 0x0F
- #define GYRO_ID_VAL 0xD3
- #define GYRO_REG_CTRL_1 0x20
- #define GYRO_REG_CTRL_2 0x21
- #define GYRO_REG_CTRL_3 0x22
- #define GYRO_REG_CTRL_4 0x23
- #define GYRO_REG_CTRL_5 0x24
- #define GYRO_REG_STATUS 0x27
- #define GYRO_REG_OUT_X_H 0x29
- #define GYRO_REG_OUT_X_L 0x28
- #define GYRO_REG_OUT_Y_H 0x2B
- #define GYRO_REG_OUT_Y_L 0x2A
- #define GYRO_REG_OUT_Z_H 0x2D
- #define GYRO_REG_OUT_Z_L 0x2C
- #define GYRO_REG_OUT_TEMP 0x26
- #define GYRO_REG_FIFO_CNTRL 0x2E
- #define GYRO_REG_FIFO_SRC 0x2F
- ///////////////////////////////////////////////////////////////////////////////
- #define GYRO_ZYXEN 0x07
- #define GYRO_PWRON 0x08
- // 800 hz data rate with custom cut-offs (30,35,50,110)
- #define GYRO_ODR800C30 0xC0
- #define GYRO_ODR800C35 0xD0
- #define GYRO_ODR800C50 0xE0
- #define GYRO_ODR800C110 0xF0
- // 400 hz
- #define GYRO_ODR400C25 0x90
- ///////////////////////////////////////////////////////////////////////////////
- #define GYRO_HPCOFF15 0x22
- #define GYRO_HPCOFF30 0x21
- #define GYRO_HPCOFF56 0x20
- ///////////////////////////////////////////////////////////////////////////////
- #define GYRO_DRDYINT 0x08
- ///////////////////////////////////////////////////////////////////////////////
- #define GYRO_BDU 0x80
- #define GYRO_BIGENDIAN 0x40
- #define GYRO_FS250 0x00
- #define GYRO_FS500 0x10
- #define GYRO_FS2000 0x20
- ///////////////////////////////////////////////////////////////////////////////
- #define GYRO_REBOOTMEM 0x80
- #define GYRO_FIFOEN 0x40
- #define GYRO_HPEN 0x10
- ///////////////////////////////////////////////////////////////////////////////
- #define GYRO_ZYXDA 0x08
- #define GYRO_TEMPCORR_X 0.0042
- #define GYRO_TEMPCORR_Y 0.0091
- #define GYRO_TEMPCORR_Z 0.0038
- struct gyroData
- {
- uint16_t dataX;
- uint16_t dataY;
- uint16_t dataZ;
- };
- void l3g4200d_init();
- gyroData gyroReadData();
- int8_t gyroReadTemp();
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement