Implementation of BMI160 Driver

Hello everyone,

I am currently trying to get the BMI160 Sensor to work. It is connected trough SPI to the main processor. I would like to use the Driver provided (https://github.com/BoschSensortec/BMI160_driver), but do not really know how to continue.

In the readme file it is written that first I have to create a bmi160_dev struct. Then I have to initialise the.read and the .write functions. I do not really understand what is asked here. 

Is that just the function one usually uses to read or write per SPI? As an argument I get the registry adress, the data and its length and then I just need to call some HAL_SPI_TRANSMIT or HAL_SPI_RECEIVE (now for STM32)?

And one more question: Is the length the length of the transmitted data in bytes without the adress? (So if I have 16 bits -> 8 for the adress and write/read and 8 for the data the length would be 1?)

Thank you very much for your help!

Sincerely 

Sam

1
2 replies