Skip to content

Commit 6f10e55

Browse files
committed
feat[driver][gd32]: Improve the RTC driver and support alarm interrupts
1 parent 1daedb0 commit 6f10e55

File tree

20 files changed

+773
-186
lines changed

20 files changed

+773
-186
lines changed

bsp/gd32/arm/gd32103c-eval/board/Kconfig

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,30 @@ menu "On-chip Peripheral Drivers"
142142
if BSP_USING_ONCHIP_RTC
143143
choice
144144
prompt "Select clock source"
145-
default BSP_RTC_USING_LSE
145+
default RTC_CLOCK_SOURCE_LXTAL
146146

147-
config BSP_RTC_USING_LSE
147+
config RTC_CLOCK_SOURCE_LXTAL
148148
bool "RTC USING LSE"
149149

150-
config BSP_RTC_USING_LSI
151-
bool "RTC USING LSI"
150+
config RCU_RTCSRC_IRC32K
151+
bool "RTC USING LSI(32K)"
152+
153+
config RCU_RTCSRC_IRC40K
154+
bool "RTC USING LSI(40K)"
152155
endchoice
156+
157+
if RT_USING_ALARM
158+
choice
159+
prompt "Select rtc alarm device"
160+
default BSP_USING_ALARM0
161+
162+
config BSP_USING_ALARM0
163+
bool "Enable RTC Alarm0"
164+
165+
config BSP_USING_ALARM1
166+
bool "Enable RTC Alarm1"
167+
endchoice
168+
endif
153169
endif
154170

155171
config BSP_USING_WDT

bsp/gd32/arm/gd32105c-eval/board/Kconfig

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,30 @@ menu "On-chip Peripheral Drivers"
138138
if BSP_USING_ONCHIP_RTC
139139
choice
140140
prompt "Select clock source"
141-
default BSP_RTC_USING_LSE
141+
default RTC_CLOCK_SOURCE_LXTAL
142142

143-
config BSP_RTC_USING_LSE
143+
config RTC_CLOCK_SOURCE_LXTAL
144144
bool "RTC USING LSE"
145145

146-
config BSP_RTC_USING_LSI
147-
bool "RTC USING LSI"
146+
config RCU_RTCSRC_IRC32K
147+
bool "RTC USING LSI(32K)"
148+
149+
config RCU_RTCSRC_IRC40K
150+
bool "RTC USING LSI(40K)"
148151
endchoice
152+
153+
if RT_USING_ALARM
154+
choice
155+
prompt "Select rtc alarm device"
156+
default BSP_USING_ALARM0
157+
158+
config BSP_USING_ALARM0
159+
bool "Enable RTC Alarm0"
160+
161+
config BSP_USING_ALARM1
162+
bool "Enable RTC Alarm1"
163+
endchoice
164+
endif
149165
endif
150166

151167
config BSP_USING_WDT

bsp/gd32/arm/gd32105r-start/board/Kconfig

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,30 @@ menu "On-chip Peripheral Drivers"
146146
if BSP_USING_ONCHIP_RTC
147147
choice
148148
prompt "Select clock source"
149-
default BSP_RTC_USING_LSE
149+
default RTC_CLOCK_SOURCE_LXTAL
150150

151-
config BSP_RTC_USING_LSE
151+
config RTC_CLOCK_SOURCE_LXTAL
152152
bool "RTC USING LSE"
153153

154-
config BSP_RTC_USING_LSI
155-
bool "RTC USING LSI"
154+
config RCU_RTCSRC_IRC32K
155+
bool "RTC USING LSI(32K)"
156+
157+
config RCU_RTCSRC_IRC40K
158+
bool "RTC USING LSI(40K)"
156159
endchoice
160+
161+
if RT_USING_ALARM
162+
choice
163+
prompt "Select rtc alarm device"
164+
default BSP_USING_ALARM0
165+
166+
config BSP_USING_ALARM0
167+
bool "Enable RTC Alarm0"
168+
169+
config BSP_USING_ALARM1
170+
bool "Enable RTC Alarm1"
171+
endchoice
172+
endif
157173
endif
158174

159175
config BSP_USING_WDT

bsp/gd32/arm/gd32107c-eval/board/Kconfig

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,30 @@ menu "On-chip Peripheral Drivers"
138138
if BSP_USING_ONCHIP_RTC
139139
choice
140140
prompt "Select clock source"
141-
default BSP_RTC_USING_LSE
141+
default RTC_CLOCK_SOURCE_LXTAL
142142

