Thanks in advanced. When I use nrf52832's spi to call "inv_imu_switch_on_mclk" function, I always get MCLK_RDY reg fail. But I can call read_sreg/write_sreg normally. I'm confused for several days. Could anybody help me? Below are my interface:
int inv_io_hal_read_reg(struct inv_imu_serif * serif, uint8_t reg, uint8_t * rbuffer, uint32_t rlen)
{
(void)serif;
uint8_t ul_addr = reg | 0x80;
uint32_t ul_size = rlen + 1;
ZERO_CLEAR(rbuffer);
spi_xfer_done = false;
uint8_t tx_buffer[2] = { ul_addr, 0x00 };
nrf_gpio_pin_clear(SPI_CS_PIN);
nrf_drv_spi_transfer(&m_spi, tx_buffer, ul_size, rbuffer, rlen);
while (!spi_xfer_done)
{
__WFE();
}
nrf_gpio_pin_set(SPI_CS_PIN);
return 0;
}
int inv_io_hal_write_reg(struct inv_imu_serif * serif, uint8_t reg, const uint8_t * wbuffer,
uint32_t wlen)
{
(void)serif;
uint8_t tx_buffer[2] = { reg & 0x7F, wbuffer[0] }; // 写命令
nrf_gpio_pin_clear(SPI_CS_PIN);
nrf_drv_spi_transfer(&m_spi, tx_buffer, wlen + 1, NULL, 0);
while (!spi_xfer_done)
{
__WFE();
}
nrf_gpio_pin_set(SPI_CS_PIN);
return 0;
}
Would any expert tell me how to find AN-000352 mentioned in eMD code?