1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/gd32v: move board dependent RTT configs to board config

This commit is contained in:
Gunar Schorcht 2023-01-29 17:34:27 +01:00
parent d187b2fc98
commit e387019076
2 changed files with 20 additions and 16 deletions

View File

@ -34,6 +34,23 @@ extern "C" {
#define CLOCK_APB1 CLOCK_AHB/2 /**< Half AHB clock */
#define CLOCK_APB2 CLOCK_AHB /**< Equal to the AHB clock */
/**
* @name RTT/RTC configuration
* @{
*/
#if CONFIG_BOARD_HAS_LXTAL
#define RTT_CLOCK_FREQUENCY (32768U) /**< Low frequency XTAL is used as clock source */
#else
#define RTT_CLOCK_FREQUENCY (40000U) /**< IRC40K is used as clock source */
#endif
#define RTT_MAX_FREQUENCY (RTT_CLOCK_FREQUENCY) /* maximum RTT frequency in Hz */
#ifndef RTT_FREQUENCY
#define RTT_FREQUENCY (RTT_MAX_FREQUENCY) /* RTT frequency in Hz */
#endif
/** @} */
#ifdef __cplusplus
}
#endif

View File

@ -306,27 +306,16 @@ typedef struct {
/**
* @name RTT/RTC configuration
*
* @{
*/
#define RTT_DEV RTC /**< RTC is used as RTT device */
#define RTT_IRQ RTC_ALARM_IRQn /**< RTC_ALARM_IRQn is used as IRQ number */
#define RTT_IRQ_PRIORITY (2) /**< RTT interrupt priority */
#define RTT_MAX_VALUE (0xffffffff) /**< maximum RTT value */
#if CONFIG_BOARD_HAS_LXTAL
#define RTT_CLOCK_FREQUENCY (32768U) /**< Low frequency XTAL is used as clock source */
#else
#define RTT_CLOCK_FREQUENCY (40000U) /**< IRC40K is used as clock source */
#endif
#define RTT_MIN_FREQUENCY (1U) /* in Hz */
#define RTT_MAX_FREQUENCY (RTT_CLOCK_FREQUENCY) /* in Hz */
#define RTT_MAX_VALUE (0xffffffff)
#ifndef RTT_FREQUENCY
#define RTT_FREQUENCY (RTT_MAX_FREQUENCY) /* in Hz */
#endif
#define RTT_MIN_FREQUENCY (1U) /**< minimum RTT frequency in Hz */
/** @} */
/**
* @brief Enable the given peripheral clock
@ -365,8 +354,6 @@ void gd32vf103_clock_init(void);
void gd32v_enable_irc8(void);
void gd32v_disable_irc8(void);
/** @} */
#ifdef __cplusplus
}
#endif