File tree Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,12 @@ It is possible to use it thanks all alarm API with an extra argument:
153
153
rtc.enableAlarm(rtc.MATCH_DHHMMSS, STM32RTC::ALARM_B);
154
154
```
155
155
156
+ ### Since STM32RTC version higher than 1.3.7
157
+ _ Get the RTC handle_
158
+
159
+ * ** ` RTC_HandleTypeDef *RTC_GetHandle(void) ` **
160
+
161
+
156
162
Refer to the Arduino RTC documentation for the other functions
157
163
http://arduino.cc/en/Reference/RTC
158
164
Original file line number Diff line number Diff line change @@ -132,6 +132,12 @@ class STM32RTC {
132
132
133
133
void end (void );
134
134
135
+ // Could be used to mix Arduino API and STM32Cube HAL API (ex: DMA). Use at your own risk.
136
+ RTC_HandleTypeDef *getHandle (void )
137
+ {
138
+ return RTC_GetHandle ();
139
+ }
140
+
135
141
Source_Clock getClockSource (void );
136
142
void setClockSource (Source_Clock source, uint32_t predivA = (PREDIVA_MAX + 1 ), uint32_t predivS = (PREDIVS_MAX + 1 ));
137
143
void getPrediv (uint32_t *predivA, uint32_t *predivS);
Original file line number Diff line number Diff line change @@ -98,6 +98,15 @@ static inline int _log2(int x)
98
98
99
99
/* Exported functions --------------------------------------------------------*/
100
100
101
+ /**
102
+ * @brief Get pointer to RTC_HandleTypeDef
103
+ * @param None
104
+ * @retval pointer to RTC_HandleTypeDef
105
+ */
106
+ RTC_HandleTypeDef * RTC_GetHandle (void ) {
107
+ return & RtcHandle ;
108
+ }
109
+
101
110
/**
102
111
* @brief Set RTC clock source
103
112
* @param source: RTC clock source: LSE, LSI or HSE
Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ typedef void(*voidCallbackPtr)(void *);
173
173
174
174
/* Exported macro ------------------------------------------------------------*/
175
175
/* Exported functions ------------------------------------------------------- */
176
+ RTC_HandleTypeDef * RTC_GetHandle (void );
176
177
void RTC_SetClockSource (sourceClock_t source );
177
178
void RTC_getPrediv (uint32_t * asynch , uint32_t * synch );
178
179
void RTC_setPrediv (uint32_t asynch , uint32_t synch );
You can’t perform that action at this time.
0 commit comments