Skip to content

Commit

Permalink
SC7A20: Fix boot register
Browse files Browse the repository at this point in the history
  • Loading branch information
StarGate01 committed Mar 29, 2022
1 parent 402ebae commit 7870b38
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/drivers/SC7A20.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <libraries/delay/nrf_delay.h>
#include "drivers/SC7A20.h"
#include "drivers/SC7A20/SC7A20_registers.h"
#include <task.h>

using namespace Pinetime::Drivers;

Expand All @@ -18,7 +19,10 @@ void SC7A20::Init() {

// Reset internal memory
uint8_t data = CTRL_REG5_BOOT;
Write(CTRL_REG2, &data, 1);
Write(CTRL_REG5, &data, 1);
vTaskDelay(5);
data = 0;
Write(CTRL_REG5, &data, 1);

// Read Chip ID
Read(WHO_AM_I, &data, 1);
Expand Down Expand Up @@ -57,6 +61,9 @@ void SC7A20::Init() {
data = CTRL_REG4_BDU;
Write(CTRL_REG4, &data, 1);

// Enable fifo for high resolution readout


// Configure for 400 Hz in low power mode (8 bit resolution)
// Enable all axis for independent readout
data = CTRL_REG1_ODR_400HZ | CTRL_REG1_X_EN | CTRL_REG1_Y_EN | CTRL_REG1_Z_EN | CTRL_REG1_LP_EN;
Expand Down

0 comments on commit 7870b38

Please sign in to comment.