33 const uint32_t steps = 125U;
35 while (
RTC->SSR == ssr) {
41 for (uint32_t
n = 0;
n < steps; ++
n) {
43 while (
RTC->SSR == ssr) {
56 info.ready =
info.lsi_hz > 24000U &&
info.lsi_hz < 40000U;
75 if (wake_now && wake_now()) {
110 info.last_slept_ms = slept;
static uint32_t measure_lsi(void)
static board_sleep_info_t info
uint32_t board_sleep(uint32_t ms, bool(*wake_now)(void))
static volatile bool rtc_fired
const board_sleep_info_t * board_sleep_info(void)
void SystemClock_Config(void)
System Clock Configuration.
bool board_sleep_init(void)
static uint32_t rtc_stamp(void)
uint32_t board_time_us(void)
static void start(gnss_frame_parser_t *p, uint8_t byte)
#define SysTick_CTRL_ENABLE_Msk
SysTick CTRL: ENABLE Mask.
#define SysTick
SysTick configuration struct.
#define CoreDebug
Core Debug configuration struct.
#define CoreDebug_DHCSR_C_DEBUGEN_Msk
CoreDebug DHCSR: C_DEBUGEN Mask.
#define SET_BIT(REG, BIT)
void HAL_ResumeTick(void)
Resume Tick increment.
void HAL_SuspendTick(void)
Suspend Tick increment.
void HAL_PWREx_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry, uint32_t Domain)
#define PWR_LOWPOWERREGULATOR_ON
#define PWR_STOPENTRY_WFI
#define FLASH_OPTSR_NRST_STOP_D1
D1 domain DStop entry reset option status bit.
#define DBGMCU_CR_DBG_STOPD1
#define DBGMCU_CR_DBG_SLEEPD1
#define DBGMCU_CR_DBG_STOPD3
HAL_StatusTypeDef HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock)
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *h)
#define RTC_WAKEUPCLOCK_RTCCLK_DIV16
HAL_StatusTypeDef HAL_RTC_GetDate(const RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format)
HAL_StatusTypeDef HAL_RTC_GetTime(const RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format)
HAL_StatusTypeDef HAL_RTC_WaitForSynchro(RTC_HandleTypeDef *hrtc)
#define __HAL_RTC_WRITEPROTECTION_ENABLE(__HANDLE__)
Enable the write protection for RTC registers.
#define __HAL_RTC_WRITEPROTECTION_DISABLE(__HANDLE__)
Disable the write protection for RTC registers.
bool usb_configured(void)
*brief user defined string literal for JSON values *sa std::size_t n
#define pdMS_TO_TICKS(xTimeInMs)
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)
uint32_t sleep_rtc_steps(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t ssr)
uint16_t sleep_wut_reload(uint32_t ms, uint32_t lsi_hz)
RTC Date structure definition.
RTC Handle Structure definition.
RTC Time structure definition.
BaseType_t xTaskResumeAll(void) PRIVILEGED_FUNCTION
void vTaskSuspendAll(void) PRIVILEGED_FUNCTION
BaseType_t xTaskCatchUpTicks(TickType_t xTicksToCatchUp) PRIVILEGED_FUNCTION
: Header for usbd_cdc_if.c file.