STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
sleep_math.h File Reference
#include <stdint.h>
Include dependency graph for sleep_math.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SLEEP_RTC_ASYNC_DIV   128U /* AsynchPrediv + 1 */
#define SLEEP_RTC_SYNC_DIV   250U /* SynchPrediv + 1 */
#define SLEEP_WUT_DIV   16U /* RTC_WAKEUPCLOCK_RTCCLK_DIV16 */
#define SLEEP_DAY_STEPS   (86400UL * SLEEP_RTC_SYNC_DIV)

Functions

uint16_t sleep_wut_reload (uint32_t ms, uint32_t lsi_hz)
uint32_t sleep_rtc_steps (uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t ssr)
uint32_t sleep_elapsed_ms (uint32_t from_steps, uint32_t to_steps, uint32_t lsi_hz)
uint32_t sleep_lsi_hz (uint32_t steps, uint32_t us)

Macro Definition Documentation

◆ SLEEP_DAY_STEPS

#define SLEEP_DAY_STEPS   (86400UL * SLEEP_RTC_SYNC_DIV)

Definition at line 25 of file sleep_math.h.

Referenced by sleep_elapsed_ms().

◆ SLEEP_RTC_ASYNC_DIV

#define SLEEP_RTC_ASYNC_DIV   128U /* AsynchPrediv + 1 */

Definition at line 22 of file sleep_math.h.

Referenced by sleep_elapsed_ms(), and sleep_lsi_hz().

◆ SLEEP_RTC_SYNC_DIV

#define SLEEP_RTC_SYNC_DIV   250U /* SynchPrediv + 1 */

Definition at line 23 of file sleep_math.h.

Referenced by sleep_rtc_steps().

◆ SLEEP_WUT_DIV

#define SLEEP_WUT_DIV   16U /* RTC_WAKEUPCLOCK_RTCCLK_DIV16 */

Definition at line 24 of file sleep_math.h.

Referenced by sleep_wut_reload().

Function Documentation

◆ sleep_elapsed_ms()

uint32_t sleep_elapsed_ms ( uint32_t from_steps,
uint32_t to_steps,
uint32_t lsi_hz )

◆ sleep_lsi_hz()

uint32_t sleep_lsi_hz ( uint32_t steps,
uint32_t us )

Definition at line 33 of file sleep_math.c.

References SLEEP_RTC_ASYNC_DIV.

Referenced by measure_lsi(), and test_lsi_measurement().

◆ sleep_rtc_steps()

uint32_t sleep_rtc_steps ( uint8_t hours,
uint8_t minutes,
uint8_t seconds,
uint32_t ssr )

Definition at line 14 of file sleep_math.c.

References SLEEP_RTC_SYNC_DIV.

Referenced by rtc_stamp(), test_elapsed(), and test_rtc_steps_count_down_subseconds().

◆ sleep_wut_reload()

uint16_t sleep_wut_reload ( uint32_t ms,
uint32_t lsi_hz )

Definition at line 3 of file sleep_math.c.

References SLEEP_WUT_DIV.

Referenced by board_sleep(), anonymous_namespace{idle_e2e.cpp}::run(), and test_wut_reload().