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_LUAT_AIR105_UART_H__
19#define __HAL_DRIVER_LUAT_AIR105_UART_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "hal/vsf_hal_cfg.h"
24
25#if VSF_HAL_USE_USART == ENABLED
26#include "../__device.h"
27
28/*============================ MACROS ========================================*/
29
30#define VSF_USART_CFG_REIMPLEMENT_TYPE_MODE ENABLED
31#define VSF_USART_CFG_REIMPLEMENT_TYPE_IRQ_MASK ENABLED
32
33/*============================ MACROFIED FUNCTIONS ===========================*/
34/*============================ TYPES =========================================*/
35
36typedef enum vsf_usart_mode_t {
37 // hardware
38 VSF_USART_8_BIT_LENGTH = (0x3ul << 0),
39 VSF_USART_7_BIT_LENGTH = (0x2ul << 0),
40 VSF_USART_6_BIT_LENGTH = (0x1ul << 0),
41 VSF_USART_5_BIT_LENGTH = (0x0ul << 0),
42
43
44 VSF_USART_1_STOPBIT = (0x0ul << 2),
45 VSF_USART_2_STOPBIT = (0x1ul << 2),
46 VSF_USART_1_5_STOPBIT = (0x1ul << 2), // for VSF_USART_5_BIT_LENGTH only
47
48
49 VSF_USART_NO_PARITY = (0x0ul << 3),
50 VSF_USART_ODD_PARITY = (0x1ul << 3),
51 VSF_USART_EVEN_PARITY = (0x3ul << 3),
52
53 // Not hardware, just keep for build
54 VSF_USART_9_BIT_LENGTH = (0x1ul << 24),
55
56 VSF_USART_FORCE_0_PARITY = (0x1ul << 25),
57 VSF_USART_FORCE_1_PARITY = (0x2ul << 25),
58
59 VSF_USART_NO_HWCONTROL = (0x0ul << 28),
60 VSF_USART_RTS_HWCONTROL = (0x1ul << 28),
61 VSF_USART_CTS_HWCONTROL = (0x2ul << 28),
63
64 VSF_USART_TX_ENABLE = (0x1ul << 30),
65 VSF_USART_TX_DISABLE = (0x0ul << 30),
66
67 VSF_USART_RX_ENABLE = (0x1ul << 31),
68 VSF_USART_RX_DISABLE = (0x0ul << 31),
69
83
85 // usart fifo interrupt
88
90
92
93 // usart request interrupt
96
97 // usart error interrupt
102
106
107/*============================ INCLUDES ======================================*/
108/*============================ GLOBAL VARIABLES ==============================*/
109/*============================ INCLUDES ======================================*/
110/*============================ PROTOTYPES ====================================*/
111/*============================ IMPLEMENTATION ================================*/
112
113#endif
114#endif
115/* EOF */
vsf_usart_mode_t
Definition uart.h:32
vsf_usart_irq_mask_t
Definition uart.h:105
@ 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
@ AIR105_VSF_USART_STOPBIT_MASK
Definition uart.h:74
@ 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
@ AIR105_VSF_USART_PARITY_MASK
Definition uart.h:76
@ 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
@ AIR105_VSF_USART_BIT_LENGTH_MASK
Definition uart.h:70
@ VSF_USART_TX_DISABLE
Definition uart.h:65
@ AIR105_USART_MODE_ALL_BITS_MASK
Definition uart.h:79
@ 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
@ AIR105_USART_IRQ_MASK
Definition uart.h:103
@ 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
@ AIR105_USART_IRQ_MASK_FIFO
Definition uart.h:89
@ 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