I setup SPI like this
Code: Select all
ICM40605_SPI->begin(ICM40605_SCK, ICM40605_MISO, ICM40605_MOSI, ICM40605_CS);
ICM40605_SPI->beginTransaction(SPISettings(SPI_FREQUENCY, MSBFIRST, SPI_MODE3));
delay(100);
ICM40605_SPI->setHwCs(true);
Code: Select all
void readRegister(uint8_t* output, uint8_t offset) {
uint8_t result = 0;
// digitalWrite(ICM40605_CS, LOW);
ICM40605_SPI->transfer(offset | 0x80);
result = ICM40605_SPI->transfer(0x00);
// digitalWrite(ICM40605_CS, HIGH);
*output = result;
}
What am I missing?