Skip to content

powman_power_state returned by powman_get_power_state inverted #2506

Open
@eightycc

Description

@eightycc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions