|
@@ -1,21 +1,30 @@
|
|
|
/*
|
|
|
- * File : hw_uart.c
|
|
|
+ * File : uart.c
|
|
|
* This file is part of RT-Thread RTOS
|
|
|
- * COPYRIGHT (C) 2017, RT-Thread Development Team
|
|
|
+ * COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
|
|
|
*
|
|
|
- * The license and distribution terms for this file may be
|
|
|
- * found in the file LICENSE in this distribution or at
|
|
|
- * http://www.rt-thread.org/license/LICENSE
|
|
|
+ * 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.
|
|
|
*
|
|
|
* Change Logs:
|
|
|
* Date Author Notes
|
|
|
* 2017-09-15 Haley the first version
|
|
|
*/
|
|
|
|
|
|
+#include <rtdevice.h>
|
|
|
#include "am_mcu_apollo.h"
|
|
|
-#include "hw_uart.h"
|
|
|
#include "board.h"
|
|
|
-#include <rtdevice.h>
|
|
|
|
|
|
/* USART0 */
|
|
|
#define AM_UART0_INST 0
|
|
@@ -37,7 +46,7 @@
|
|
|
struct am_uart
|
|
|
{
|
|
|
uint32_t uart_device;
|
|
|
- uint32_t uart_interrupt;
|
|
|
+ uint32_t uart_interrupt;
|
|
|
};
|
|
|
|
|
|
/**
|
|
@@ -70,17 +79,17 @@ static void rt_hw_uart_enable(struct am_uart* uart)
|
|
|
/* Enable the UART */
|
|
|
am_hal_uart_enable(uart->uart_device);
|
|
|
|
|
|
-#if defined(RT_USING_UART0)
|
|
|
+#if defined(RT_USING_UART0)
|
|
|
/* Make sure the UART RX and TX pins are enabled */
|
|
|
- am_hal_gpio_pin_config(UART0_GPIO_TX, UART0_GPIO_CFG_TX);
|
|
|
- am_hal_gpio_pin_config(UART0_GPIO_RX, UART0_GPIO_CFG_RX | AM_HAL_GPIO_PULL12K);
|
|
|
-#endif /* RT_USING_UART0 */
|
|
|
-
|
|
|
-#if defined(RT_USING_UART1)
|
|
|
+ am_hal_gpio_pin_config(UART0_GPIO_TX, UART0_GPIO_CFG_TX);
|
|
|
+ am_hal_gpio_pin_config(UART0_GPIO_RX, UART0_GPIO_CFG_RX | AM_HAL_GPIO_PULL12K);
|
|
|
+#endif /* RT_USING_UART0 */
|
|
|
+
|
|
|
+#if defined(RT_USING_UART1)
|
|
|
/* Make sure the UART RX and TX pins are enabled */
|
|
|
- am_hal_gpio_pin_config(UART1_GPIO_TX, UART1_GPIO_CFG_TX);
|
|
|
- am_hal_gpio_pin_config(UART1_GPIO_RX, UART1_GPIO_CFG_RX | AM_HAL_GPIO_PULL12K);
|
|
|
-#endif /* RT_USING_UART1 */
|
|
|
+ am_hal_gpio_pin_config(UART1_GPIO_TX, UART1_GPIO_CFG_TX);
|
|
|
+ am_hal_gpio_pin_config(UART1_GPIO_RX, UART1_GPIO_CFG_RX | AM_HAL_GPIO_PULL12K);
|
|
|
+#endif /* RT_USING_UART1 */
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -94,26 +103,26 @@ static void rt_hw_uart_enable(struct am_uart* uart)
|
|
|
*/
|
|
|
static void rt_hw_uart_disable(struct am_uart* uart)
|
|
|
{
|
|
|
- /* Clear all interrupts before sleeping as having a pending UART interrupt burns power */
|
|
|
- am_hal_uart_int_clear(uart->uart_device, 0xFFFFFFFF);
|
|
|
+ /* Clear all interrupts before sleeping as having a pending UART interrupt burns power */
|
|
|
+ am_hal_uart_int_clear(uart->uart_device, 0xFFFFFFFF);
|
|
|
+
|
|
|
+ /* Disable the UART */
|
|
|
+ am_hal_uart_disable(uart->uart_device);
|
|
|
|
|
|
- /* Disable the UART */
|
|
|
- am_hal_uart_disable(uart->uart_device);
|
|
|
-
|
|
|
-#if defined(RT_USING_UART0)
|
|
|
+#if defined(RT_USING_UART0)
|
|
|
/* Disable the UART pins */
|
|
|
- am_hal_gpio_pin_config(UART0_GPIO_TX, AM_HAL_PIN_DISABLE);
|
|
|
- am_hal_gpio_pin_config(UART0_GPIO_RX, AM_HAL_PIN_DISABLE);
|
|
|
-#endif /* RT_USING_UART0 */
|
|
|
-
|
|
|
-#if defined(RT_USING_UART1)
|
|
|
+ am_hal_gpio_pin_config(UART0_GPIO_TX, AM_HAL_PIN_DISABLE);
|
|
|
+ am_hal_gpio_pin_config(UART0_GPIO_RX, AM_HAL_PIN_DISABLE);
|
|
|
+#endif /* RT_USING_UART0 */
|
|
|
+
|
|
|
+#if defined(RT_USING_UART1)
|
|
|
/* Disable the UART pins */
|
|
|
- am_hal_gpio_pin_config(UART1_GPIO_TX, AM_HAL_PIN_DISABLE);
|
|
|
- am_hal_gpio_pin_config(UART1_GPIO_RX, AM_HAL_PIN_DISABLE);
|
|
|
-#endif /* RT_USING_UART1 */
|
|
|
-
|
|
|
- /* Disable the UART clock */
|
|
|
- am_hal_uart_clock_disable(uart->uart_device);
|
|
|
+ am_hal_gpio_pin_config(UART1_GPIO_TX, AM_HAL_PIN_DISABLE);
|
|
|
+ am_hal_gpio_pin_config(UART1_GPIO_RX, AM_HAL_PIN_DISABLE);
|
|
|
+#endif /* RT_USING_UART1 */
|
|
|
+
|
|
|
+ /* Disable the UART clock */
|
|
|
+ am_hal_uart_clock_disable(uart->uart_device);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -129,9 +138,9 @@ static void rt_hw_uart_disable(struct am_uart* uart)
|
|
|
void rt_hw_uart_send_string(char *pcString)
|
|
|
{
|
|
|
am_hal_uart_string_transmit_polled(AM_UART0_INST, pcString);
|
|
|
-
|
|
|
- /* Wait until busy bit clears to make sure UART fully transmitted last byte */
|
|
|
- while ( am_hal_uart_flags_get(AM_UART0_INST) & AM_HAL_UART_FR_BUSY );
|
|
|
+
|
|
|
+ /* Wait until busy bit clears to make sure UART fully transmitted last byte */
|
|
|
+ while ( am_hal_uart_flags_get(AM_UART0_INST) & AM_HAL_UART_FR_BUSY );
|
|
|
}
|
|
|
|
|
|
static rt_err_t am_configure(struct rt_serial_device *serial, struct serial_configure *cfg)
|
|
@@ -141,29 +150,29 @@ static rt_err_t am_configure(struct rt_serial_device *serial, struct serial_conf
|
|
|
RT_ASSERT(serial != RT_NULL);
|
|
|
RT_ASSERT(cfg != RT_NULL);
|
|
|
|
|
|
- uart = (struct am_uart *)serial->parent.user_data;
|
|
|
+ uart = (struct am_uart *)serial->parent.user_data;
|
|
|
+
|
|
|
+ RT_ASSERT(uart != RT_NULL);
|
|
|
+
|
|
|
+ /* Get the configure */
|
|
|
+ g_sUartConfig.ui32BaudRate = cfg->baud_rate;
|
|
|
+ g_sUartConfig.ui32DataBits = cfg->data_bits;
|
|
|
|
|
|
- RT_ASSERT(uart != RT_NULL);
|
|
|
-
|
|
|
- /* Get the configure */
|
|
|
- g_sUartConfig.ui32BaudRate = cfg->baud_rate;
|
|
|
- g_sUartConfig.ui32DataBits = cfg->data_bits;
|
|
|
-
|
|
|
if (cfg->stop_bits == STOP_BITS_1)
|
|
|
g_sUartConfig.bTwoStopBits = false;
|
|
|
else if (cfg->stop_bits == STOP_BITS_2)
|
|
|
g_sUartConfig.bTwoStopBits = true;
|
|
|
|
|
|
- g_sUartConfig.ui32Parity = cfg->parity;
|
|
|
- g_sUartConfig.ui32FlowCtrl = AM_HAL_UART_PARITY_NONE;
|
|
|
-
|
|
|
+ g_sUartConfig.ui32Parity = cfg->parity;
|
|
|
+ g_sUartConfig.ui32FlowCtrl = AM_HAL_UART_PARITY_NONE;
|
|
|
+
|
|
|
/* Configure the UART */
|
|
|
am_hal_uart_config(uart->uart_device, &g_sUartConfig);
|
|
|
|
|
|
/* Enable the UART */
|
|
|
- am_hal_uart_enable(uart->uart_device);
|
|
|
-
|
|
|
- return RT_EOK;
|
|
|
+ am_hal_uart_enable(uart->uart_device);
|
|
|
+
|
|
|
+ return RT_EOK;
|
|
|
}
|
|
|
|
|
|
static rt_err_t am_control(struct rt_serial_device *serial, int cmd, void *arg)
|
|
@@ -174,24 +183,24 @@ static rt_err_t am_control(struct rt_serial_device *serial, int cmd, void *arg)
|
|
|
RT_ASSERT(serial != RT_NULL);
|
|
|
uart = (struct am_uart *)serial->parent.user_data;
|
|
|
|
|
|
- RT_ASSERT(uart != RT_NULL);
|
|
|
-
|
|
|
+ RT_ASSERT(uart != RT_NULL);
|
|
|
+
|
|
|
switch (cmd)
|
|
|
{
|
|
|
/* disable interrupt */
|
|
|
- case RT_DEVICE_CTRL_CLR_INT:
|
|
|
- rt_hw_uart_disable(uart);
|
|
|
- break;
|
|
|
- /* enable interrupt */
|
|
|
- case RT_DEVICE_CTRL_SET_INT:
|
|
|
- rt_hw_uart_enable(uart);
|
|
|
- break;
|
|
|
- /* UART config */
|
|
|
- case RT_DEVICE_CTRL_CONFIG :
|
|
|
- break;
|
|
|
+ case RT_DEVICE_CTRL_CLR_INT:
|
|
|
+ rt_hw_uart_disable(uart);
|
|
|
+ break;
|
|
|
+ /* enable interrupt */
|
|
|
+ case RT_DEVICE_CTRL_SET_INT:
|
|
|
+ rt_hw_uart_enable(uart);
|
|
|
+ break;
|
|
|
+ /* UART config */
|
|
|
+ case RT_DEVICE_CTRL_CONFIG :
|
|
|
+ break;
|
|
|
}
|
|
|
-
|
|
|
- return RT_EOK;
|
|
|
+
|
|
|
+ return RT_EOK;
|
|
|
}
|
|
|
|
|
|
static int am_putc(struct rt_serial_device *serial, char c)
|
|
@@ -200,33 +209,33 @@ static int am_putc(struct rt_serial_device *serial, char c)
|
|
|
|
|
|
RT_ASSERT(serial != RT_NULL);
|
|
|
uart = (struct am_uart *)serial->parent.user_data;
|
|
|
-
|
|
|
- RT_ASSERT(uart != RT_NULL);
|
|
|
-
|
|
|
- am_hal_uart_char_transmit_polled(uart->uart_device, c);
|
|
|
-
|
|
|
- return 1;
|
|
|
+
|
|
|
+ RT_ASSERT(uart != RT_NULL);
|
|
|
+
|
|
|
+ am_hal_uart_char_transmit_polled(uart->uart_device, c);
|
|
|
+
|
|
|
+ return 1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
static int am_getc(struct rt_serial_device *serial)
|
|
|
{
|
|
|
- char c;
|
|
|
- int ch;
|
|
|
- struct am_uart* uart;
|
|
|
-
|
|
|
- RT_ASSERT(serial != RT_NULL);
|
|
|
+ char c;
|
|
|
+ int ch;
|
|
|
+ struct am_uart* uart;
|
|
|
+
|
|
|
+ RT_ASSERT(serial != RT_NULL);
|
|
|
uart = (struct am_uart *)serial->parent.user_data;
|
|
|
|
|
|
- RT_ASSERT(uart != RT_NULL);
|
|
|
-
|
|
|
+ RT_ASSERT(uart != RT_NULL);
|
|
|
+
|
|
|
ch = -1;
|
|
|
- if (am_hal_uart_flags_get(uart->uart_device) & AM_HAL_UART_FR_RX_FULL)
|
|
|
+ if ((am_hal_uart_flags_get(uart->uart_device) & AM_HAL_UART_FR_RX_EMPTY) == 0)
|
|
|
{
|
|
|
- am_hal_uart_char_receive_polled(uart->uart_device, &c);
|
|
|
- ch = c & 0xff;
|
|
|
+ am_hal_uart_char_receive_polled(uart->uart_device, &c);
|
|
|
+ ch = c & 0xff;
|
|
|
}
|
|
|
-
|
|
|
- return ch;
|
|
|
+
|
|
|
+ return ch;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -236,35 +245,35 @@ static int am_getc(struct rt_serial_device *serial)
|
|
|
*/
|
|
|
static void uart_isr(struct rt_serial_device *serial)
|
|
|
{
|
|
|
- uint32_t status;
|
|
|
-
|
|
|
- RT_ASSERT(serial != RT_NULL);
|
|
|
- struct am_uart *uart = (struct am_uart *) serial->parent.user_data;
|
|
|
-
|
|
|
- RT_ASSERT(uart != RT_NULL);
|
|
|
+ uint32_t status;
|
|
|
+
|
|
|
+ RT_ASSERT(serial != RT_NULL);
|
|
|
+ struct am_uart *uart = (struct am_uart *) serial->parent.user_data;
|
|
|
+
|
|
|
+ RT_ASSERT(uart != RT_NULL);
|
|
|
|
|
|
/* Read the interrupt status */
|
|
|
- status = am_hal_uart_int_status_get(uart->uart_device, false);
|
|
|
-
|
|
|
- //rt_kprintf("status is %d\r\n", status);
|
|
|
-
|
|
|
- /* Clear the UART interrupt */
|
|
|
- am_hal_uart_int_clear(uart->uart_device, status);
|
|
|
+ status = am_hal_uart_int_status_get(uart->uart_device, false);
|
|
|
+
|
|
|
+ //rt_kprintf("status is %d\r\n", status);
|
|
|
+
|
|
|
+ /* Clear the UART interrupt */
|
|
|
+ am_hal_uart_int_clear(uart->uart_device, status);
|
|
|
|
|
|
if (status & (AM_HAL_UART_INT_RX_TMOUT))
|
|
|
{
|
|
|
- rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_TIMEOUT);
|
|
|
+ rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
|
|
|
}
|
|
|
|
|
|
if (status & AM_HAL_UART_INT_RX)
|
|
|
- {
|
|
|
- rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
|
|
|
- }
|
|
|
-
|
|
|
- if (status & AM_HAL_UART_INT_TX)
|
|
|
- {
|
|
|
- //rt_hw_serial_isr(serial, RT_SERIAL_EVENT_TX_DONE);
|
|
|
- }
|
|
|
+ {
|
|
|
+ rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (status & AM_HAL_UART_INT_TX)
|
|
|
+ {
|
|
|
+ // rt_hw_serial_isr(serial, RT_SERIAL_EVENT_TX_DONE);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
static const struct rt_uart_ops am_uart_ops =
|
|
@@ -280,7 +289,7 @@ static const struct rt_uart_ops am_uart_ops =
|
|
|
struct am_uart uart0 =
|
|
|
{
|
|
|
AM_UART0_INST,
|
|
|
- AM_HAL_INTERRUPT_UART0
|
|
|
+ AM_HAL_INTERRUPT_UART0
|
|
|
};
|
|
|
static struct rt_serial_device serial0;
|
|
|
|
|
@@ -301,7 +310,7 @@ void am_uart0_isr(void)
|
|
|
struct am_uart uart1 =
|
|
|
{
|
|
|
AM_UART1_INST,
|
|
|
- AM_HAL_INTERRUPT_UART1
|
|
|
+ AM_HAL_INTERRUPT_UART1
|
|
|
};
|
|
|
static struct rt_serial_device serial1;
|
|
|
|
|
@@ -309,7 +318,7 @@ void am_uart1_isr(void)
|
|
|
{
|
|
|
/* enter interrupt */
|
|
|
rt_interrupt_enter();
|
|
|
-
|
|
|
+
|
|
|
uart_isr(&serial1);
|
|
|
|
|
|
/* leave interrupt */
|
|
@@ -319,17 +328,17 @@ void am_uart1_isr(void)
|
|
|
|
|
|
static void GPIO_Configuration(void)
|
|
|
{
|
|
|
-#if defined(RT_USING_UART0)
|
|
|
+#if defined(RT_USING_UART0)
|
|
|
/* Make sure the UART RX and TX pins are enabled */
|
|
|
- am_hal_gpio_pin_config(UART0_GPIO_TX, UART0_GPIO_CFG_TX);
|
|
|
- am_hal_gpio_pin_config(UART0_GPIO_RX, UART0_GPIO_CFG_RX | AM_HAL_GPIO_PULL12K);
|
|
|
-#endif /* RT_USING_UART0 */
|
|
|
-
|
|
|
-#if defined(RT_USING_UART1)
|
|
|
+ am_hal_gpio_pin_config(UART0_GPIO_TX, UART0_GPIO_CFG_TX);
|
|
|
+ am_hal_gpio_pin_config(UART0_GPIO_RX, UART0_GPIO_CFG_RX | AM_HAL_GPIO_PULL12K);
|
|
|
+#endif /* RT_USING_UART0 */
|
|
|
+
|
|
|
+#if defined(RT_USING_UART1)
|
|
|
/* Make sure the UART RX and TX pins are enabled */
|
|
|
- am_hal_gpio_pin_config(UART1_GPIO_TX, UART1_GPIO_CFG_TX);
|
|
|
- am_hal_gpio_pin_config(UART1_GPIO_RX, UART1_GPIO_CFG_RX | AM_HAL_GPIO_PULL12K);
|
|
|
-#endif /* RT_USING_UART1 */
|
|
|
+ am_hal_gpio_pin_config(UART1_GPIO_TX, UART1_GPIO_CFG_TX);
|
|
|
+ am_hal_gpio_pin_config(UART1_GPIO_RX, UART1_GPIO_CFG_RX | AM_HAL_GPIO_PULL12K);
|
|
|
+#endif /* RT_USING_UART1 */
|
|
|
}
|
|
|
|
|
|
static void RCC_Configuration(struct am_uart* uart)
|
|
@@ -341,26 +350,25 @@ static void RCC_Configuration(struct am_uart* uart)
|
|
|
am_hal_uart_clock_enable(uart->uart_device);
|
|
|
|
|
|
/* Disable the UART before configuring it */
|
|
|
- am_hal_uart_disable(uart->uart_device);
|
|
|
-
|
|
|
+ am_hal_uart_disable(uart->uart_device);
|
|
|
+
|
|
|
/* Configure the UART */
|
|
|
- am_hal_uart_config(uart->uart_device, &g_sUartConfig);
|
|
|
-
|
|
|
+ am_hal_uart_config(uart->uart_device, &g_sUartConfig);
|
|
|
+
|
|
|
/* Enable the UART */
|
|
|
- am_hal_uart_enable(uart->uart_device);
|
|
|
+ am_hal_uart_enable(uart->uart_device);
|
|
|
|
|
|
/* Enable the UART FIFO */
|
|
|
- //am_hal_uart_fifo_config(uart->uart_device, AM_HAL_UART_TX_FIFO_1_2 | AM_HAL_UART_RX_FIFO_1_2);
|
|
|
+ am_hal_uart_fifo_config(uart->uart_device, AM_HAL_UART_TX_FIFO_1_2 | AM_HAL_UART_RX_FIFO_1_2);
|
|
|
}
|
|
|
|
|
|
static void NVIC_Configuration(struct am_uart* uart)
|
|
|
{
|
|
|
- /* Enable interrupts */
|
|
|
- am_hal_uart_int_enable(uart->uart_device, AM_HAL_UART_INT_RX);
|
|
|
-
|
|
|
- /* Enable the uart interrupt in the NVIC */
|
|
|
- am_hal_interrupt_enable(uart->uart_interrupt);
|
|
|
- am_hal_uart_int_clear(uart->uart_device, 0xFFFFFFFF);
|
|
|
+ /* Enable interrupts */
|
|
|
+ am_hal_uart_int_enable(uart->uart_device, AM_HAL_UART_INT_RX_TMOUT | AM_HAL_UART_INT_RX);
|
|
|
+
|
|
|
+ /* Enable the uart interrupt in the NVIC */
|
|
|
+ am_hal_interrupt_enable(uart->uart_interrupt);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -373,40 +381,40 @@ static void NVIC_Configuration(struct am_uart* uart)
|
|
|
void rt_hw_uart_init(void)
|
|
|
{
|
|
|
struct am_uart* uart;
|
|
|
- struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT;
|
|
|
+ struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT;
|
|
|
|
|
|
GPIO_Configuration();
|
|
|
-
|
|
|
+
|
|
|
#if defined(RT_USING_UART0)
|
|
|
uart = &uart0;
|
|
|
config.baud_rate = BAUD_RATE_115200;
|
|
|
|
|
|
- RCC_Configuration(uart);
|
|
|
- NVIC_Configuration(uart);
|
|
|
-
|
|
|
+ RCC_Configuration(uart);
|
|
|
+ NVIC_Configuration(uart);
|
|
|
+
|
|
|
serial0.ops = &am_uart_ops;
|
|
|
- serial0.config = config;
|
|
|
-
|
|
|
+ serial0.config = config;
|
|
|
+
|
|
|
/* register UART1 device */
|
|
|
rt_hw_serial_register(&serial0, "uart0",
|
|
|
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX |
|
|
|
- RT_DEVICE_FLAG_INT_TX, uart);
|
|
|
+ RT_DEVICE_FLAG_INT_TX, uart);
|
|
|
#endif /* RT_USING_UART0 */
|
|
|
|
|
|
#if defined(RT_USING_UART1)
|
|
|
uart = &uart1;
|
|
|
config.baud_rate = BAUD_RATE_115200;
|
|
|
|
|
|
- RCC_Configuration(uart);
|
|
|
- NVIC_Configuration(uart);
|
|
|
-
|
|
|
+ RCC_Configuration(uart);
|
|
|
+ NVIC_Configuration(uart);
|
|
|
+
|
|
|
serial1.ops = &am_uart_ops;
|
|
|
- serial1.config = config;
|
|
|
-
|
|
|
+ serial1.config = config;
|
|
|
+
|
|
|
/* register UART1 device */
|
|
|
rt_hw_serial_register(&serial1, "uart1",
|
|
|
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX |
|
|
|
- RT_DEVICE_FLAG_INT_TX, uart);
|
|
|
+ RT_DEVICE_FLAG_INT_TX, uart);
|
|
|
#endif /* RT_USING_UART1 */
|
|
|
}
|
|
|
|