143-
config BSP_RTC_USING_LSE
143+
config RTC_CLOCK_SOURCE_LXTAL
144144
bool "RTC USING LSE"
145145

146-
config BSP_RTC_USING_LSI
147-
bool "RTC USING LSI"
146+
config RCU_RTCSRC_IRC32K
147+
bool "RTC USING LSI(32K)"
148+
149+
config RCU_RTCSRC_IRC40K
150+
bool "RTC USING LSI(40K)"
148151
endchoice
152+
153+
if RT_USING_ALARM
154+
choice
155+
prompt "Select rtc alarm device"
156+
default BSP_USING_ALARM0
157+
158+
config BSP_USING_ALARM0
159+
bool "Enable RTC Alarm0"
160+
161+
config BSP_USING_ALARM1
162+
bool "Enable RTC Alarm1"
163+
endchoice
164+
endif
149165
endif
150166

151167
config BSP_USING_WDT

bsp/gd32/arm/gd32205r-start/board/Kconfig

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,30 @@ menu "On-chip Peripheral Drivers"
142142
if BSP_USING_ONCHIP_RTC
143143
choice
144144
prompt "Select clock source"
145-
default BSP_RTC_USING_LSE
145+
default RTC_CLOCK_SOURCE_LXTAL
146146

147-
config BSP_RTC_USING_LSE
147+
config RTC_CLOCK_SOURCE_LXTAL
148148
bool "RTC USING LSE"
149149

150-
config BSP_RTC_USING_LSI
151-
bool "RTC USING LSI"
150+
config RCU_RTCSRC_IRC32K
151+
bool "RTC USING LSI(32K)"
152+
153+
config RCU_RTCSRC_IRC40K
154+
bool "RTC USING LSI(40K)"
152155
endchoice
156+
157+
if RT_USING_ALARM
158+
choice
159+
prompt "Select rtc alarm device"
160+
default BSP_USING_ALARM0
161+
162+
config BSP_USING_ALARM0
163+
bool "Enable RTC Alarm0"
164+
165+
config BSP_USING_ALARM1
166+
bool "Enable RTC Alarm1"
167+
endchoice
168+
endif
153169
endif
154170

155171
config BSP_USING_WDT

bsp/gd32/arm/gd32207i-eval/board/Kconfig

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,30 @@ menu "On-chip Peripheral Drivers"
172172
if BSP_USING_ONCHIP_RTC
173173
choice
174174
prompt "Select clock source"
175-
default BSP_RTC_USING_LSE
175+
default RTC_CLOCK_SOURCE_LXTAL
176176

177-
config BSP_RTC_USING_LSE
177+
config RTC_CLOCK_SOURCE_LXTAL
178178
bool "RTC USING LSE"
179179

180-
config BSP_RTC_USING_LSI
181-
bool "RTC USING LSI"
180+
config RCU_RTCSRC_IRC32K
181+
bool "RTC USING LSI(32K)"
182+
183+
config RCU_RTCSRC_IRC40K
184+
bool "RTC USING LSI(40K)"
182185
endchoice
186+
187+
if RT_USING_ALARM
188+
choice
189+
prompt "Select rtc alarm device"
190+
default BSP_USING_ALARM0
191+
192+
config BSP_USING_ALARM0
193+
bool "Enable RTC Alarm0"
194+
195+
config BSP_USING_ALARM1
196+
bool "Enable RTC Alarm1"
197+
endchoice
198+
endif
183199
endif
184200

185201
config BSP_USING_WDT

bsp/gd32/arm/gd32303e-eval/board/Kconfig

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,30 @@ menu "On-chip Peripheral Drivers"
142142
if BSP_USING_ONCHIP_RTC
143143
choice
144144
prompt "Select clock source"
145-
default BSP_RTC_USING_LSE
145+
default RTC_CLOCK_SOURCE_LXTAL
146146

147-
config BSP_RTC_USING_LSE
147+
config RTC_CLOCK_SOURCE_LXTAL
148148
bool "RTC USING LSE"
149149

