L14-Click
1.0
STM32WLE5CC LoRaWAN Sensor Platform
Loading...
Searching...
No Matches
rtc.h
Go to the documentation of this file.
1
/* USER CODE BEGIN Header */
2
/**
3
******************************************************************************
4
* @file rtc.h
5
* @brief This file contains all the function prototypes for
6
* the rtc.c file
7
******************************************************************************
8
* @attention
9
*
10
* Copyright (c) 2026 STMicroelectronics.
11
* All rights reserved.
12
*
13
* This software is licensed under terms that can be found in the LICENSE file
14
* in the root directory of this software component.
15
* If no LICENSE file comes with this software, it is provided AS-IS.
16
*
17
******************************************************************************
18
*/
19
/* USER CODE END Header */
20
/* Define to prevent recursive inclusion -------------------------------------*/
21
#ifndef __RTC_H__
22
#define __RTC_H__
23
24
#ifdef __cplusplus
25
extern
"C"
{
26
#endif
27
28
/* Includes ------------------------------------------------------------------*/
29
#include "
main.h
"
30
31
/* USER CODE BEGIN Includes */
32
33
/* USER CODE END Includes */
34
35
extern
RTC_HandleTypeDef
hrtc
;
36
37
/* USER CODE BEGIN Private defines */
38
39
/* USER CODE END Private defines */
40
41
/**
42
* @brief Initialise the RTC peripheral with settings generated by STM32CubeMX.
43
* Configures the prescalers, calendar format, and wakeup clock source.
44
* Called once from main(); subsequent wakeup timers are set with
45
* RTC_SetWakeupTimer_10Minutes().
46
*/
47
void
MX_RTC_Init
(
void
);
48
49
/* USER CODE BEGIN Prototypes */
50
51
/**
52
* @brief Configure the RTC periodic wakeup timer.
53
*
54
* Uses RTC_WAKEUPCLOCK_CK_SPRE_16BITS (1 Hz ck_spre derived from the RTC
55
* prescalers) so that the counter value directly represents seconds minus 1.
56
* The wakeup interrupt wakes the CPU from STOP / standby mode and triggers
57
* the next sensor measurement cycle.
58
*
59
* @note The actual wakeup period is determined by the counter value set in the
60
* implementation (currently ~60 s; original design was 600 s = 10 min).
61
* The function name is kept for backward compatibility.
62
*
63
* @return HAL_OK on success, HAL_ERROR if the timer could not be configured.
64
*/
65
HAL_StatusTypeDef
RTC_SetWakeupTimer_10Minutes
(
void
);
66
67
/* USER CODE END Prototypes */
68
69
#ifdef __cplusplus
70
}
71
#endif
72
73
#endif
/* __RTC_H__ */
74
main.h
: Header for main.c file. This file contains the common defines of the application.
RTC_SetWakeupTimer_10Minutes
HAL_StatusTypeDef RTC_SetWakeupTimer_10Minutes(void)
Configure the RTC periodic wakeup timer.
Definition
rtc.c:152
hrtc
RTC_HandleTypeDef hrtc
Definition
rtc.c:27
MX_RTC_Init
void MX_RTC_Init(void)
Initialise the RTC peripheral with settings generated by STM32CubeMX. Configures the prescalers,...
Definition
rtc.c:30
Core
Inc
rtc.h
Generated by
1.16.1