uint32_t mmhal_sleep(enum mmhal_sleep_state sleep_state, uint32_t expected_idle_time_ms)
Function to enter MCU sleep.
mmhal_sleep_state
Enumeration of MCU sleep state.
mmhal_isr_state
Enumeration of ISR states (i.e., whether in ISR or not).
void mmhal_sleep_abort(enum mmhal_sleep_state sleep_state)
Function to abort the MCU sleep state.
void mmhal_sleep_cleanup(void)
Function to cleanup on exit from the MCU sleep state.
void mmhal_log_write(const uint8_t *data, size_t len)
Write to the debug log.
void mmhal_log_flush(void)
Flush the debug log before returning.
void mmhal_early_init(void)
Initialization before RTOS scheduler starts.
enum mmhal_sleep_state mmhal_sleep_prepare(uint32_t expected_idle_time_ms)
Function to prepare MCU to enter sleep.
enum mmhal_isr_state mmhal_get_isr_state(void)
Get the current ISR state (i.e., whether in ISR or not).
void mmhal_reset(void)
Reset the microcontroller.
void mmhal_init(void)
Initialization after RTOS scheduler started.
@ MMHAL_SLEEP_DISABLED
Disable MCU sleep.
@ MMHAL_SLEEP_SHALLOW
MCU to enter shallow sleep.
@ MMHAL_SLEEP_DEEP
MCU can enter deep sleep.
@ MMHAL_ISR_STATE_UNKNOWN
The HAL does not support checking ISR state.
@ MMHAL_NOT_IN_ISR
The function was not executed from ISR context.
@ MMHAL_IN_ISR
The function was executed from ISR context.