@@ -60,11 +60,11 @@ pub enum Error {
60
60
}
61
61
62
62
/// UART interrupt events
63
+ #[ cfg( feature = "uart_v2" ) ]
63
64
#[ enumflags2:: bitflags]
64
65
#[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
65
66
#[ derive( Debug , Eq , PartialEq , Copy , Clone ) ]
66
- #[ cfg_attr( feature = "f4" , repr( u16 ) ) ]
67
- #[ cfg_attr( feature = "f7" , repr( u32 ) ) ]
67
+ #[ repr( u16 ) ]
68
68
pub enum Event {
69
69
/// IDLE interrupt enable
70
70
Idle = 1 << 4 ,
@@ -78,12 +78,64 @@ pub enum Event {
78
78
ParityError = 1 << 8 ,
79
79
}
80
80
81
+ /// UART interrupt events
82
+ #[ cfg( feature = "uart_v3" ) ]
83
+ #[ enumflags2:: bitflags]
84
+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
85
+ #[ derive( Debug , Eq , PartialEq , Copy , Clone ) ]
86
+ #[ repr( u32 ) ]
87
+ pub enum Event {
88
+ /// IDLE interrupt enable
89
+ Idle = 1 << 4 ,
90
+ /// RXNE interrupt enable
91
+ RxNotEmpty = 1 << 5 ,
92
+ /// Transmission complete interrupt enable
93
+ TransmissionComplete = 1 << 6 ,
94
+ /// TXE interrupt enable
95
+ TxEmpty = 1 << 7 ,
96
+ /// PE interrupt enable
97
+ ParityError = 1 << 8 ,
98
+ /// Character match interrupt enable
99
+ CharacterMatch = 1 << 14 ,
100
+ /// End of Block interrupt enable
101
+ EndOfBlock = 1 << 27 ,
102
+ }
103
+
104
+ /// UART/USART status flags
105
+ #[ cfg( feature = "uart_v2" ) ]
106
+ #[ enumflags2:: bitflags]
107
+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
108
+ #[ derive( Debug , Eq , PartialEq , Copy , Clone ) ]
109
+ #[ repr( u16 ) ]
110
+ pub enum Flag {
111
+ /// Parity error
112
+ ParityError = 1 << 0 ,
113
+ /// Framing error
114
+ FramingError = 1 << 1 ,
115
+ /// Noise detected flag
116
+ Noise = 1 << 2 ,
117
+ /// Overrun error
118
+ Overrun = 1 << 3 ,
119
+ /// IDLE line detected
120
+ Idle = 1 << 4 ,
121
+ /// Read data register not empty
122
+ RxNotEmpty = 1 << 5 ,
123
+ /// Transmission complete
124
+ TransmissionComplete = 1 << 6 ,
125
+ /// Transmit data register empty
126
+ TxEmpty = 1 << 7 ,
127
+ /// LIN break detection flag
128
+ LinBreak = 1 << 8 ,
129
+ /// CTS flag
130
+ CtsInterrupt = 1 << 9 ,
131
+ }
132
+
81
133
/// UART/USART status flags
82
134
#[ enumflags2:: bitflags]
135
+ #[ cfg( feature = "uart_v3" ) ]
83
136
#[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
84
137
#[ derive( Debug , Eq , PartialEq , Copy , Clone ) ]
85
- #[ cfg_attr( feature = "f4" , repr( u16 ) ) ]
86
- #[ cfg_attr( feature = "f7" , repr( u32 ) ) ]
138
+ #[ repr( u32 ) ]
87
139
pub enum Flag {
88
140
/// Parity error
89
141
ParityError = 1 << 0 ,
@@ -103,16 +155,36 @@ pub enum Flag {
103
155
TxEmpty = 1 << 7 ,
104
156
/// LIN break detection flag
105
157
LinBreak = 1 << 8 ,
158
+ /// CTS interrupt
159
+ CtsInterrupt = 1 << 9 ,
106
160
/// CTS flag
107
- Cts = 1 << 9 ,
161
+ CtsStatus = 1 << 10 ,
162
+ /// Receiver timeout
163
+ ReceiverTimeout = 1 << 11 ,
164
+ /// End of block
165
+ EndOfBlock = 1 << 12 ,
166
+ /// Auto baud rate error
167
+ AutoBaudRateError = 1 << 14 ,
168
+ /// Auto baud rate
169
+ AutoBaudRateFlag = 1 << 15 ,
170
+ /// Busy flag
171
+ Busy = 1 << 16 ,
172
+ /// Character match
173
+ CharacterMatch = 1 << 17 ,
174
+ /// Send break
175
+ SendBreak = 1 << 18 ,
176
+ /// Receiver wakeup from Mute mode
177
+ ReceiverWakeup = 1 << 19 ,
178
+ /// Transmit enable acknowledge
179
+ TransmitEnableAck = 1 << 21 ,
108
180
}
109
181
110
182
/// UART clearable flags
183
+ #[ cfg( feature = "uart_v2" ) ]
111
184
#[ enumflags2:: bitflags]
112
185
#[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
113
186
#[ derive( Debug , Eq , PartialEq , Copy , Clone ) ]
114
- #[ cfg_attr( feature = "f4" , repr( u16 ) ) ]
115
- #[ cfg_attr( feature = "f7" , repr( u32 ) ) ]
187
+ #[ repr( u16 ) ]
116
188
pub enum CFlag {
117
189
/// Read data register not empty
118
190
RxNotEmpty = 1 << 5 ,
@@ -122,6 +194,37 @@ pub enum CFlag {
122
194
LinBreak = 1 << 8 ,
123
195
}
124
196
197
+ /// UART clearable flags
198
+ #[ cfg( feature = "uart_v3" ) ]
199
+ #[ enumflags2:: bitflags]
200
+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
201
+ #[ derive( Debug , Eq , PartialEq , Copy , Clone ) ]
202
+ #[ repr( u32 ) ]
203
+ pub enum CFlag {
204
+ /// Parity error
205
+ ParityError = 1 << 0 ,
206
+ /// Framing error
207
+ FramingError = 1 << 1 ,
208
+ /// Noise detected
209
+ Noise = 1 << 2 ,
210
+ /// Overrun error
211
+ Overrun = 1 << 3 ,
212
+ /// Idle line detected
213
+ Idle = 1 << 4 ,
214
+ /// Transmission complete
215
+ TransmissionComplete = 1 << 6 ,
216
+ /// LIN break detection flag
217
+ LinBreak = 1 << 8 ,
218
+ /// CTS interrupt
219
+ CtsInterrupt = 1 << 9 ,
220
+ /// Receiver timeout
221
+ ReceiverTimeout = 1 << 11 ,
222
+ /// End of block
223
+ EndOfBlock = 1 << 12 ,
224
+ /// Character match
225
+ CharacterMatch = 1 << 17 ,
226
+ }
227
+
125
228
pub mod config;
126
229
127
230
pub use config:: Config ;
0 commit comments