using big endian now for gyro
This commit is contained in:
@ -22,7 +22,7 @@ static constexpr uint8_t CTRL_REG_3 = 0b0010'0010;
|
||||
static constexpr uint8_t CTRL_REG_4 = 0b0010'0011;
|
||||
static constexpr uint8_t CTRL_REG_5 = 0b0010'0100;
|
||||
|
||||
// Register 1
|
||||
/* Register 1 */
|
||||
static constexpr uint8_t SET_DR_1 = 1 << 7;
|
||||
static constexpr uint8_t SET_DR_0 = 1 << 6;
|
||||
static constexpr uint8_t SET_BW_1 = 1 << 5;
|
||||
@ -35,7 +35,7 @@ static constexpr uint8_t SET_Y_ENABLE = 1;
|
||||
static constexpr uint8_t CTRL_REG_1_VAL = SET_POWER_NORMAL_MODE | SET_Z_ENABLE |
|
||||
SET_Y_ENABLE | SET_X_ENABLE;
|
||||
|
||||
// Register 2
|
||||
/* Register 2 */
|
||||
static constexpr uint8_t EXTERNAL_EDGE_ENB = 1 << 7;
|
||||
static constexpr uint8_t LEVEL_SENSITIVE_TRIGGER = 1 << 6;
|
||||
static constexpr uint8_t SET_HPM_1 = 1 << 5;
|
||||
@ -47,10 +47,10 @@ static constexpr uint8_t SET_HPCF_0 = 1;
|
||||
|
||||
static constexpr uint8_t CTRL_REG_2_VAL = 0b0000'0000;
|
||||
|
||||
// Register 3
|
||||
/* Register 3 */
|
||||
static constexpr uint8_t CTRL_REG_3_VAL = 0b0000'0000;
|
||||
|
||||
// Register 4
|
||||
/* Register 4 */
|
||||
static constexpr uint8_t SET_BNU = 1 << 7;
|
||||
static constexpr uint8_t SET_BLE = 1 << 6;
|
||||
static constexpr uint8_t SET_FS_1 = 1 << 5;
|
||||
@ -60,15 +60,16 @@ static constexpr uint8_t SET_SELF_TEST_ENB_1 = 1 << 2;
|
||||
static constexpr uint8_t SET_SELF_TEST_ENB_0 = 1 << 1;
|
||||
static constexpr uint8_t SET_SPI_IF_SELECT = 1;
|
||||
|
||||
static constexpr uint8_t CTRL_REG_4_VAL = 0b0000'0000;
|
||||
/* Enable big endian data format */
|
||||
static constexpr uint8_t CTRL_REG_4_VAL = SET_BLE;
|
||||
|
||||
// Register 5
|
||||
/* Register 5 */
|
||||
static constexpr uint8_t SET_REBOOT_MEM = 1 << 7;
|
||||
static constexpr uint8_t SET_FIFO_ENB = 1 << 6;
|
||||
|
||||
static constexpr uint8_t CTRL_REG_5_VAL = 0b0000'0000;
|
||||
|
||||
// In degrees per second (DPS) for now.
|
||||
/* Possible range values in degrees per second (DPS). */
|
||||
static constexpr uint16_t RANGE_DPS_00 = 245;
|
||||
static constexpr uint16_t RANGE_DPS_01 = 500;
|
||||
static constexpr uint16_t RANGE_DPS_11 = 2000;
|
||||
@ -76,16 +77,16 @@ static constexpr uint16_t RANGE_DPS_11 = 2000;
|
||||
static constexpr uint8_t READ_START = CTRL_REG_1;
|
||||
static constexpr size_t READ_LEN = 14;
|
||||
|
||||
// Indexing
|
||||
/* Indexing */
|
||||
static constexpr uint8_t REFERENCE_IDX = 6;
|
||||
static constexpr uint8_t TEMPERATURE_IDX = 7;
|
||||
static constexpr uint8_t STATUS_IDX = 8;
|
||||
static constexpr uint8_t OUT_X_L = 9;
|
||||
static constexpr uint8_t OUT_X_H = 10;
|
||||
static constexpr uint8_t OUT_Y_L = 11;
|
||||
static constexpr uint8_t OUT_Y_H = 12;
|
||||
static constexpr uint8_t OUT_Z_L = 13;
|
||||
static constexpr uint8_t OUT_Z_H = 14;
|
||||
static constexpr uint8_t OUT_X_H = 9;
|
||||
static constexpr uint8_t OUT_X_L = 10;
|
||||
static constexpr uint8_t OUT_Y_H = 11;
|
||||
static constexpr uint8_t OUT_Y_L = 12;
|
||||
static constexpr uint8_t OUT_Z_H = 13;
|
||||
static constexpr uint8_t OUT_Z_L = 14;
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* Device Handler specific */
|
||||
|
Reference in New Issue
Block a user