LSM303DLHC Full Driver: Readings For Acc, Mag and Temp; Class Method for frequently-used 13 sensor parameters; Class Method to direct modify registers; Support Calibration (offset+scale);
LSM303DLHC_REG.h@3:522d01930e6a, 2016-06-07 (annotated)
- Committer:
- Airium
- Date:
- Tue Jun 07 15:18:48 2016 +0000
- Revision:
- 3:522d01930e6a
Add Compact User Instruction in header; Some names changed for convenience; Reg addrs defined in a separate header; if no bug this shall be the final version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Airium | 3:522d01930e6a | 1 | #ifndef LSM303DLHC_REG_H |
Airium | 3:522d01930e6a | 2 | #define LSM303DLHC_REG_H |
Airium | 3:522d01930e6a | 3 | |
Airium | 3:522d01930e6a | 4 | // ACC SAD |
Airium | 3:522d01930e6a | 5 | #define ACC_ADDRESS 0x32 |
Airium | 3:522d01930e6a | 6 | // ACC CTRL SUB |
Airium | 3:522d01930e6a | 7 | #define CTRL_REG1_A 0x20 //RW ODR(4) LPen Zen Yen Xen |
Airium | 3:522d01930e6a | 8 | #define CTRL_REG2_A 0x21 //RW HPM(2) HPCF(2) FDS HPCLICK HPIS2 HPIS1 |
Airium | 3:522d01930e6a | 9 | #define CTRL_REG3_A 0x22 //RW I1_CLICK I1_AOI1 I1_AOI2 I1_DRDY1 I1_DRDY2 I1_WTM I1_OVERRUN - |
Airium | 3:522d01930e6a | 10 | #define CTRL_REG4_A 0x23 //RW BDU BLE FS1 FS0 HR 0(2) SIM |
Airium | 3:522d01930e6a | 11 | #define CTRL_REG5_A 0x24 //RW BOOT FIFO_EN - - LIR_INT1 D4D_INT1 LIR_INT2 D4D_INT2 |
Airium | 3:522d01930e6a | 12 | #define CTRL_REG6_A 0x25 //RW I2_CLICKen I2_INT1 I2_INT2 BOOT_I1 P2_ACT - H_LACTIVE - |
Airium | 3:522d01930e6a | 13 | #define REFERENCE_A 0x26 //RW Ref7 Ref6 Ref5 Ref4 Ref3 Ref2 Ref1 Ref0 |
Airium | 3:522d01930e6a | 14 | #define STATUS_REG_A 0x27 //R ZYXOR ZOR YOR XOR ZYXDA ZDA YDA XDA |
Airium | 3:522d01930e6a | 15 | // ACC OUT SUB |
Airium | 3:522d01930e6a | 16 | #define OUT_X_L_A 0x28 //R MSB(8) |
Airium | 3:522d01930e6a | 17 | #define OUT_X_H_A 0x29 //R LSB(4) 0(4) |
Airium | 3:522d01930e6a | 18 | #define OUT_Y_L_A 0x2A //R ditto |
Airium | 3:522d01930e6a | 19 | #define OUT_Y_H_A 0x2B //R ditto |
Airium | 3:522d01930e6a | 20 | #define OUT_Z_L_A 0x2C //R ditto |
Airium | 3:522d01930e6a | 21 | #define OUT_Z_H_A 0x2D //R ditto |
Airium | 3:522d01930e6a | 22 | // ACC INT SUB |
Airium | 3:522d01930e6a | 23 | #define INT1_CFG_A 0x30 |
Airium | 3:522d01930e6a | 24 | #define INT1_SRC_A 0x31 |
Airium | 3:522d01930e6a | 25 | #define INT1_THS_A 0x32 |
Airium | 3:522d01930e6a | 26 | #define INT1_DURATION_A 0x33 |
Airium | 3:522d01930e6a | 27 | #define INT2_CFG_A 0x34 |
Airium | 3:522d01930e6a | 28 | #define INT2_SRC_A 0x35 |
Airium | 3:522d01930e6a | 29 | #define INT2_THS_A 0x36 |
Airium | 3:522d01930e6a | 30 | #define INT2_DURATION_A 0x37 |
Airium | 3:522d01930e6a | 31 | // ACC CLICK SUB |
Airium | 3:522d01930e6a | 32 | #define CLICK_CFG_A 0x38 |
Airium | 3:522d01930e6a | 33 | #define CLICK_SRC_A 0x39 |
Airium | 3:522d01930e6a | 34 | #define CLICK_THS_A 0x3A |
Airium | 3:522d01930e6a | 35 | #define TIME_LIMIT_A 0x3B |
Airium | 3:522d01930e6a | 36 | #define TIME_LATENCY_A 0x3C |
Airium | 3:522d01930e6a | 37 | #define TIME_WINDOW_A 0x3D |
Airium | 3:522d01930e6a | 38 | |
Airium | 3:522d01930e6a | 39 | // MAG SAD |
Airium | 3:522d01930e6a | 40 | #define MAG_ADDRESS 0x3C |
Airium | 3:522d01930e6a | 41 | // MAG CTRL SUB |
Airium | 3:522d01930e6a | 42 | #define CRA_REG_M 0x00 //RW TEMP_EN 0(2) DR(3) 0(2) |
Airium | 3:522d01930e6a | 43 | #define CRB_REG_M 0x01 //RW GN(3) 0(5) |
Airium | 3:522d01930e6a | 44 | #define MR_REG_M 0x02 //RW 0(6) MD(2) |
Airium | 3:522d01930e6a | 45 | // MAG OUT SUB |
Airium | 3:522d01930e6a | 46 | #define OUT_X_H_M 0x03 //R LSB(8) |
Airium | 3:522d01930e6a | 47 | #define OUT_X_L_M 0x04 //R 0(4) MSB(4) |
Airium | 3:522d01930e6a | 48 | #define OUT_Z_H_M 0x05 //R ditto |
Airium | 3:522d01930e6a | 49 | #define OUT_Z_L_M 0x06 //R ditto |
Airium | 3:522d01930e6a | 50 | #define OUT_Y_H_M 0x07 //R ditto |
Airium | 3:522d01930e6a | 51 | #define OUT_Y_L_M 0x08 //R ditto |
Airium | 3:522d01930e6a | 52 | #define SR_REG_M 0x09 //R -(6) LOCK DRDY |
Airium | 3:522d01930e6a | 53 | #define IRA_REG_M 0x0A //R |
Airium | 3:522d01930e6a | 54 | #define IRB_REG_M 0x0B //R |
Airium | 3:522d01930e6a | 55 | #define IRC_REG_M 0x0C //R |
Airium | 3:522d01930e6a | 56 | // Temprature OUT SUB |
Airium | 3:522d01930e6a | 57 | #define TEMP_OUT_H_M 0x31 //R MSB(8) |
Airium | 3:522d01930e6a | 58 | #define TEMP_OUT_L_M 0x32 //R LSB(4) 0(4) |
Airium | 3:522d01930e6a | 59 | |
Airium | 3:522d01930e6a | 60 | #endif |