1. Use BMX160 Shuttle Board to communicate through SPI, CS PIN needs set zero or one at the beginning ???
In fact, if use SPI interface, CS Pin need a raising edge after BMX160 power, from 0 to 1. You need switch CS Pin from 0 to 1 before SPI communication. 2. According to your last reply, I executed rslt = null_ptr_check(dev) in the int8_t bmi160_init (struct bmi160_dev * dev) function, and the result is zero, so it means that my SPI pre-operation should be completed?? It is just whether the MCU uses SPI to connect with BMX160 Success depends on the wave pattern?
In function bmi160_init(), dummy read will enable SPI Interface, as bellow
/* Dummy read of 0x7F register to enable SPI Interface * if SPI is used */ if ((rslt == BMI160_OK) && (dev->interface == BMI160_SPI_INTF)) { rslt = bmi160_get_regs(BMI160_SPI_COMM_TEST_ADDR, &data, 1, dev); }
... View more