10-07-2020 02:35 AM
Hi, I am trying to write a driver to communicate to the BMA456 from Cypress's CYBLE 212006-01 through SPI. I have been using your API provided here:
https://github.com/BoschSensortec/BMA456-Sensor-API
I am writing the bus_read and bus_write functions, and I keep seeing dev-> intf_ptr. Do I need to initialize this pointer to something? I am just confused as to what this pointer should be doing. I know it is part of the device struct, but I do not see any examples using this pointer.
This line of code is from bma4.c : dev->intf_rslt = dev->bus_write(addr, data, len, dev->intf_ptr);
https://github.com/BoschSensortec/BMA456-Sensor-API/blob/master/bma4.c
Any help on this would be great, thank you.
Solved! Go to Solution.
10-07-2020 02:58 AM
Hello,
There is some example code as below generic folder.
Regarding intf, please check bma4_interface_selection function in bma4_common.c.
Thanks 🙂
10-07-2020 03:00 PM
Thank you! common.c has helped