Power Manager API Reference#
API Overview#
The Power Manager provides the following comprehensive API categories for power management:
API Category | Description |
|---|---|
Core Sleep Control | Essential functions for power manager initialization, sleep entry, and energy mode requirements |
Ultra-Low-Power (EM4) | Specialized APIs for EM4 deep sleep mode with system reset and pin retention capabilities |
Event Notification | Subscription system for power transition events enabling coordinated power state management |
Execution Modes (Series 3) | Performance scaling APIs for dynamic clock frequency management on Series 3 devices |
Schedule Wake-up Tuning | Advanced timing optimization functions for fine-tuning power transition behavior |
Advanced Power Control | Specialized functions for voltage scaling, wake-up analysis, and runtime clock configuration updates |
Sleep Decision Callbacks | Application hooks for controlling sleep behavior in bare-metal applications |
Debug and Diagnostics | Development and troubleshooting tools for analyzing power management behavior |
The following table lists all the functions in each API category for quick reference by function names:
Category | Functions |
|---|---|
Core Sleep Control |
|
Ultra-Low-Power (EM4) |
|
Event Notification |
|
Execution Modes (Series 3) |
|
Schedule Wake-up Tuning |
|
Advanced Power Control |
|
Sleep Decision Callbacks |
|
Debug and Diagnostics |
|
This section focuses on essential APIs for typical power management use cases. For advanced APIs and complete reference, see the full API documentation.
Core Sleep Control#
void sl_power_manager_sleep(void);
void sl_power_manager_add_em_requirement(sl_power_manager_em_t em);
void sl_power_manager_remove_em_requirement(sl_power_manager_em_t em);sl_power_manager_sleep()
Purpose: Enters lowest allowable energy mode automatically
Context: Main thread only (not from ISR)
Behavior: Selects EM1 or EM2/3 based on active requirements
Typical Usage: Not necessary to call manually - automatically called by bare-metal template main loop and RTOS idle task
sl_power_manager_add_em_requirement(em) / sl_power_manager_remove_em_requirement(em)
Purpose: Add/remove energy mode requirements to prevent sleep deeper than specified mode
Parameters:
SL_POWER_MANAGER_EM1(only accepted value)Context: Safe from ISR
Important: Only remove requirements previously added by your module
ISR Timing: When called from ISR during EM2 sleep, adding EM1 requirements will block until system restore is finished
Usage Example: See Scenario 1: Asynchronous Sensor Reading for a practical demonstration of requirement management and sleep control
Ultra-Low-Power (EM4) APIs#
__NO_RETURN void sl_power_manager_enter_em4(void);sl_power_manager_enter_em4()
Purpose: Enters deepest sleep mode
Return: Never returns - device resets on wake-up
Wake Sources: External pins, RTC, reset
Usage Example: See Scenario 2: Ultra-Low Power EM4 Sleep for a complete implementation example
Event Notification APIs#
void sl_power_manager_subscribe_em_transition_event(
sl_power_manager_em_transition_event_handle_t *event_handle,
const sl_power_manager_em_transition_event_info_t *event_info);
void sl_power_manager_unsubscribe_em_transition_event(
sl_power_manager_em_transition_event_handle_t *event_handle);sl_power_manager_subscribe_em_transition_event() / sl_power_manager_unsubscribe_em_transition_event()
Purpose: Subscribe to/unsubscribe from energy mode transition event notifications - essential for modules that need to prepare for or respond to power state changes
Parameters:
event_handle: Pointer to handle structure that will be populated for later unsubscriptionevent_info: Pointer to structure containing callback function and configuration
Context: Safe to call from main thread during initialization/cleanup
Usage Example: See Using Event Notifications for complete callback implementation and context management
Execution Mode APIs (Series 3 Only)#
void sl_power_manager_add_performance_mode_requirement(void);
void sl_power_manager_remove_performance_mode_requirement(void);sl_power_manager_add_performance_mode_requirement() / sl_power_manager_remove_performance_mode_requirement()
Purpose: Add/remove performance mode requirements to switch between Standard and Performance execution modes
Device Support: Series 3 (SIXG301) only
Power Impact: Higher power consumption in Performance mode but faster processing
Series 2 Compatibility: On Series 2, these APIs are no-ops
Usage Example: See Execution Modes (Series 3 Only) for dynamic performance scaling implementation