-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Hi,
I have a couple of questions regarding peripheral power management and pin handling in embassy-nrf.
Background
Our products are highly focused on low power consumption. Typically, we place peripherals like SPI or I2C into a low-power state by stopping and explicitly disabling them using the ENABLE register.
Currently, in embassy-nrf, peripheral blocks are enabled for the entire lifetime of their respective drivers: they're enabled in the constructor and disabled only in the drop function. Therefore, to transition a peripheral block into a power-saving state, we must drop the driver, which doesn't align well with the bus abstraction provided by embassy_embedded_hal::shared_bus.
Questions
-
Peripheral power management: Are there plans to introduce peripheral power management into embassy-nrf drivers? If so, could you share any rough design sketches or approaches you might have considered?
-
Pin configuration: Currently, the embassy-nrf driver drop functions reset peripheral pins (e.g., SCK, MOSI, TXD) to a disabled state. This approach isn't ideal for us because we often rely on internal pull-ups or pull-downs (if not push-pull outputs) to prevent floating nets. The default state we need is seldom "disabled." Would it be interesting to retain the original pin configuration throughout the driver's lifetime and restore it when the driver is dropped instead?
Best regards,
Dmitry Tarnyagin