From e9361d5822a29306cd9a389fab7d809e8de4b4c8 Mon Sep 17 00:00:00 2001 From: jzlv Date: Wed, 25 Aug 2021 17:06:13 +0800 Subject: [PATCH] [refactor] rename some macro names in xxx_config.h --- bsp/board/bl602/bl602_iot/clock_config.h | 5 ++--- bsp/board/bl702/bl702_config.h | 14 +++++++------- bsp/board/bl702/bl706_avb/clock_config.h | 6 +++++- bsp/board/bl702/bl706_avb/peripheral_config.h | 14 ++++++++++++++ bsp/board/bl702/bl706_iot/clock_config.h | 7 ++++++- bsp/board/bl702/bl706_iot/peripheral_config.h | 14 ++++++++++++++ bsp/board/bl702/bl706_lp/clock_config.h | 4 ++-- bsp/board/bl702/bl706_lp/peripheral_config.h | 13 ------------- bsp/board/bl702/bl706_lp/pinmux_config.h | 12 ++++++------ 9 files changed, 56 insertions(+), 33 deletions(-) diff --git a/bsp/board/bl602/bl602_iot/clock_config.h b/bsp/board/bl602/bl602_iot/clock_config.h index b4c333c4..e50f297a 100644 --- a/bsp/board/bl602/bl602_iot/clock_config.h +++ b/bsp/board/bl602/bl602_iot/clock_config.h @@ -24,12 +24,11 @@ #ifndef _CLOCK_CONFIG_H #define _CLOCK_CONFIG_H +#define XTAL_TYPE EXTERNAL_XTAL_40M #define BSP_ROOT_CLOCK_SOURCE ROOT_CLOCK_SOURCE_PLL_160M -#if defined(BSP_ROOT_CLOCK_SOURCE) -#define BSP_HCLK_DIV 0 +#define BSP_FCLK_DIV 0 #define BSP_BCLK_DIV 1 -#endif #if defined(BSP_USING_UART0) || defined(BSP_USING_UART1) #define BSP_UART_CLOCK_SOURCE ROOT_CLOCK_SOURCE_PLL_160M diff --git a/bsp/board/bl702/bl702_config.h b/bsp/board/bl702/bl702_config.h index 082298ee..c85f17e8 100644 --- a/bsp/board/bl702/bl702_config.h +++ b/bsp/board/bl702/bl702_config.h @@ -36,14 +36,14 @@ #include "bl706_lp/peripheral_config.h" #include "bl706_lp/clock_config.h" #include "bl706_lp/pinmux_config.h" -#elif defined(bl702_iot) -#include "bl702_iot/peripheral_config.h" -#include "bl702_iot/clock_config.h" -#include "bl702_iot/pinmux_config.h" +#elif defined(bl702_boot2) +#include "bl702_boot2/peripheral_config.h" +#include "bl702_boot2/clock_config.h" +#include "bl702_boot2/pinmux_config.h" #else -#include "bl70x_custom/peripheral_config.h" -#include "bl70x_custom/clock_config.h" -#include "bl70x_custom/pinmux_config.h" +#include "bl702_custom/peripheral_config.h" +#include "bl702_custom/clock_config.h" +#include "bl702_custom/pinmux_config.h" #endif #endif \ No newline at end of file diff --git a/bsp/board/bl702/bl706_avb/clock_config.h b/bsp/board/bl702/bl706_avb/clock_config.h index fde7f4a9..5a426a75 100644 --- a/bsp/board/bl702/bl706_avb/clock_config.h +++ b/bsp/board/bl702/bl706_avb/clock_config.h @@ -24,7 +24,7 @@ #ifndef _CLOCK_CONFIG_H #define _CLOCK_CONFIG_H -#define CLOCK_XTAL EXTERNAL_XTAL_32M +#define XTAL_TYPE EXTERNAL_XTAL_32M #define BSP_ROOT_CLOCK_SOURCE ROOT_CLOCK_SOURCE_PLL_144M #define BSP_AUDIO_PLL_CLOCK_SOURCE ROOT_CLOCK_SOURCE_AUPLL_24000000_HZ @@ -51,6 +51,10 @@ #define BSP_TIMER1_CLOCK_SOURCE ROOT_CLOCK_SOURCE_FCLK #define BSP_TIMER1_CLOCK_DIV 0 #endif +#if defined(BSP_USING_WDT) +#define BSP_WDT_CLOCK_SOURCE ROOT_CLOCK_SOURCE_FCLK +#define BSP_WDT_CLOCK_DIV 0 +#endif #if defined(BSP_USING_PWM_CH0) || defined(BSP_USING_PWM_CH1) || defined(BSP_USING_PWM_CH2) || defined(BSP_USING_PWM_CH3) || defined(BSP_USING_PWM_CH4) || defined(BSP_USING_PWM_CH5) #define BSP_PWM_CLOCK_SOURCE ROOT_CLOCK_SOURCE_XCLK #define BSP_PWM_CLOCK_DIV 0 diff --git a/bsp/board/bl702/bl706_avb/peripheral_config.h b/bsp/board/bl702/bl706_avb/peripheral_config.h index 4bbc85e1..dbc5b868 100644 --- a/bsp/board/bl702/bl706_avb/peripheral_config.h +++ b/bsp/board/bl702/bl706_avb/peripheral_config.h @@ -40,6 +40,7 @@ #define BSP_USING_QDEC0 #define BSP_USING_QDEC1 #define BSP_USING_QDEC2 +#define BSP_USING_WDT /* ----------------------*/ /* PERIPHERAL With DMA LIST */ @@ -365,6 +366,16 @@ #endif #endif +#if defined(BSP_USING_WDT) +#ifndef WDT_CONFIG +#define WDT_CONFIG \ + { \ + .id = 0, \ + .wdt_timeout = 6000, \ + } +#endif +#endif + #if defined(BSP_USING_KEYSCAN) #ifndef KEYSCAN_CONFIG #define KEYSCAN_CONFIG \ @@ -382,6 +393,7 @@ { \ .id = 0, \ .acc_mode = QDEC_ACC_CONTINUE_ACCUMULATE, \ + .sample_mode = QDEC_SAMPLE_SINGLE_MOD, \ .sample_period = QDEC_SAMPLE_PERIOD_256US, \ .report_mode = QDEC_REPORT_TIME_MOD, \ .report_period = 2000, \ @@ -400,6 +412,7 @@ { \ .id = 1, \ .acc_mode = QDEC_ACC_CONTINUE_ACCUMULATE, \ + .sample_mode = QDEC_SAMPLE_SINGLE_MOD, \ .sample_period = QDEC_SAMPLE_PERIOD_256US, \ .report_mode = QDEC_REPORT_TIME_MOD, \ .report_period = 2000, \ @@ -418,6 +431,7 @@ { \ .id = 2, \ .acc_mode = QDEC_ACC_CONTINUE_ACCUMULATE, \ + .sample_mode = QDEC_SAMPLE_SINGLE_MOD, \ .sample_period = QDEC_SAMPLE_PERIOD_256US, \ .report_mode = QDEC_REPORT_TIME_MOD, \ .report_period = 2000, \ diff --git a/bsp/board/bl702/bl706_iot/clock_config.h b/bsp/board/bl702/bl706_iot/clock_config.h index 0c574a04..77117c75 100644 --- a/bsp/board/bl702/bl706_iot/clock_config.h +++ b/bsp/board/bl702/bl706_iot/clock_config.h @@ -24,7 +24,8 @@ #ifndef _CLOCK_CONFIG_H #define _CLOCK_CONFIG_H -#define CLOCK_XTAL EXTERNAL_XTAL_32M +#define XTAL_TYPE EXTERNAL_XTAL_32M +#define XTAL_32K_TYPE INTERNAL_RC_32K #define BSP_ROOT_CLOCK_SOURCE ROOT_CLOCK_SOURCE_PLL_144M #define BSP_AUDIO_PLL_CLOCK_SOURCE ROOT_CLOCK_SOURCE_AUPLL_24000000_HZ @@ -51,6 +52,10 @@ #define BSP_TIMER1_CLOCK_SOURCE ROOT_CLOCK_SOURCE_FCLK #define BSP_TIMER1_CLOCK_DIV 0 #endif +#if defined(BSP_USING_WDT) +#define BSP_WDT_CLOCK_SOURCE ROOT_CLOCK_SOURCE_FCLK +#define BSP_WDT_CLOCK_DIV 0 +#endif #if defined(BSP_USING_PWM_CH0) || defined(BSP_USING_PWM_CH1) || defined(BSP_USING_PWM_CH2) || defined(BSP_USING_PWM_CH3) || defined(BSP_USING_PWM_CH4) || defined(BSP_USING_PWM_CH5) #define BSP_PWM_CLOCK_SOURCE ROOT_CLOCK_SOURCE_32K_CLK #define BSP_PWM_CLOCK_DIV 32 diff --git a/bsp/board/bl702/bl706_iot/peripheral_config.h b/bsp/board/bl702/bl706_iot/peripheral_config.h index 94674f32..690e0d0a 100644 --- a/bsp/board/bl702/bl706_iot/peripheral_config.h +++ b/bsp/board/bl702/bl706_iot/peripheral_config.h @@ -43,6 +43,7 @@ #define BSP_USING_QDEC0 #define BSP_USING_QDEC1 #define BSP_USING_QDEC2 +#define BSP_USING_WDT /* ----------------------*/ /* PERIPHERAL With DMA LIST */ @@ -368,6 +369,16 @@ #endif #endif +#if defined(BSP_USING_WDT) +#ifndef WDT_CONFIG +#define WDT_CONFIG \ + { \ + .id = 0, \ + .wdt_timeout = 6000, \ + } +#endif +#endif + #if defined(BSP_USING_KEYSCAN) #ifndef KEYSCAN_CONFIG #define KEYSCAN_CONFIG \ @@ -385,6 +396,7 @@ { \ .id = 0, \ .acc_mode = QDEC_ACC_CONTINUE_ACCUMULATE, \ + .sample_mode = QDEC_SAMPLE_SINGLE_MOD, \ .sample_period = QDEC_SAMPLE_PERIOD_256US, \ .report_mode = QDEC_REPORT_TIME_MOD, \ .report_period = 2000, \ @@ -403,6 +415,7 @@ { \ .id = 1, \ .acc_mode = QDEC_ACC_CONTINUE_ACCUMULATE, \ + .sample_mode = QDEC_SAMPLE_SINGLE_MOD, \ .sample_period = QDEC_SAMPLE_PERIOD_256US, \ .report_mode = QDEC_REPORT_TIME_MOD, \ .report_period = 2000, \ @@ -421,6 +434,7 @@ { \ .id = 2, \ .acc_mode = QDEC_ACC_CONTINUE_ACCUMULATE, \ + .sample_mode = QDEC_SAMPLE_SINGLE_MOD, \ .sample_period = QDEC_SAMPLE_PERIOD_256US, \ .report_mode = QDEC_REPORT_TIME_MOD, \ .report_period = 2000, \ diff --git a/bsp/board/bl702/bl706_lp/clock_config.h b/bsp/board/bl702/bl706_lp/clock_config.h index e9386369..d62bfe49 100644 --- a/bsp/board/bl702/bl706_lp/clock_config.h +++ b/bsp/board/bl702/bl706_lp/clock_config.h @@ -24,8 +24,8 @@ #ifndef _CLOCK_CONFIG_H #define _CLOCK_CONFIG_H -#define CLOCK_XTAL EXTERNAL_XTAL_32M -#define BSP_ROOT_CLOCK_SOURCE ROOT_CLOCK_SOURCE_XTAL_32M +#define XTAL_TYPE EXTERNAL_XTAL_32M +#define BSP_ROOT_CLOCK_SOURCE ROOT_CLOCK_SOURCE_PLL_144M #define BSP_AUDIO_PLL_CLOCK_SOURCE ROOT_CLOCK_SOURCE_AUPLL_24000000_HZ #define BSP_FCLK_DIV 0 diff --git a/bsp/board/bl702/bl706_lp/peripheral_config.h b/bsp/board/bl702/bl706_lp/peripheral_config.h index e777ee9d..9b370a39 100644 --- a/bsp/board/bl702/bl706_lp/peripheral_config.h +++ b/bsp/board/bl702/bl706_lp/peripheral_config.h @@ -25,20 +25,7 @@ #define _PERIPHERAL_CONFIG_H_ /* PERIPHERAL USING LIST */ -// #define BSP_USING_ADC0 -// #define BSP_USING_DAC0 #define BSP_USING_UART0 -// #define BSP_USING_UART1 -// #define BSP_USING_SPI0 -// #define BSP_USING_I2C0 -// #define BSP_USING_I2S0 -// #define BSP_USING_USB -// #define BSP_USING_PWM_CH0 -// #define BSP_USING_PWM_CH1 -// #define BSP_USING_PWM_CH2 -// #define BSP_USING_PWM_CH3 -// #define BSP_USING_TIMER_CH0 -// #define BSP_USING_TIMER_CH1 /* ----------------------*/ /* PERIPHERAL With DMA LIST */ diff --git a/bsp/board/bl702/bl706_lp/pinmux_config.h b/bsp/board/bl702/bl706_lp/pinmux_config.h index 2a56ae69..715fd433 100644 --- a/bsp/board/bl702/bl706_lp/pinmux_config.h +++ b/bsp/board/bl702/bl706_lp/pinmux_config.h @@ -51,15 +51,15 @@ // GPIO6 <2> [GPIO_FUN_UNUSED//GPIO_FUN_CLK_OUT//GPIO_FUN_I2S//GPIO_FUN_SPI//GPIO_FUN_I2C//GPIO_FUN_PWM//GPIO_FUN_CAM//GPIO_FUN_UART0_TX//GPIO_FUN_UART1_TX//GPIO_FUN_QDEC] // config gpio6 function -#define CONFIG_GPIO6_FUNC GPIO_FUN_UNUSED +#define CONFIG_GPIO6_FUNC GPIO_FUN_WAKEUP // GPIO7 <2> [GPIO_FUN_UNUSED//GPIO_FUN_I2S//GPIO_FUN_SPI//GPIO_FUN_I2C//GPIO_FUN_PWM//GPIO_FUN_USB//GPIO_FUN_ADC//GPIO_FUN_UART0_RX//GPIO_FUN_UART1_RX//GPIO_FUN_ETHER_MAC//GPIO_FUN_QDEC] // config gpio7 function -#define CONFIG_GPIO7_FUNC GPIO_FUN_USB +#define CONFIG_GPIO7_FUNC GPIO_FUN_UNUSED // GPIO8 <2> [GPIO_FUN_UNUSED//GPIO_FUN_I2S//GPIO_FUN_SPI//GPIO_FUN_I2C//GPIO_FUN_PWM//GPIO_FUN_USB//GPIO_FUN_ADC//GPIO_FUN_UART0_RTS//GPIO_FUN_UART1_RTS//GPIO_FUN_ETHER_MAC//GPIO_FUN_QDEC] // config gpio8 function -#define CONFIG_GPIO8_FUNC GPIO_FUN_USB +#define CONFIG_GPIO8_FUNC GPIO_FUN_UNUSED // GPIO9 <2> [GPIO_FUN_UNUSED//GPIO_FUN_I2S//GPIO_FUN_SPI//GPIO_FUN_I2C//GPIO_FUN_PWM//GPIO_FUN_ADC//GPIO_FUN_UART0_RTS//GPIO_FUN_UART1_RTS//GPIO_FUN_QDEC] // config gpio9 function @@ -67,15 +67,15 @@ // GPIO10 <2> [GPIO_FUN_UNUSED//GPIO_FUN_I2S//GPIO_FUN_SPI//GPIO_FUN_I2C//GPIO_FUN_PWM//GPIO_FUN_ANALOG//GPIO_FUN_UART0_RTS//GPIO_FUN_UART1_RTS//GPIO_FUN_QDEC] // config gpio10 function -#define CONFIG_GPIO10_FUNC GPIO_FUN_UNUSED +#define CONFIG_GPIO10_FUNC GPIO_FUN_GPIO_EXTI_FALLING_EDGE // GPIO11 <2> [GPIO_FUN_UNUSED//GPIO_FUN_I2S//GPIO_FUN_SPI//GPIO_FUN_I2C//GPIO_FUN_PWM//GPIO_FUN_ADC//GPIO_FUN_UART0_RTS//GPIO_FUN_UART1_RTS//GPIO_FUN_QDEC] // config gpio11 function -#define CONFIG_GPIO11_FUNC GPIO_FUN_UNUSED +#define CONFIG_GPIO11_FUNC GPIO_FUN_ADC // GPIO12 <2> [GPIO_FUN_UNUSED//GPIO_FUN_I2S//GPIO_FUN_SPI//GPIO_FUN_I2C//GPIO_FUN_PWM//GPIO_FUN_CAM//GPIO_FUN_ADC//GPIO_FUN_UART0_RTS//GPIO_FUN_UART1_RTS//GPIO_FUN_QDEC] // config gpio12 function -#define CONFIG_GPIO12_FUNC GPIO_FUN_UNUSED +#define CONFIG_GPIO12_FUNC GPIO_FUN_WAKEUP // GPIO13 <2> [GPIO_FUN_UNUSED//GPIO_FUN_I2S//GPIO_FUN_SPI//GPIO_FUN_I2C//GPIO_FUN_PWM//GPIO_FUN_UART0_RTS//GPIO_FUN_UART1_RTS//GPIO_FUN_QDEC] // config gpio13 function