From a30587ff6928a1293765183de9f65f9cd1dd760e Mon Sep 17 00:00:00 2001 From: Zhou Yanjie Date: Sat, 23 Mar 2019 22:04:12 +0800 Subject: [PATCH 1/3] =?UTF-8?q?X1000:drv=5Fgpio.h:=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E6=88=90=E5=91=98=E2=80=9CGPIO=5FPULL?= =?UTF-8?q?=E2=80=9D/Add=20enum=20member=20"GPIO=5FPULL"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在枚举“gpio_function”中添加成员“GPIO_PULL” Add the member "GPIO_PULL" to the enumeration "gpio_function". Signed-off-by: Zhou Yanjie --- bsp/x1000/drivers/drv_gpio.h | 1 + 1 file changed, 1 insertion(+) diff --git a/bsp/x1000/drivers/drv_gpio.h b/bsp/x1000/drivers/drv_gpio.h index f020a7f8ff..8335aaba90 100644 --- a/bsp/x1000/drivers/drv_gpio.h +++ b/bsp/x1000/drivers/drv_gpio.h @@ -115,6 +115,7 @@ enum gpio_function GPIO_INT_HI = 0x09, //1001, High Level trigger interrupt GPIO_INT_FE = 0x0a, //1010, Fall Edge trigger interrupt GPIO_INT_RE = 0x0b, //1011, Rise Edge trigger interrupt + GPIO_PULL = 0x10, //0001 0000, GPIO enable pull GPIO_INPUT_PULL = 0x16, //0001 0110, GPIO as input and enable pull }; From 94a5f9951b77046dfb27f76943e795924b38778b Mon Sep 17 00:00:00 2001 From: Zhou Yanjie Date: Sat, 23 Mar 2019 22:10:48 +0800 Subject: [PATCH 2/3] =?UTF-8?q?X1000:drv=5Fuart.c:=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=BC=95=E8=84=9A=E8=B7=AF=E7=94=B1=E4=B8=AD=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98/Fix=20bugs=20in=20pin=20routing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在配置引脚路由时需要将未使用的引脚配置为输入模式, 否则有可能同u-boot中的配置产生冲突。 Unused pins need to be configured as input mode when configuring pin routing, otherwise there may be conflicts with the configuration in u-boot. Signed-off-by: Zhou Yanjie --- bsp/x1000/drivers/drv_uart.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bsp/x1000/drivers/drv_uart.c b/bsp/x1000/drivers/drv_uart.c index 4c2ab92dcc..71ee1c38c4 100644 --- a/bsp/x1000/drivers/drv_uart.c +++ b/bsp/x1000/drivers/drv_uart.c @@ -285,11 +285,14 @@ void rt_hw_uart_init(void) strcpy(uart->name, "uart2"); #ifdef CONFIG_SYS_UART2_PD + gpio_set_func(GPIO_PORT_C,GPIO_Pin_31,GPIO_INPUT | GPIO_PULL); gpio_set_func(GPIO_PORT_D,GPIO_Pin_4,GPIO_FUNC_0); gpio_set_func(GPIO_PORT_D,GPIO_Pin_5,GPIO_FUNC_0); #else //USE JTAG IO for UART2 - gpio_set_func(GPIO_PORT_C,GPIO_Pin_31,GPIO_FUNC_1); + gpio_set_func(GPIO_PORT_D,GPIO_Pin_4,GPIO_INPUT | GPIO_PULL); + gpio_set_func(GPIO_PORT_D,GPIO_Pin_5,GPIO_INPUT | GPIO_PULL); + gpio_set_func(GPIO_PORT_C,GPIO_Pin_31,GPIO_FUNC_1 | GPIO_PULL); #endif serial->ops = &_uart_ops; From e4a9fb5cfc086769f00f6737045e96d37856f8bb Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Sun, 24 Mar 2019 16:51:26 +0800 Subject: [PATCH 3/3] Update drv_gpio.h --- bsp/x1000/drivers/drv_gpio.h | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/bsp/x1000/drivers/drv_gpio.h b/bsp/x1000/drivers/drv_gpio.h index 8335aaba90..a87e582def 100644 --- a/bsp/x1000/drivers/drv_gpio.h +++ b/bsp/x1000/drivers/drv_gpio.h @@ -1,21 +1,7 @@ /* - * File : board_gpio.h - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2008 - 2016, RT-Thread Development Team + * Copyright (c) 2006-2018, RT-Thread Development Team * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes @@ -115,7 +101,7 @@ enum gpio_function GPIO_INT_HI = 0x09, //1001, High Level trigger interrupt GPIO_INT_FE = 0x0a, //1010, Fall Edge trigger interrupt GPIO_INT_RE = 0x0b, //1011, Rise Edge trigger interrupt - GPIO_PULL = 0x10, //0001 0000, GPIO enable pull + GPIO_PULL = 0x10, //0001 0000, GPIO enable pull GPIO_INPUT_PULL = 0x16, //0001 0110, GPIO as input and enable pull };