Hi,
I have a board that has a couple of sensors and their power switches to turn on and off to save power. Whenever i dont need the sensor, i need to shut it down. But after turning it on, i need to initialise their driver again,
for example, BME680 sensor, if I use the default bme680 driver, it is initialised during boot in post kernel: to initialise it whenever I need basically.
SENSOR_DEVICE_DT_INST_DEFINE(inst, \ bme680_init, \ NULL, \ &bme680_data_##inst, \ &bme680_config_##inst, \ POST_KERNEL, \ CONFIG_SENSOR_INIT_PRIORITY, \ &bme680_api_funcs);
it seems it is obvious that I need to edit the default driver file, but
Q1: I am unsure How I can init the driver in runtime. As far as I see in other questions, the power management system for Zephyr is recommended https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/pm/index.html . is it enough to read that page to achieve my intention? I also saw in some of the questions regulators APIs and had a quick search about this, https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.2-dev1/zephyr/reference/peripherals/regulators.html
So It seems I need this one too and to use a combination of power management and regulator apis.
Is there any sample to see this mechanism? or can you please shed some light on what should be the steps for this?
and this is the other question looks like it is a similar one. Power off LSM6DSO Sensor between measurements
Thank you, Kind regars