更换格式控制文件位置,删除冗余代码和注释,更正芯片命名
This commit is contained in:
parent
dd910a7805
commit
fc537808cf
|
@ -12,4 +12,3 @@ dir_path:
|
||||||
- components/net/lwip-2.0.3
|
- components/net/lwip-2.0.3
|
||||||
- components/net/lwip-2.1.2
|
- components/net/lwip-2.1.2
|
||||||
- bsp/mm32f327x/Libraries
|
- bsp/mm32f327x/Libraries
|
||||||
- bsp/Vango_V85xx/Libraries
|
|
|
@ -578,8 +578,8 @@ CONFIG_RT_LIBC_DEFAULT_TIMEZONE=8
|
||||||
# CONFIG_PKG_USING_MCURSES is not set
|
# CONFIG_PKG_USING_MCURSES is not set
|
||||||
# CONFIG_PKG_USING_COWSAY is not set
|
# CONFIG_PKG_USING_COWSAY is not set
|
||||||
# CONFIG_PKG_USING_TERMBOX is not set
|
# CONFIG_PKG_USING_TERMBOX is not set
|
||||||
CONFIG_SOC_SERIES_GD32F1=y
|
CONFIG_SOC_SERIES_V85XX=y
|
||||||
CONFIG_SOC_GD32103C=y
|
CONFIG_SOC_V85XX=y
|
||||||
|
|
||||||
#
|
#
|
||||||
# On-chip Peripheral Drivers
|
# On-chip Peripheral Drivers
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
# files format check exclude path, please follow the instructions below to modify;
|
||||||
|
# If you need to exclude an entire folder, add the folder path in dir_path;
|
||||||
|
# If you need to exclude a file, add the path to the file in file_path.
|
||||||
|
|
||||||
|
dir_path:
|
||||||
|
- Libraries/VangoV85xx_standard_peripheral
|
|
@ -21,15 +21,15 @@ config PKGS_DIR
|
||||||
source "$RTT_DIR/Kconfig"
|
source "$RTT_DIR/Kconfig"
|
||||||
source "$PKGS_DIR/Kconfig"
|
source "$PKGS_DIR/Kconfig"
|
||||||
|
|
||||||
config SOC_SERIES_GD32F1
|
config SOC_SERIES_V85XX
|
||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config SOC_GD32103C
|
config SOC_V85XX
|
||||||
bool
|
bool
|
||||||
select RT_USING_COMPONENTS_INIT
|
select RT_USING_COMPONENTS_INIT
|
||||||
select RT_USING_USER_MAIN
|
select RT_USING_USER_MAIN
|
||||||
select SOC_SERIES_GD32F1
|
select SOC_SERIES_V85XX
|
||||||
default y
|
default y
|
||||||
|
|
||||||
menu "On-chip Peripheral Drivers"
|
menu "On-chip Peripheral Drivers"
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
/**
|
|
||||||
******************************************************************************
|
|
||||||
* @brief Configuration file.
|
|
||||||
******************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
||||||
#ifndef __GD32F10X_CONF_H
|
|
||||||
#define __GD32F10X_CONF_H
|
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
|
||||||
/* Comment the line below to disable peripheral header file inclusion */
|
|
||||||
#include "lib_ana.h"
|
|
||||||
#include "lib_adc.h"
|
|
||||||
#include "lib_adc_tiny.h"
|
|
||||||
#include "lib_clk.h"
|
|
||||||
#include "lib_comp.h"
|
|
||||||
#include "lib_crypt.h"
|
|
||||||
#include "lib_dma.h"
|
|
||||||
#include "lib_flash.h"
|
|
||||||
#include "lib_gpio.h"
|
|
||||||
#include "lib_i2c.h"
|
|
||||||
#include "lib_iso7816.h"
|
|
||||||
#include "lib_lcd.h"
|
|
||||||
#include "lib_misc.h"
|
|
||||||
#include "lib_pmu.h"
|
|
||||||
#include "lib_pwm.h"
|
|
||||||
#include "lib_rtc.h"
|
|
||||||
#include "lib_spi.h"
|
|
||||||
#include "lib_tmr.h"
|
|
||||||
#include "lib_u32k.h"
|
|
||||||
#include "lib_uart.h"
|
|
||||||
#include "lib_version.h"
|
|
||||||
#include "lib_wdt.h"
|
|
||||||
#include "lib_LoadNVR.h"
|
|
||||||
#include "lib_CodeRAM.h"
|
|
||||||
#include "lib_cortex.h"
|
|
||||||
|
|
||||||
#endif /* __GD32F10X_CONF_H */
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
* Change Logs:
|
* Change Logs:
|
||||||
* Date Author Notes
|
* Date Author Notes
|
||||||
* 2021-01-04 iysheng first version
|
* 2021-01-04 iysheng first version
|
||||||
|
* 2021-09-07 FuC Suit for Vango V85XX
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <target.h>
|
#include <target.h>
|
||||||
|
@ -109,9 +110,6 @@ static const struct V85xx_uart uarts[] = {
|
||||||
{
|
{
|
||||||
UART0, /* uart peripheral index */
|
UART0, /* uart peripheral index */
|
||||||
UART0_IRQn, /* uart iqrn */
|
UART0_IRQn, /* uart iqrn */
|
||||||
// // RCU_UART0, RCU_GPIOA, RCU_GPIOA, /* periph clock, tx gpio clock, rt gpio clock */
|
|
||||||
// GPIOA, GPIOA, /* tx port, tx alternate, tx pin */
|
|
||||||
// GPIO_PIN_9, GPIO_PIN_10, /* rx port, rx alternate, rx pin */
|
|
||||||
&serial0,
|
&serial0,
|
||||||
"uart0",
|
"uart0",
|
||||||
},
|
},
|
||||||
|
@ -121,9 +119,6 @@ static const struct V85xx_uart uarts[] = {
|
||||||
{
|
{
|
||||||
UART1, /* uart peripheral index */
|
UART1, /* uart peripheral index */
|
||||||
UART1_IRQn, /* uart iqrn */
|
UART1_IRQn, /* uart iqrn */
|
||||||
// RCU_UART1, RCU_GPIOA, RCU_GPIOA, /* periph clock, tx gpio clock, rt gpio clock */
|
|
||||||
// GPIOA, GPIOA, /* tx port, tx alternate, tx pin */
|
|
||||||
// GPIO_PIN_2, GPIO_PIN_3, /* rx port, rx alternate, rx pin */
|
|
||||||
&serial1,
|
&serial1,
|
||||||
"uart1",
|
"uart1",
|
||||||
},
|
},
|
||||||
|
@ -133,9 +128,6 @@ static const struct V85xx_uart uarts[] = {
|
||||||
{
|
{
|
||||||
UART2, /* uart peripheral index */
|
UART2, /* uart peripheral index */
|
||||||
UART2_IRQn, /* uart iqrn */
|
UART2_IRQn, /* uart iqrn */
|
||||||
// RCU_UART2, RCU_GPIOB, RCU_GPIOB, /* periph clock, tx gpio clock, rt gpio clock */
|
|
||||||
// GPIOB, GPIOB, /* tx port, tx alternate, tx pin */
|
|
||||||
// GPIO_PIN_10, GPIO_PIN_11, /* rx port, rx alternate, rx pin */
|
|
||||||
&serial2,
|
&serial2,
|
||||||
"uart2",
|
"uart2",
|
||||||
},
|
},
|
||||||
|
@ -145,9 +137,6 @@ static const struct V85xx_uart uarts[] = {
|
||||||
{
|
{
|
||||||
UART3, /* uart peripheral index */
|
UART3, /* uart peripheral index */
|
||||||
UART3_IRQn, /* uart iqrn */
|
UART3_IRQn, /* uart iqrn */
|
||||||
// RCU_UART3, RCU_GPIOC, RCU_GPIOC, /* periph clock, tx gpio clock, rt gpio clock */
|
|
||||||
// GPIOC, GPIOC, /* tx port, tx alternate, tx pin */
|
|
||||||
// GPIO_PIN_10, GPIO_PIN_11, /* rx port, rx alternate, rx pin */
|
|
||||||
&serial3,
|
&serial3,
|
||||||
"uart3",
|
"uart3",
|
||||||
},
|
},
|
||||||
|
@ -157,9 +146,6 @@ static const struct V85xx_uart uarts[] = {
|
||||||
{
|
{
|
||||||
UART4, /* uart peripheral index */
|
UART4, /* uart peripheral index */
|
||||||
UART4_IRQn, /* uart iqrn */
|
UART4_IRQn, /* uart iqrn */
|
||||||
// RCU_UART4, RCU_GPIOC, RCU_GPIOD, /* periph clock, tx gpio clock, rt gpio clock */
|
|
||||||
// GPIOC, GPIOD, /* tx port, tx alternate, tx pin */
|
|
||||||
// GPIO_PIN_12, GPIO_PIN_2, /* rx port, rx alternate, rx pin */
|
|
||||||
&serial4,
|
&serial4,
|
||||||
"uart4",
|
"uart4",
|
||||||
},
|
},
|
||||||
|
@ -191,15 +177,6 @@ static rt_err_t V85xx_configure(struct rt_serial_device *serial, struct serial_c
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// switch (cfg->stop_bits) {
|
|
||||||
// case STOP_BITS_2:
|
|
||||||
// UART_InitParaStruct.UART_STBits = UART_STBITS_2;
|
|
||||||
// break;
|
|
||||||
// default:
|
|
||||||
// UART_InitParaStruct.UART_STBits = UART_STBITS_1;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
|
|
||||||
switch (cfg->parity) {
|
switch (cfg->parity) {
|
||||||
case PARITY_ODD:
|
case PARITY_ODD:
|
||||||
UART_InitParaStruct.Parity = UART_PARITY_ODD;
|
UART_InitParaStruct.Parity = UART_PARITY_ODD;
|
||||||
|
@ -212,7 +189,6 @@ static rt_err_t V85xx_configure(struct rt_serial_device *serial, struct serial_c
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// UART_InitParaStruct.UART_HardwareFlowControl = UART_HARDWAREFLOWCONTROL_NONE;
|
|
||||||
UART_InitParaStruct.Mode = UART_MODE_RX | UART_MODE_TX;
|
UART_InitParaStruct.Mode = UART_MODE_RX | UART_MODE_TX;
|
||||||
UART_Init(UARTx, &UART_InitParaStruct);
|
UART_Init(UARTx, &UART_InitParaStruct);
|
||||||
UART_Cmd(UARTx, UART_InitParaStruct.Mode, ENABLE);
|
UART_Cmd(UARTx, UART_InitParaStruct.Mode, ENABLE);
|
||||||
|
|
|
@ -14,17 +14,10 @@
|
||||||
#include <rthw.h>
|
#include <rthw.h>
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
|
||||||
/* GD32 uart driver */
|
/* V85XX uart driver */
|
||||||
struct V85xx_uart {
|
struct V85xx_uart {
|
||||||
UART_TypeDef * uart_periph;
|
UART_TypeDef * uart_periph;
|
||||||
IRQn_Type irqn;
|
IRQn_Type irqn;
|
||||||
// rcu_periph_enum per_clk;
|
|
||||||
// rcu_periph_enum tx_gpio_clk;
|
|
||||||
// rcu_periph_enum rx_gpio_clk;
|
|
||||||
// GPIO_TypeDef * tx_port;
|
|
||||||
// GPIO_TypeDef * rx_port;
|
|
||||||
// uint16_t tx_pin;
|
|
||||||
// uint16_t rx_pin;
|
|
||||||
|
|
||||||
struct rt_serial_device *serial;
|
struct rt_serial_device *serial;
|
||||||
char *device_name;
|
char *device_name;
|
||||||
|
|
|
@ -171,8 +171,8 @@
|
||||||
|
|
||||||
/* entertainment: terminal games and other interesting software packages */
|
/* entertainment: terminal games and other interesting software packages */
|
||||||
|
|
||||||
#define SOC_SERIES_GD32F1
|
#define SOC_SERIES_V85XX
|
||||||
#define SOC_GD32103C
|
#define SOC_V85XX
|
||||||
|
|
||||||
/* On-chip Peripheral Drivers */
|
/* On-chip Peripheral Drivers */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue