Skip to content

nrf: peripheral power management, sticky pin configuration #4411

@dmitry-tarnyagin

Description

@dmitry-tarnyagin

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

  1. 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?

  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions