NRF5340 TMP116 power management

Hello,

I have a TMP117 attached to I2C1 on a nrf5340 and am using the zephyr NCS v2.0.0 driver to communicate with it. 

How can I configure I2C1 for power management to sleep/suspend to conserve power when not in use given that the initialization gets done by the OS driver code C:\ncs\v2.0.0\zephyr\drivers\sensor\tmp116\tmp116.c. I don't see how to get the PM_DEVICE_DT_DEFINE defined for the driver to be able to call pm_device_action_run on it. Currently my program crashes when that routine is called in 

pm_device_action_run(i2c1_dev, PM_DEVICE_ACTION_SUSPEND)
.
.
.// crashes in this call
    atomic_test_bit(&pm->flags, PM_DEVICE_FLAG_STATE_LOCKED);
 
I see that the PM_DEVICE_DT_DEFINE is set for I2C in TWI and TWIM but not for the TMP116 driver.
grep -r PM_DEVICE_DT_DEFINE /c/ncs/v2.0.0/zephyr/
/c/ncs/v2.0.0/zephyr/drivers/i2c/i2c_nrfx_twi.c: PM_DEVICE_DT_DEFINE(I2C(idx), twi_nrfx_pm_action); \
/c/ncs/v2.0.0/zephyr/drivers/i2c/i2c_nrfx_twim.c: PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action);
Thank you.
Parents Reply Children
Related