I2C sensor with additional CS/power pins

Hello,

I am trying to use LPS22HB sensor on a custom NRF52832 board. The sensor shall be supported by Zephyr/NRF Connect (in I2C mode) - but the driver continously reports False via device_is_ready().

The sensor is dual-mode and supports SPI as well. To configure it for I2C, CS pin has to be set to HIGH (as well as SDO/SAO - set a desired I2C bus address 5C or 5D). On this particular board both CS and SAO are wired to GPIO pins on a controller - so I need to set them properly (and probably wait until everything settles up) before accessing I2C. Unfortunately, initialisation of a sensor driver seems to happen before main() - so it seems to hit inactive device and fail.

Please advise - how can I resolve this (using SDK 2.4.0).

Thanks!

Related