mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-28 16:14:20 +08:00
feat[driver][gd32]: Improve the RTC driver and support alarm interrupts
This commit is contained in:
@@ -140,16 +140,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -136,16 +136,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -144,16 +144,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -136,16 +136,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -140,16 +140,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -170,16 +170,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -140,16 +140,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -136,16 +136,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -137,16 +137,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -314,16 +314,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -294,16 +294,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -362,16 +362,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -355,16 +355,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -377,16 +377,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -324,16 +324,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -176,6 +176,7 @@ menu "On-chip Peripheral Drivers"
|
||||
Fast mode: 400000 (400KHz)
|
||||
Fast mode plus: 1000000 (1MHz)
|
||||
endif
|
||||
endmenu
|
||||
|
||||
menuconfig BSP_USING_ADC
|
||||
bool "Enable ADC"
|
||||
@@ -206,16 +207,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select RTC clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC using LSE (External Crystal)"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC using LSI (Internal RC)"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -157,16 +157,22 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
|
||||
@@ -69,6 +69,29 @@ menu "On-chip Peripheral Drivers"
|
||||
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_ONCHIP_RTC
|
||||
bool "Enable RTC"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
config BSP_USING_ALARM
|
||||
bool "Enable RTC alarm"
|
||||
select RT_USING_ALARM
|
||||
default n
|
||||
if BSP_USING_ALARM
|
||||
choice
|
||||
prompt "Select rtc alarm device"
|
||||
default BSP_USING_ALARM0
|
||||
|
||||
config BSP_USING_ALARM0
|
||||
bool "Enable RTC Alarm0"
|
||||
|
||||
config BSP_USING_ALARM1
|
||||
bool "Enable RTC Alarm1"
|
||||
endchoice
|
||||
endif
|
||||
endif
|
||||
|
||||
source "$(BSP_DIR)/../libraries/gd32_drivers/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -18,8 +18,8 @@ if GetDepend(['RT_USING_SERIAL']):
|
||||
src += ['drv_usart_v2.c']
|
||||
else:
|
||||
src += ['drv_usart.c']
|
||||
|
||||
# add i2c hard drivers.
|
||||
|
||||
# add i2c hard drivers.
|
||||
if GetDepend(['RT_USING_I2C']):
|
||||
if GetDepend('BSP_USING_HARD_I2C0') or GetDepend('BSP_USING_HARD_I2C1') or GetDepend('BSP_USING_HARD_I2C2') or GetDepend('BSP_USING_HARD_I2C3') or GetDepend('BSP_USING_HARD_I2C4') or GetDepend('BSP_USING_HARD_I2C5'):
|
||||
src += ['drv_hard_i2c.c']
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user