This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How do I specify my register address for SPI driver interface?

Hello,

I am using SPI interface to communicate with a sensor BMI160, looking into the driver for BMI160 I can see how the low level functions for reading/writting are used like this

read(dev->id, reg_addr, data, len);

However, for nrf52 I see that spi transfer are defined as this

(nrf_drv_spi_transfer(&spi_BMI160, NULL, 0, rxData, bytesNumberRx)

where I have difined

static const nrf_drv_spi_t spi_BMI160 = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE_1)

My question is pretty straightforward, how does know the SPI instance/driver what register reg_addr to write? Or where should I specifythat argurment ?

Thanks in advance,

Related