summaryrefslogtreecommitdiff
path: root/libcpu/arm/sep4020/serial.h
diff options
context:
space:
mode:
Diffstat (limited to 'libcpu/arm/sep4020/serial.h')
-rw-r--r--libcpu/arm/sep4020/serial.h62
1 files changed, 31 insertions, 31 deletions
diff --git a/libcpu/arm/sep4020/serial.h b/libcpu/arm/sep4020/serial.h
index 69e7df248c..26ec0f6cec 100644
--- a/libcpu/arm/sep4020/serial.h
+++ b/libcpu/arm/sep4020/serial.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -7,7 +7,7 @@
* Date Author Notes
* 2006-03-13 Bernard first version
* 2009-04-20 yi.qiu modified according bernard's stm32 version
- * 2010-10-6 wangmeng added sep4020 surpport
+ * 2010-10-6 wangmeng added sep4020 surpport
*/
#ifndef __SERIAL_H__
@@ -15,67 +15,67 @@
#include <sep4020.h>
-#define USTAT_RCV_READY 0x01 /* receive data ready */
-#define USTAT_TXB_EMPTY 0x40 /* tx buffer empty */
-#define BPS 115200 /* serial baudrate */
+#define USTAT_RCV_READY 0x01 /* receive data ready */
+#define USTAT_TXB_EMPTY 0x40 /* tx buffer empty */
+#define BPS 115200 /* serial baudrate */
-#define UART_RX_BUFFER_SIZE 64
-#define UART_TX_BUFFER_SIZE 64
+#define UART_RX_BUFFER_SIZE 64
+#define UART_TX_BUFFER_SIZE 64
/*For sep4020's uart have several secondary function*/
/*we use union to decribe it*/
union dlbl_fifo
{
- rt_uint32_t dlbl;
- rt_uint32_t rxfifo;
- rt_uint32_t txfifo;
+ rt_uint32_t dlbl;
+ rt_uint32_t rxfifo;
+ rt_uint32_t txfifo;
};
union dlbh_ier
{
- rt_uint32_t dlbh;
- rt_uint32_t ier;
+ rt_uint32_t dlbh;
+ rt_uint32_t ier;
};
union iir_fcr
{
- rt_uint32_t iir;
- rt_uint32_t fcr;
+ rt_uint32_t iir;
+ rt_uint32_t fcr;
};
struct serial_int_rx
{
- rt_uint8_t rx_buffer[UART_RX_BUFFER_SIZE];
- rt_uint32_t read_index, save_index;
+ rt_uint8_t rx_buffer[UART_RX_BUFFER_SIZE];
+ rt_uint32_t read_index, save_index;
};
struct serial_int_tx
{
- rt_uint8_t tx_buffer[UART_TX_BUFFER_SIZE];
- rt_uint32_t write_index, save_index;
+ rt_uint8_t tx_buffer[UART_TX_BUFFER_SIZE];
+ rt_uint32_t write_index, save_index;
};
typedef struct uartport
{
- union dlbl_fifo dlbl_fifo;
- union dlbh_ier dlbh_ier;
- union iir_fcr iir_fcr;
- rt_uint32_t lcr;
- rt_uint32_t mcr;
- rt_uint32_t lsr;
- rt_uint32_t msr;
+ union dlbl_fifo dlbl_fifo;
+ union dlbh_ier dlbh_ier;
+ union iir_fcr iir_fcr;
+ rt_uint32_t lcr;
+ rt_uint32_t mcr;
+ rt_uint32_t lsr;
+ rt_uint32_t msr;
}uartport;
struct serial_device
{
- uartport* uart_device;
-
- /* rx structure */
- struct serial_int_rx* int_rx;
+ uartport* uart_device;
- /* tx structure */
- struct serial_int_tx* int_tx;
+ /* rx structure */
+ struct serial_int_rx* int_rx;
+
+ /* tx structure */
+ struct serial_int_tx* int_tx;
};
rt_err_t rt_hw_serial_register(rt_device_t device, const char* name, rt_uint32_t flag, struct serial_device *serial);