Skip to content

Commit 4f7bc8c

Browse files
kurisaWRbb666
authored andcommitted
feat[driver][gd32]: Improve the RTC driver and support alarm interrupts
1 parent 273185b commit 4f7bc8c

File tree

20 files changed

+632
-288
lines changed

20 files changed

+632
-288
lines changed

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,22 @@ menu "On-chip Peripheral Drivers"
140140
select RT_USING_RTC
141141
default n
142142
if BSP_USING_ONCHIP_RTC
143-
choice
144-
prompt "Select clock source"
145-
default BSP_RTC_USING_LSE
146-
147-
config BSP_RTC_USING_LSE
148-
bool "RTC USING LSE"
149-
150-
config BSP_RTC_USING_LSI
151-
bool "RTC USING LSI"
152-
endchoice
143+
config BSP_USING_ALARM
144+
bool "Enable RTC alarm"
145+
select RT_USING_ALARM
146+
default n
147+
if BSP_USING_ALARM
148+
choice
149+
prompt "Select rtc alarm device"
150+
default BSP_USING_ALARM0
151+
152+
config BSP_USING_ALARM0
153+
bool "Enable RTC Alarm0"
154+
155+
config BSP_USING_ALARM1
156+
bool "Enable RTC Alarm1"
157+
endchoice
158+
endif
153159
endif
154160

155161
config BSP_USING_WDT

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,22 @@ menu "On-chip Peripheral Drivers"
136136
select RT_USING_RTC
137137
default n
138138
if BSP_USING_ONCHIP_RTC
139-
choice
140-
prompt "Select clock source"
141-
default BSP_RTC_USING_LSE
142-
143-
config BSP_RTC_USING_LSE
144-
bool "RTC USING LSE"
145-
146-
config BSP_RTC_USING_LSI
147-
bool "RTC USING LSI"
148-
endchoice
139+
config BSP_USING_ALARM
140+
bool "Enable RTC alarm"
141+
select RT_USING_ALARM
142+
default n
143+
if BSP_USING_ALARM
144+
choice
145+
prompt "Select rtc alarm device"
146+
default BSP_USING_ALARM0
147+
148+
config BSP_USING_ALARM0
149+
bool "Enable RTC Alarm0"
150+
151+
config BSP_USING_ALARM1
152+
bool "Enable RTC Alarm1"
153+
endchoice
154+
endif
149155
endif
150156

151157
config BSP_USING_WDT

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,22 @@ menu "On-chip Peripheral Drivers"
144144
select RT_USING_RTC
145145
default n
146146
if BSP_USING_ONCHIP_RTC
147-
choice
148-
prompt "Select clock source"
149-
default BSP_RTC_USING_LSE
150-
151-
config BSP_RTC_USING_LSE
152-
bool "RTC USING LSE"
153-
154-
config BSP_RTC_USING_LSI
155-
bool "RTC USING LSI"
156-
endchoice
147+
config BSP_USING_ALARM
148+
bool "Enable RTC alarm"
149+
select RT_USING_ALARM
150+
default n
151+
if BSP_USING_ALARM
152+
choice
153+
prompt "Select rtc alarm device"
154+
default BSP_USING_ALARM0
155+
156+
config BSP_USING_ALARM0
157+
bool "Enable RTC Alarm0"
158+
159+
config BSP_USING_ALARM1
160+
bool "Enable RTC Alarm1"
161+
endchoice
162+
endif
157163
endif
158164

159165
config BSP_USING_WDT

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,22 @@ menu "On-chip Peripheral Drivers"
136136
select RT_USING_RTC
137137
default n
138138
if BSP_USING_ONCHIP_RTC
139-
choice
140-
prompt "Select clock source"
141-
default BSP_RTC_USING_LSE
142-
143-
config BSP_RTC_USING_LSE
144-
bool "RTC USING LSE"
145-
146-
config BSP_RTC_USING_LSI
147-
bool "RTC USING LSI"
148-
endchoice
139+
config BSP_USING_ALARM
140+
bool "Enable RTC alarm"
141+
select RT_USING_ALARM
142+
default n
143+
if BSP_USING_ALARM
144+
choice
145+
prompt "Select rtc alarm device"
146+
default BSP_USING_ALARM0
147+
148+
config BSP_USING_ALARM0
149+
bool "Enable RTC Alarm0"
150+
151+
config BSP_USING_ALARM1
152+
bool "Enable RTC Alarm1"
153+
endchoice
154+
endif
149155
endif
150156

151157
config BSP_USING_WDT

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,22 @@ menu "On-chip Peripheral Drivers"
140140
select RT_USING_RTC
141141
default n
142142
if BSP_USING_ONCHIP_RTC
143-
choice
144-
prompt "Select clock source"
145-
default BSP_RTC_USING_LSE
146-
147-
config BSP_RTC_USING_LSE
148-
bool "RTC USING LSE"
149-
150-
config BSP_RTC_USING_LSI
151-
bool "RTC USING LSI"
152-
endchoice
143+
config BSP_USING_ALARM
144+
bool "Enable RTC alarm"
145+
select RT_USING_ALARM
146+
default n
147+
if BSP_USING_ALARM
148+
choice
149+
prompt "Select rtc alarm device"
150+
default BSP_USING_ALARM0
151+
152+
config BSP_USING_ALARM0
153+
bool "Enable RTC Alarm0"
154+
155+
config BSP_USING_ALARM1
156+
bool "Enable RTC Alarm1"
157+
endchoice
158+
endif
153159
endif
154160

