You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hmmm, honestly haven't touched or used this since I wrote it. I thought I had tested accessing other banks but maybe not.. If you find this issue is true, please feel free to submit a PR to fix it. Otherwise, I will fix it once I get around to it 👍
I used this code recently, and can confirm while being very well structured, the bank selection is incorrect. for example:
dev.usr_bank.reg_bank_sel = ICM20948_USER_BANK_0; // (whichever user bank it is, 0, 1, 2)
// Write to the reg bank select to select bank 0
ret = _spi_write(ICM20948_ADDR_REG_BANK_SEL, (uint8_t *)&dev.usr_bank.reg_bank_sel, 0x01);
can / should be replaced with
dev.usr_bank.bank0.bytes.REG_BANK_SEL.bits.USER_BANK = ICM20948_USER_BANK_0; //(again, X being the bank) //// Write to the reg bank select to select bank 0
ret = _spi_write(ICM20948_ADDR_REG_BANK_SEL,& dev.usr_bank.bank0.bytes.REG_BANK_SEL.byte, 0x01);
I think you need to shift it to the left by 4 because right now you are setting bits 0 and 1 as far as I can tell
The text was updated successfully, but these errors were encountered: