VSF Documented
uart.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __HAL_DRIVER_AIC_8800_UART_H__
19#define __HAL_DRIVER_AIC_8800_UART_H__
20/*============================ INCLUDES ======================================*/
21
22#include "hal/vsf_hal_cfg.h"
23
24#if VSF_HAL_USE_USART == ENABLED
25#include "../__device.h"
26#include "./i_reg_uart.h"
27
28/*============================ MACROS ========================================*/
29/*============================ MACROFIED FUNCTIONS ===========================*/
30/*============================ TYPES =========================================*/
31
32typedef enum vsf_usart_mode_t {
33 // hardware
34 VSF_USART_8_BIT_LENGTH = (0x3ul << 0),
35 VSF_USART_7_BIT_LENGTH = (0x2ul << 0),
36 VSF_USART_6_BIT_LENGTH = (0x1ul << 0),
37 VSF_USART_5_BIT_LENGTH = (0x0ul << 0),
38
39
40 VSF_USART_1_STOPBIT = (0x0ul << 2),
41 VSF_USART_2_STOPBIT = (0x1ul << 2),
42
43
44 VSF_USART_NO_PARITY = (0x0ul << 3),
45 VSF_USART_ODD_PARITY = (0x1ul << 3),
46 VSF_USART_EVEN_PARITY = (0x2ul << 3),
47
48 // Not hardware, just keep for build
49 VSF_USART_9_BIT_LENGTH = (0x1ul << 8),
51
52 VSF_USART_FORCE_0_PARITY = (0x1ul << 10),
53 VSF_USART_FORCE_1_PARITY = (0x2ul << 10),
54
55 VSF_USART_1_5_STOPBIT = (0x1ul << 12),
56 VSF_USART_0_5_STOPBIT = (0x2ul << 12),
57
58 VSF_USART_NO_HWCONTROL = (0x0ul << 14),
59 VSF_USART_RTS_HWCONTROL = (0x1ul << 14),
60 VSF_USART_CTS_HWCONTROL = (0x2ul << 14),
62
63 VSF_USART_TX_ENABLE = (0x0ul << 15),
64 VSF_USART_TX_DISABLE = (0x1ul << 15),
65
66 VSF_USART_RX_ENABLE = (0x0ul << 16),
67 VSF_USART_RX_DISABLE = (0x1ul << 16),
68
71
74
78
82
87
88 VSF_USART_IRDA_ENABLE = (0x1ul << 25),
89 VSF_USART_IRDA_DISABLE = (0x0ul << 25),
90
104
106 // usart fifo interrupt
109
113
117
118 VSF_USART_IRQ_MASK_CTS = (0x1ul << 24),
119
121
122 // usart request interrupt
125
126 // usart error interrupt
131
138
139/*============================ INCLUDES ======================================*/
140/*============================ GLOBAL VARIABLES ==============================*/
141/*============================ INCLUDES ======================================*/
142/*============================ PROTOTYPES ====================================*/
143/*============================ IMPLEMENTATION ================================*/
144
145#endif
146#endif
147/* EOF */
vsf_usart_mode_t
Definition uart.h:32
@ VSF_USART_TX_FIFO_THRESH_HALF_FULL
Definition uart.h:76
@ VSF_USART_HALF_DUPLEX_DISABLE
Definition uart.h:72
@ VSF_USART_SYNC_CLOCK_ENABLE
Definition uart.h:69
@ VSF_USART_SYNC_CLOCK_PHASE_1_EDGE
Definition uart.h:85
@ VSF_USART_10_BIT_LENGTH
Definition uart.h:50
@ VSF_USART_RX_FIFO_THRESH_FULL
Definition uart.h:81
@ AIC8800_VSF_USART_STOPBIT_MASK
Definition uart.h:95
@ VSF_USART_RX_FIFO_THRESH_ONE
Definition uart.h:79
@ VSF_USART_TX_FIFO_THRESH_ONE
Definition uart.h:75
@ VSF_USART_SYNC_CLOCK_POLARITY_HIGH
Definition uart.h:84
@ VSF_USART_SYNC_CLOCK_POLARITY_LOW
Definition uart.h:83
@ VSF_USART_RX_FIFO_THRESH_HALF_FULL
Definition uart.h:80
@ AIC8800_VSF_USART_BIT_LENGTH_MASK
Definition uart.h:91
@ VSF_USART_SYNC_CLOCK_DISABLE
Definition uart.h:70
@ VSF_USART_IRDA_DISABLE
Definition uart.h:89
@ VSF_USART_SYNC_CLOCK_PHASE_2_EDGE
Definition uart.h:86
@ VSF_USART_HALF_DUPLEX_ENABLE
Definition uart.h:73
@ AIC8800_VSF_USART_PARITY_MASK
Definition uart.h:97
@ VSF_USART_IRDA_ENABLE
Definition uart.h:88
@ VSF_USART_TX_FIFO_THRESH_FULL
Definition uart.h:77
@ VSF_USART_0_5_STOPBIT
Definition uart.h:56
@ AIC8800_USART_MODE_ALL_BITS_MASK
Definition uart.h:100
vsf_usart_irq_mask_t
Definition uart.h:105
@ AIC8800_USART_IRQ_MASK_PT
Definition uart.h:112
@ AIC8800_USART_IRQ_MASK_LS
Definition uart.h:110
@ VSF_USART_IRQ_MASK_CTS
Definition uart.h:118
@ AIC8800_USART_IRQ_MASK_FIFO
Definition uart.h:114
@ AIC8800_USART_IRQ_MASK
Definition uart.h:132
@ AIC8800_USART_IRQ_MASK_MS
Definition uart.h:111
@ VSF_USART_EVEN_PARITY
Definition uart.h:42
vsf_usart_mode_t
Definition uart.h:36
@ VSF_USART_8_BIT_LENGTH
Definition uart.h:38
@ VSF_USART_ODD_PARITY
Definition uart.h:50
@ VSF_USART_NO_PARITY
Definition uart.h:49
@ VSF_USART_RTS_HWCONTROL
Definition uart.h:60
@ VSF_USART_RX_ENABLE
Definition uart.h:67
@ VSF_USART_FORCE_0_PARITY
Definition uart.h:56
@ VSF_USART_TX_ENABLE
Definition uart.h:64
@ VSF_USART_9_BIT_LENGTH
Definition uart.h:54
@ VSF_USART_7_BIT_LENGTH
Definition uart.h:39
@ VSF_USART_1_STOPBIT
Definition uart.h:44
@ VSF_USART_FORCE_1_PARITY
Definition uart.h:57
@ VSF_USART_RX_DISABLE
Definition uart.h:68
@ VSF_USART_2_STOPBIT
Definition uart.h:45
@ VSF_USART_CTS_HWCONTROL
Definition uart.h:61
@ VSF_USART_5_BIT_LENGTH
Definition uart.h:41
@ VSF_USART_RTS_CTS_HWCONTROL
Definition uart.h:62
@ VSF_USART_TX_DISABLE
Definition uart.h:65
@ VSF_USART_6_BIT_LENGTH
Definition uart.h:40
@ VSF_USART_NO_HWCONTROL
Definition uart.h:59
@ VSF_USART_1_5_STOPBIT
Definition uart.h:46
vsf_usart_irq_mask_t
Definition uart.h:84
@ VSF_USART_IRQ_MASK_OVERFLOW_ERR
Definition uart.h:101
@ VSF_USART_IRQ_MASK_TX
Definition uart.h:87
@ VSF_USART_IRQ_MASK_BREAK_ERR
Definition uart.h:100
@ VSF_USART_IRQ_MASK_RX
Definition uart.h:86
@ VSF_USART_IRQ_MASK_RX_TIMEOUT
Definition uart.h:91
@ VSF_USART_IRQ_MASK_PARITY_ERR
Definition uart.h:99
@ VSF_USART_IRQ_MASK_FRAME_ERR
Definition uart.h:98
@ VSF_USART_IRQ_MASK_TX_CPL
Definition uart.h:35
@ VSF_USART_IRQ_MASK_RX_CPL
Definition uart.h:36
#define UART_MSIRQEN_MSK
Definition i_reg_uart.h:85
#define UART_TXIRQEN_MSK
Definition i_reg_uart.h:91
#define UART_PTIRQEN_MSK
Definition i_reg_uart.h:82
#define UART_LSIRQEN_MSK
Definition i_reg_uart.h:88
#define UART_RXIRQEN_MSK
Definition i_reg_uart.h:94