Skip to content

Add Board-Level Power Mangement #21691

@maribu

Description

@maribu

Motivation

RIOT's PM system only considers MCU power levels. But boards may have external power domains as well, for example:

  1. A CAN transceiver may have an enable pin. Only with the enable pin at the "enable" level, the CAN transceiver will function.
  2. A board may use some MOSFETs to enable/disable the power supply to an external sensor. Using that sensor requires to enable that power domain.
  3. A board may use some MOSFETs to enable/disable the power supply to multiple external sensors at once. Using any of the sensors connected to the same power domain requires enabling that power domain.

The problem is that while it is trivial to implement some board_enable_power_domain_foo() / board_disable_power_domain_foo() for every power domain of the board, actually using this is non trivial:

  1. The board does not know when the hardware is used. It would have to enable the power domains in board_init() and keep them enabled.
  2. An application would know when e.g. it does an saul_read() ... and one could enable/disable the power domains there. However...
    • We ideally want applications to be (as much as possible) board agnostic and not know about board details
    • We ideally want applications to not know about driver and hardware details. But power cycle the hardware without informing the driver of that hardware can cause issue (e.g. because configuration values are lost)
  3. The device driver would know exactly when it requires the hardware to be powered or not. But it (rightfully) has no knowledge about board details

Metadata

Metadata

Labels

Community: help wantedThe contributors require help from other members of the communityType: new featureThe issue requests / The PR implemements a new feature for RIOT

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions