3 * All rights reserved.
\r
6 * SPDX-License-Identifier: BSD-3-Clause
\r
9 #ifndef __SERIAL_PORT_UART_H__
\r
10 #define __SERIAL_PORT_UART_H__
\r
12 /*******************************************************************************
\r
14 ******************************************************************************/
\r
16 #if (defined(SERIAL_MANAGER_NON_BLOCKING_MODE) && (SERIAL_MANAGER_NON_BLOCKING_MODE > 0U))
\r
17 #define SERIAL_PORT_UART_HANDLE_SIZE (166U)
\r
19 #define SERIAL_PORT_UART_HANDLE_SIZE (4U)
\r
22 typedef enum _serial_port_uart_parity_mode
\r
24 kSerialManager_UartParityDisabled = 0x0U, /*!< Parity disabled */
\r
25 kSerialManager_UartParityEven = 0x1U, /*!< Parity even enabled */
\r
26 kSerialManager_UartParityOdd = 0x2U, /*!< Parity odd enabled */
\r
27 } serial_port_uart_parity_mode_t;
\r
29 typedef enum _serial_port_uart_stop_bit_count
\r
31 kSerialManager_UartOneStopBit = 0U, /*!< One stop bit */
\r
32 kSerialManager_UartTwoStopBit = 1U, /*!< Two stop bits */
\r
33 } serial_port_uart_stop_bit_count_t;
\r
35 typedef struct _serial_port_uart_config
\r
37 uint32_t clockRate; /*!< clock rate */
\r
38 uint32_t baudRate; /*!< baud rate */
\r
39 serial_port_uart_parity_mode_t parityMode; /*!< Parity mode, disabled (default), even, odd */
\r
40 serial_port_uart_stop_bit_count_t stopBitCount; /*!< Number of stop bits, 1 stop bit (default) or 2 stop bits */
\r
41 uint8_t instance; /*!< Instance (0 - UART0, 1 - UART1, ...), detail information
\r
42 please refer to the SOC corresponding RM. */
\r
43 uint8_t enableRx; /*!< Enable RX */
\r
44 uint8_t enableTx; /*!< Enable TX */
\r
45 } serial_port_uart_config_t;
\r
47 #endif /* __SERIAL_PORT_UART_H__ */
\r