sensors/bmi160.c: fix the problem Linux SPI doesn't working properly

CH341A chip only supports SPI MODE0, and BMI160 supports both MODE0 and MODE3. So, changing MODE3 to MODE0 makes all cases available.

Signed-off-by: xinbingnan <xinbingnan@xiaomi.com>
This commit is contained in:
xinbingnan 2023-01-02 23:13:45 +08:00 committed by Petro Karashchenko
parent d031989e0e
commit 7076de9e8a

View File

@ -278,7 +278,7 @@ static inline void bmi160_configspi(FAR struct spi_dev_s *spi)
{ {
/* Configure SPI for the BMI160 */ /* Configure SPI for the BMI160 */
SPI_SETMODE(spi, SPIDEV_MODE3); SPI_SETMODE(spi, SPIDEV_MODE0);
SPI_SETBITS(spi, 8); SPI_SETBITS(spi, 8);
SPI_HWFEATURES(spi, 0); SPI_HWFEATURES(spi, 0);
SPI_SETFREQUENCY(spi, BMI160_SPI_MAXFREQUENCY); SPI_SETFREQUENCY(spi, BMI160_SPI_MAXFREQUENCY);