[refactor] rename some macro names in xxx_config.h

This commit is contained in:
jzlv 2021-08-25 17:06:13 +08:00
parent 93dcb73dc4
commit e9361d5822
9 changed files with 56 additions and 33 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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, \

View file

@ -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

View file

@ -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, \

View file

@ -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

View file

@ -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 */

View file

@ -51,15 +51,15 @@
// <q> 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]
// <i> config gpio6 function
#define CONFIG_GPIO6_FUNC GPIO_FUN_UNUSED
#define CONFIG_GPIO6_FUNC GPIO_FUN_WAKEUP
// <q> 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]
// <i> config gpio7 function
#define CONFIG_GPIO7_FUNC GPIO_FUN_USB
#define CONFIG_GPIO7_FUNC GPIO_FUN_UNUSED
// <q> 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]
// <i> config gpio8 function
#define CONFIG_GPIO8_FUNC GPIO_FUN_USB
#define CONFIG_GPIO8_FUNC GPIO_FUN_UNUSED
// <q> 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]
// <i> config gpio9 function
@ -67,15 +67,15 @@
// <q> 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]
// <i> config gpio10 function
#define CONFIG_GPIO10_FUNC GPIO_FUN_UNUSED
#define CONFIG_GPIO10_FUNC GPIO_FUN_GPIO_EXTI_FALLING_EDGE
// <q> 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]
// <i> config gpio11 function
#define CONFIG_GPIO11_FUNC GPIO_FUN_UNUSED
#define CONFIG_GPIO11_FUNC GPIO_FUN_ADC
// <q> 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]
// <i> config gpio12 function
#define CONFIG_GPIO12_FUNC GPIO_FUN_UNUSED
#define CONFIG_GPIO12_FUNC GPIO_FUN_WAKEUP
// <q> 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]
// <i> config gpio13 function