summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2019-03-24 17:26:30 +0800
committerGitHub <[email protected]>2019-03-24 17:26:30 +0800
commit1b0f7db7c36c142dddb417c1cf1deaa5baf9add5 (patch)
tree5d97ca6ab76de31fb4ac8c6bbadc6023999429b9
parentb9932f80b636b8cc3d372f36f380ad42f92ffc84 (diff)
parente4a9fb5cfc086769f00f6737045e96d37856f8bb (diff)
Merge pull request #2496 from Ingenic-community/master
X1000:drv_uart.c:修复引脚路由中的问题/Fix bugs in pin routing
-rw-r--r--bsp/x1000/drivers/drv_gpio.h19
-rw-r--r--bsp/x1000/drivers/drv_uart.c5
2 files changed, 7 insertions, 17 deletions
diff --git a/bsp/x1000/drivers/drv_gpio.h b/bsp/x1000/drivers/drv_gpio.h
index f020a7f8ff..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,6 +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_INPUT_PULL = 0x16, //0001 0110, GPIO as input and enable pull
};
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;