Device Power Management and SAADC

In the nRF52840 datasheet, peripherals don't appear to have shutdown or power-off controls but they do have enable/disable registers. I'm guessing that Device PM turns on/off these bits and then the PMU automatically turns on/off the power to the disabled peripheral.

The Runtime Device PM uses a pm_device_runtime_enable(dev) call, where "dev" is a pointer to a struct device pointer, same as used in the device_is_ready() call.

Our project uses GPIO for LEDs, the ADC to monitor the supply bus, and I2C for a sensing peripheral. In main(), I call device_is_ready() for everything, and that works. At the end of main(), I call pm_device_runtime_enable() for all those struct device pointer things for which device_is_ready() was called.

I2C works. It seems Device PM for I2C is implemented.

GPIO ("led.port") does not work. -134, ENOTSUP. I see in other DevZone queries that the GPIO subsystem is not subject to power shutdown, and it does not have an ENABLE register. So I'm not surprised.

ADC ("adc_channels[i].dev") does not work. -134, ENOTSUP. This is surprising that the SAADC cannot be controlled by Device PM under NCS. It has an ENABLE register. I see in other posts that the ADC could be shut down in older contexts (HAL/nrf?). Am I missing something? Or do I need to use the nrf libraries to shut down the SAADC between readings?

Related