ist8310: fix 16 times average configuration

This commit is contained in:
Daniel Agar 2021-02-11 09:12:19 -05:00
parent 7e18cffc5f
commit 5b44bd67bb
2 changed files with 5 additions and 3 deletions

View File

@ -109,7 +109,7 @@ private:
// Register | Set bits, Clear bits
{ Register::CNTL2, 0, CNTL2_BIT::SRST },
{ Register::CNTL3, CNTL3_BIT::Z_16BIT | CNTL3_BIT::Y_16BIT | CNTL3_BIT::X_16BIT, 0 },
{ Register::AVGCNTL, AVGCNTL_BIT::Y_16TIMES | AVGCNTL_BIT::XZ_16TIMES, 0 },
{ Register::AVGCNTL, AVGCNTL_BIT::Y_16TIMES_SET | AVGCNTL_BIT::XZ_16TIMES_SET, AVGCNTL_BIT::Y_16TIMES_CLEAR | AVGCNTL_BIT::XZ_16TIMES_CLEAR },
{ Register::PDCNTL, PDCNTL_BIT::PULSE_NORMAL, 0 },
};
};

View File

@ -134,10 +134,12 @@ enum CNTL3_BIT : uint8_t {
// AVGCNTL
enum AVGCNTL_BIT : uint8_t {
// 5:3 Average times for y sensor data. Times of average will be done before switch to next channel
Y_16TIMES = Bit5, // 3b100 average by 16 times (ODRmax=166Hz)
Y_16TIMES_SET = Bit5, // 3b100 average by 16 times (ODRmax=166Hz)
Y_16TIMES_CLEAR = Bit4 | Bit3,
// 2:0 Average times for x & z sensor data. Times of average will be done before switch to next channel
XZ_16TIMES = Bit2, // average by 16 times (ODRmax=166Hz)
XZ_16TIMES_SET = Bit2, // average by 16 times (ODRmax=166Hz)
XZ_16TIMES_CLEAR = Bit1 | Bit0,
};
// PDCNTL