1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// UART constants that bindgen can't generate
/***************************************************************************/
/**
Data Bits Length
================
The following defines are used to build the value of the MSS_UART_init(),
MSS_UART_lin_init(), MSS_UART_irda_init(), and MSS_UART_smartcard_init()
functions line_config parameter.
| Constant | Description |
|----------------------|----------------------------|
| MSS_UART_DATA_5_BITS | 5 bits of data transmitted |
| MSS_UART_DATA_6_BITS | 6 bits of data transmitted |
| MSS_UART_DATA_7_BITS | 7 bits of data transmitted |
| MSS_UART_DATA_8_BITS | 8 bits of data transmitted |
*/
pub const MSS_UART_DATA_5_BITS: u8 = 0x00;
pub const MSS_UART_DATA_6_BITS: u8 = 0x01;
pub const MSS_UART_DATA_7_BITS: u8 = 0x02;
pub const MSS_UART_DATA_8_BITS: u8 = 0x03;
/***************************************************************************/
/**
Parity
======
The following defines are used to build the value of the MSS_UART_init(),
MSS_UART_lin_init(), MSS_UART_irda_init(), and MSS_UART_smartcard_init()
functions line_config parameter.
| Constant | Description |
|-------------------------|--------------------------|
| MSS_UART_NO_PARITY | No parity |
| MSS_UART_ODD_PARITY | Odd Parity |
| MSS_UART_EVEN_PARITY | Even parity |
| MSS_UART_STICK_PARITY_0 | Stick parity bit to zero |
| MSS_UART_STICK_PARITY_1 | Stick parity bit to one |
*/
pub const MSS_UART_NO_PARITY: u8 = 0x00;
pub const MSS_UART_ODD_PARITY: u8 = 0x08;
pub const MSS_UART_EVEN_PARITY: u8 = 0x18;
pub const MSS_UART_STICK_PARITY_0: u8 = 0x38;
pub const MSS_UART_STICK_PARITY_1: u8 = 0x28;
/***************************************************************************/
/**
Number of Stop Bits
===================
The following defines are used to build the value of the MSS_UART_init(),
MSS_UART_lin_init(), MSS_UART_irda_init(), and MSS_UART_smartcard_init()
functions line_config parameter.
| Constant | Description |
|---------------------------|--------------------------|
| MSS_UART_ONE_STOP_BIT | One Stop bit |
| MSS_UART_ONEHALF_STOP_BIT | One and a half Stop bits |
| MSS_UART_TWO_STOP_BITS | Two Stop bits |
*/
pub const MSS_UART_ONE_STOP_BIT: u8 = 0x00;
pub const MSS_UART_ONEHALF_STOP_BIT: u8 = 0x04;
pub const MSS_UART_TWO_STOP_BITS: u8 = 0x04;
/***************************************************************************/
/**
Receiver Error Status
=====================
The following defines are used to determine the UART receiver error type.
These bit mask constants are used with the return value of the
MSS_UART_get_rx_status() function to find out if any errors occurred while
receiving data.
| Constant | Description |
|------------------------|--------------------------------------------|
| MSS_UART_NO_ERROR | No error bit mask (0x00) |
| MSS_UART_OVERUN_ERROR | Overrun error bit mask (0x02) |
| MSS_UART_PARITY_ERROR | Parity error bit mask (0x04) |
| MSS_UART_FRAMING_ERROR | Framing error bit mask (0x08) |
| MSS_UART_BREAK_ERROR | Break error bit mask (0x10) |
| MSS_UART_FIFO_ERROR | FIFO error bit mask (0x80) |
| MSS_UART_INVALID_PARAM | Invalid function parameter bit mask (0xFF) |
*/
pub const MSS_UART_INVALID_PARAM: u8 = 0xFF;
pub const MSS_UART_NO_ERROR: u8 = 0x00;
pub const MSS_UART_OVERUN_ERROR: u8 = 0x02;
pub const MSS_UART_PARITY_ERROR: u8 = 0x04;
pub const MSS_UART_FRAMING_ERROR: u8 = 0x08;
pub const MSS_UART_BREAK_ERROR: u8 = 0x10;
pub const MSS_UART_FIFO_ERROR: u8 = 0x80;
/***************************************************************************/
/**
Transmitter Status
==================
The following definitions are used to determine the UART transmitter status.
These bit mask constants are used with the return value of the
MSS_UART_get_tx_status() function to find out the status of the transmitter.
| Constant | Description |
|------------------|----------------------------------------------------|
| MSS_UART_TX_BUSY | Transmitter busy (0x00) |
| MSS_UART_THRE | Transmitter holding register empty bit mask (0x20) |
| MSS_UART_TEMT | Transmitter empty bit mask (0x40) |
*/
pub const MSS_UART_TX_BUSY: u8 = 0x00;
pub const MSS_UART_THRE: u8 = 0x20;
pub const MSS_UART_TEMT: u8 = 0x40;
/***************************************************************************/
/**
Modem Status
============
The following defines are used to determine the modem status. These bit
mask constants are used with the return value of the
MSS_UART_get_modem_status() function to find out the modem status of
the UART.
| Constant | Description |
|---------------|-------------------------------------------------|
| MSS_UART_DCTS | Delta clear to send bit mask (0x01) |
| MSS_UART_DDSR | Delta data set ready bit mask (0x02) |
| MSS_UART_TERI | Trailing edge of ring indicator bit mask (0x04) |
| MSS_UART_DDCD | Delta data carrier detect bit mask (0x08) |
| MSS_UART_CTS | Clear to send bit mask (0x10) |
| MSS_UART_DSR | Data set ready bit mask (0x20) |
| MSS_UART_RI | Ring indicator bit mask (0x40) |
| MSS_UART_DCD | Data carrier detect bit mask (0x80) |
*/
pub const MSS_UART_DCTS: u8 = 0x01;
pub const MSS_UART_DDSR: u8 = 0x02;
pub const MSS_UART_TERI: u8 = 0x04;
pub const MSS_UART_DDCD: u8 = 0x08;
pub const MSS_UART_CTS: u8 = 0x10;
pub const MSS_UART_DSR: u8 = 0x20;
pub const MSS_UART_RI: u8 = 0x40;
pub const MSS_UART_DCD: u8 = 0x80;