150-
config BSP_RTC_USING_LSI
151-
bool "RTC USING LSI"
150+
config RCU_RTCSRC_IRC32K
151+
bool "RTC USING LSI(32K)"
152+
153+
config RCU_RTCSRC_IRC40K
154+
bool "RTC USING LSI(40K)"
152155
endchoice
156+
157+
if RT_USING_ALARM
158+
choice
159+
prompt "Select rtc alarm device"
160+
default BSP_USING_ALARM0
161+
162+
config BSP_USING_ALARM0
163+
bool "Enable RTC Alarm0"
164+
165+
config BSP_USING_ALARM1
166+
bool "Enable RTC Alarm1"
167+
endchoice
168+
endif
153169
endif
154170

155171
config BSP_USING_WDT

bsp/gd32/arm/gd32305r-start/board/Kconfig

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,30 @@ menu "On-chip Peripheral Drivers"
138138
if BSP_USING_ONCHIP_RTC
139139
choice
140140
prompt "Select clock source"
141-
default BSP_RTC_USING_LSE
141+
default RTC_CLOCK_SOURCE_LXTAL
142142

143-
config BSP_RTC_USING_LSE
143+
config RTC_CLOCK_SOURCE_LXTAL
144144
bool "RTC USING LSE"
145145

146-
config BSP_RTC_USING_LSI
147-
bool "RTC USING LSI"
146+
config RCU_RTCSRC_IRC32K
147+
bool "RTC USING LSI(32K)"
148+
149+
config RCU_RTCSRC_IRC40K
150+
bool "RTC USING LSI(40K)"
148151
endchoice
152+
153+
if RT_USING_ALARM
154+
choice
155+
prompt "Select rtc alarm device"
156+
default BSP_USING_ALARM0
157+
158+
config BSP_USING_ALARM0
159+
bool "Enable RTC Alarm0"
160+
161+
config BSP_USING_ALARM1
162+
bool "Enable RTC Alarm1"
163+
endchoice
164+
endif
149165
endif
150166

151167
config BSP_USING_WDT

bsp/gd32/arm/gd32307e-start/board/Kconfig

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,30 @@ menu "On-chip Peripheral Drivers"
139139
if BSP_USING_ONCHIP_RTC
140140
choice
141141
prompt "Select clock source"
142-
default BSP_RTC_USING_LSE
142+
default RTC_CLOCK_SOURCE_LXTAL
143143

144-
config BSP_RTC_USING_LSE
144+
config RTC_CLOCK_SOURCE_LXTAL
145145
bool "RTC USING LSE"
146146

147-
config BSP_RTC_USING_LSI
148-
bool "RTC USING LSI"
147+
config RCU_RTCSRC_IRC32K
148+
bool "RTC USING LSI(32K)"
149+
150+
config RCU_RTCSRC_IRC40K
151+
bool "RTC USING LSI(40K)"
149152
endchoice
153+
154+
if RT_USING_ALARM
155+
choice
156+
prompt "Select rtc alarm device"
157+
default BSP_USING_ALARM0
158+
159+
config BSP_USING_ALARM0
160+
bool "Enable RTC Alarm0"
161+
162+
config BSP_USING_ALARM1
163+
bool "Enable RTC Alarm1"
164+
endchoice
165+
endif
150166
endif
151167

152168
config BSP_USING_WDT

bsp/gd32/arm/gd32407v-lckfb/board/Kconfig

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,14 +316,30 @@ menu "On-chip Peripheral Drivers"
316316
if BSP_USING_ONCHIP_RTC
317317
choice
318318
prompt "Select clock source"
319-
default BSP_RTC_USING_LSE
319+
default RTC_CLOCK_SOURCE_LXTAL
320320

321-
config BSP_RTC_USING_LSE
321+
config RTC_CLOCK_SOURCE_LXTAL
322322
bool "RTC USING LSE"
323323

324-
config BSP_RTC_USING_LSI
325-
bool "RTC USING LSI"
324+
config RCU_RTCSRC_IRC32K
325+
bool "RTC USING LSI(32K)"
326+
327+
config RCU_RTCSRC_IRC40K
328+
bool "RTC USING LSI(40K)"
326329
endchoice
330+
331+
if RT_USING_ALARM
332+
choice
333+
prompt "Select rtc alarm device"
334+
default BSP_USING_ALARM0
335+
336+
config BSP_USING_ALARM0
337+
bool "Enable RTC Alarm0"
338+
339+
config BSP_USING_ALARM1
340+
bool "Enable RTC Alarm1"
341+
endchoice
342+
endif
327343
endif
328344

329345
config BSP_USING_WDT

0 commit comments

Comments
 (0)