155161
config BSP_USING_WDT

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,22 @@ menu "On-chip Peripheral Drivers"
170170
select RT_USING_RTC
171171
default n
172172
if BSP_USING_ONCHIP_RTC
173-
choice
174-
prompt "Select clock source"
175-
default BSP_RTC_USING_LSE
176-
177-
config BSP_RTC_USING_LSE
178-
bool "RTC USING LSE"
179-
180-
config BSP_RTC_USING_LSI
181-
bool "RTC USING LSI"
182-
endchoice
173+
config BSP_USING_ALARM
174+
bool "Enable RTC alarm"
175+
select RT_USING_ALARM
176+
default n
177+
if BSP_USING_ALARM
178+
choice
179+
prompt "Select rtc alarm device"
180+
default BSP_USING_ALARM0
181+
182+
config BSP_USING_ALARM0
183+
bool "Enable RTC Alarm0"
184+
185+
config BSP_USING_ALARM1
186+
bool "Enable RTC Alarm1"
187+
endchoice
188+
endif
183189
endif
184190

185191
config BSP_USING_WDT

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,22 @@ menu "On-chip Peripheral Drivers"
140140
select RT_USING_RTC
141141
default n
142142
if BSP_USING_ONCHIP_RTC
143-
choice
144-
prompt "Select clock source"
145-
default BSP_RTC_USING_LSE
146-
147-
config BSP_RTC_USING_LSE
148-
bool "RTC USING LSE"
149-
150-
config BSP_RTC_USING_LSI
151-
bool "RTC USING LSI"
152-
endchoice
143+
config BSP_USING_ALARM
144+
bool "Enable RTC alarm"
145+
select RT_USING_ALARM
146+
default n
147+
if BSP_USING_ALARM
148+
choice
149+
prompt "Select rtc alarm device"
150+
default BSP_USING_ALARM0
151+
152+
config BSP_USING_ALARM0
153+
bool "Enable RTC Alarm0"
154+
155+
config BSP_USING_ALARM1
156+
bool "Enable RTC Alarm1"
157+
endchoice
158+
endif
153159
endif
154160

155161
config BSP_USING_WDT

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,22 @@ menu "On-chip Peripheral Drivers"
136136
select RT_USING_RTC
137137
default n
138138
if BSP_USING_ONCHIP_RTC
139-
choice
140-
prompt "Select clock source"
141-
default BSP_RTC_USING_LSE
142-
143-
config BSP_RTC_USING_LSE
144-
bool "RTC USING LSE"
145-
146-
config BSP_RTC_USING_LSI
147-
bool "RTC USING LSI"
148-
endchoice
139+
config BSP_USING_ALARM
140+
bool "Enable RTC alarm"
141+
select RT_USING_ALARM
142+
default n
143+
if BSP_USING_ALARM
144+
choice
145+
prompt "Select rtc alarm device"
146+
default BSP_USING_ALARM0
147+
148+
config BSP_USING_ALARM0
149+
bool "Enable RTC Alarm0"
150+
151+
config BSP_USING_ALARM1
152+
bool "Enable RTC Alarm1"
153+
endchoice
154+
endif
149155
endif
150156

151157
config BSP_USING_WDT

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,22 @@ menu "On-chip Peripheral Drivers"
137137
select RT_USING_RTC
138138
default n
139139
if BSP_USING_ONCHIP_RTC
140-
choice
141-
prompt "Select clock source"
142-
default BSP_RTC_USING_LSE
143-
144-
config BSP_RTC_USING_LSE
145-
bool "RTC USING LSE"
146-
147-
config BSP_RTC_USING_LSI
148-
bool "RTC USING LSI"
149-
endchoice
140+
config BSP_USING_ALARM
141+
bool "Enable RTC alarm"
142+
select RT_USING_ALARM
143+
default n
144+
if BSP_USING_ALARM
145+
choice
146+
prompt "Select rtc alarm device"
147+
default BSP_USING_ALARM0
148+
149+
config BSP_USING_ALARM0
150+
bool "Enable RTC Alarm0"
151+
152+
config BSP_USING_ALARM1
153+
bool "Enable RTC Alarm1"
154+
endchoice
155+
endif
150156
endif
151157

152158
config BSP_USING_WDT

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -314,16 +314,22 @@ menu "On-chip Peripheral Drivers"
314314
select RT_USING_RTC
315315
default n
316316
if BSP_USING_ONCHIP_RTC
317-
choice
318-
prompt "Select clock source"
319-
default BSP_RTC_USING_LSE
320-
321-
config BSP_RTC_USING_LSE
322-
bool "RTC USING LSE"
323-
324-
config BSP_RTC_USING_LSI
325-
bool "RTC USING LSI"
326-
endchoice
317+
config BSP_USING_ALARM
318+
bool "Enable RTC alarm"
319+
select RT_USING_ALARM
320+
default n
321+
if BSP_USING_ALARM
322+
choice
323+
prompt "Select rtc alarm device"
324+
default BSP_USING_ALARM0
325+
326+
config BSP_USING_ALARM0
327+
bool "Enable RTC Alarm0"
328+
329+
config BSP_USING_ALARM1
330+
bool "Enable RTC Alarm1"
331+
endchoice
332+
endif
327333
endif
328334

329335
config BSP_USING_WDT

0 commit comments

Comments
 (0)