Description
The RP2350 POWMAN STATE
register bit-fields REQ
and CURRENT
represent the requested and current power state bits. According to the datasheet, the hardware defines these as 0 for powered-up
and 1 for powered-down.
The SDK defines a type powman_power_state
to hold a power state, along with helper functions powman_power_state_with_domain_on()
, powman_power_state_with_domain_off()
, and powman_power_state_is_domain_on()
to manipulate and query its domain power state bits.
Macro POWMAN_POWER_STATE_NONE
is defined as 0, indicating all power domains off.
It's clear from this type, helpers, and the macro, that the SDK wants to handle domain ON/OFF states intuitively as 1 for ON
and 0 for OFF
.
The implementation of powman_get_power_state()
returns the raw CURRENT
field of the STATE
register as powman_power_state
type. To be consistent with SDK usage, it should logically complement the field.
The implementation of powman_set_power_state()
correctly complements its state
argument before loading it into the REQ
field of the STATE
register.