|
oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
|
Hardware Abstraction Layer interface for power management. More...
Functions | |
| int | ove_hal_pm_enter_state (ove_pm_state_t state, uint32_t expected_idle_ms) |
| Enter a hardware sleep state. | |
| int | ove_hal_pm_wake_arm (const struct ove_pm_wake_src *src) |
| Arm a wake source in hardware before entering sleep. | |
| int | ove_hal_pm_wake_disarm (const struct ove_pm_wake_src *src) |
| Disarm a wake source after waking. | |
| int | ove_hal_pm_domain_enable (ove_pm_domain_t domain) |
| Enable power to a peripheral domain. | |
| int | ove_hal_pm_domain_disable (ove_pm_domain_t domain) |
| Disable power to a peripheral domain (power-gate). | |
| uint32_t | ove_hal_pm_get_next_timeout_ms (void) |
| Query the time until the next scheduled RTOS event. | |
| void | ove_hal_pm_idle_hook (void) |
| Idle hook entry point — registered with the RTOS idle mechanism. | |
Hardware Abstraction Layer interface for power management.
Declares the low-level PM functions that every platform HAL must implement. The portable Power Management layer delegates to these functions after performing state machine logic, refcounting, and statistics tracking.
| int ove_hal_pm_enter_state | ( | ove_pm_state_t | state, |
| uint32_t | expected_idle_ms | ||
| ) |
Enter a hardware sleep state.
Called by the portable PM layer after arming wake sources and firing PRE_SLEEP notifications. The function blocks until the system wakes.
| [in] | state | Target sleep state. |
| [in] | expected_idle_ms | Hint: expected sleep duration in ms. |
| int ove_hal_pm_wake_arm | ( | const struct ove_pm_wake_src * | src | ) |
Arm a wake source in hardware before entering sleep.
Called for each registered wake source before ove_hal_pm_enter_state().
| [in] | src | Wake source descriptor. |
| int ove_hal_pm_wake_disarm | ( | const struct ove_pm_wake_src * | src | ) |
Disarm a wake source after waking.
| [in] | src | Wake source descriptor. |
| int ove_hal_pm_domain_enable | ( | ove_pm_domain_t | domain | ) |
Enable power to a peripheral domain.
Called when a domain's reference count transitions from 0 to 1.
| [in] | domain | Domain identifier. |
| int ove_hal_pm_domain_disable | ( | ove_pm_domain_t | domain | ) |
Disable power to a peripheral domain (power-gate).
Called when a domain's reference count transitions from 1 to 0.
| [in] | domain | Domain identifier. |
| uint32_t ove_hal_pm_get_next_timeout_ms | ( | void | ) |
Query the time until the next scheduled RTOS event.
| void ove_hal_pm_idle_hook | ( | void | ) |
Idle hook entry point — registered with the RTOS idle mechanism.
The backend registers this function with the RTOS idle task (e.g. vApplicationIdleHook on FreeRTOS, pm_notifier on Zephyr). It calls ove_pm_idle_process() in the portable layer to drive the PM state machine.