UARTMSP432.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2018, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
85 #ifndef ti_drivers_uart_UARTMSP432__include
86 #define ti_drivers_uart_UARTMSP432__include
87 
88 #ifdef __cplusplus
89 extern "C" {
90 #endif
91 
92 #include <stdint.h>
93 #include <stdbool.h>
94 
95 #include <ti/devices/DeviceFamily.h>
96 
97 #include <ti/drivers/dpl/ClockP.h>
98 #include <ti/drivers/dpl/HwiP.h>
99 #include <ti/drivers/dpl/SemaphoreP.h>
100 #include <ti/drivers/Power.h>
101 #include <ti/drivers/UART.h>
103 
104 #include <ti/devices/msp432p4xx/inc/msp.h>
105 
106 #define UARTMSP432_P1_2_UCA0RXD 0x00000112 /* Primary, port 1, pin 2 */
107 #define UARTMSP432_P1_3_UCA0TXD 0x00000113 /* Primary, port 1, pin 3 */
108 
109 /* Port 2, pin 0 */
110 #define UARTMSP432_P2_0_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x20)
111 #define UARTMSP432_P2_0_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x20)
112 #define UARTMSP432_P2_0_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x20)
113 #define UARTMSP432_P2_0_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x20)
114 #define UARTMSP432_P2_0_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x20)
115 #define UARTMSP432_P2_0_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x20)
116 
117 /* Port 2, pin 1 */
118 #define UARTMSP432_P2_1_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x21)
119 #define UARTMSP432_P2_1_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x21)
120 #define UARTMSP432_P2_1_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x21)
121 #define UARTMSP432_P2_1_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x21)
122 #define UARTMSP432_P2_1_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x21)
123 #define UARTMSP432_P2_1_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x21)
124 
125 /* Port 2, pin 2 */
126 #define UARTMSP432_P2_2_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x22)
127 #define UARTMSP432_P2_2_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x22)
128 #define UARTMSP432_P2_2_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x22)
129 #define UARTMSP432_P2_2_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x22)
130 #define UARTMSP432_P2_2_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x22)
131 #define UARTMSP432_P2_2_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x22)
132 
133 /* Port 2, pin 3 */
134 #define UARTMSP432_P2_3_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x23)
135 #define UARTMSP432_P2_3_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x23)
136 #define UARTMSP432_P2_3_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x23)
137 #define UARTMSP432_P2_3_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x23)
138 #define UARTMSP432_P2_3_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x23)
139 #define UARTMSP432_P2_3_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x23)
140 
141 /* Port 2, pin 4 */
142 #define UARTMSP432_P2_4_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x24)
143 #define UARTMSP432_P2_4_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x24)
144 #define UARTMSP432_P2_4_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x24)
145 #define UARTMSP432_P2_4_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x24)
146 #define UARTMSP432_P2_4_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x24)
147 #define UARTMSP432_P2_4_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x24)
148 
149 /* Port 2, pin 5 */
150 #define UARTMSP432_P2_5_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x25)
151 #define UARTMSP432_P2_5_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x25)
152 #define UARTMSP432_P2_5_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x25)
153 #define UARTMSP432_P2_5_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x25)
154 #define UARTMSP432_P2_5_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x25)
155 #define UARTMSP432_P2_5_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x25)
156 
157 /* Port 2, pin 6 */
158 #define UARTMSP432_P2_6_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x26)
159 #define UARTMSP432_P2_6_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x26)
160 #define UARTMSP432_P2_6_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x26)
161 #define UARTMSP432_P2_6_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x26)
162 #define UARTMSP432_P2_6_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x26)
163 #define UARTMSP432_P2_6_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x26)
164 
165 /* Port 2, pin 7 */
166 #define UARTMSP432_P2_7_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x27)
167 #define UARTMSP432_P2_7_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x27)
168 #define UARTMSP432_P2_7_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x27)
169 #define UARTMSP432_P2_7_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x27)
170 #define UARTMSP432_P2_7_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x27)
171 #define UARTMSP432_P2_7_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x27)
172 
173 /* Port 3, pin 0 */
174 #define UARTMSP432_P3_0_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x30)
175 #define UARTMSP432_P3_0_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x30)
176 #define UARTMSP432_P3_0_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x30)
177 #define UARTMSP432_P3_0_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x30)
178 #define UARTMSP432_P3_0_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x30)
179 #define UARTMSP432_P3_0_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x30)
180 
181 /* Port 3, pin 1 */
182 #define UARTMSP432_P3_1_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x31)
183 #define UARTMSP432_P3_1_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x31)
184 #define UARTMSP432_P3_1_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x31)
185 #define UARTMSP432_P3_1_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x31)
186 #define UARTMSP432_P3_1_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x31)
187 #define UARTMSP432_P3_1_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x31)
188 
189 /* Port 3, pin 2 */
190 #define UARTMSP432_P3_2_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x32)
191 #define UARTMSP432_P3_2_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x32)
192 #define UARTMSP432_P3_2_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x32)
193 #define UARTMSP432_P3_2_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x32)
194 #define UARTMSP432_P3_2_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x32)
195 #define UARTMSP432_P3_2_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x32)
196 
197 /* Port 3, pin 3 */
198 #define UARTMSP432_P3_3_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x33)
199 #define UARTMSP432_P3_3_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x33)
200 #define UARTMSP432_P3_3_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x33)
201 #define UARTMSP432_P3_3_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x33)
202 #define UARTMSP432_P3_3_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x33)
203 #define UARTMSP432_P3_3_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x33)
204 
205 /* Port 3, pin 4 */
206 #define UARTMSP432_P3_4_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x34)
207 #define UARTMSP432_P3_4_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x34)
208 #define UARTMSP432_P3_4_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x34)
209 #define UARTMSP432_P3_4_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x34)
210 #define UARTMSP432_P3_4_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x34)
211 #define UARTMSP432_P3_4_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x34)
212 
213 /* Port 3, pin 5 */
214 #define UARTMSP432_P3_5_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x35)
215 #define UARTMSP432_P3_5_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x35)
216 #define UARTMSP432_P3_5_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x35)
217 #define UARTMSP432_P3_5_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x35)
218 #define UARTMSP432_P3_5_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x35)
219 #define UARTMSP432_P3_5_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x35)
220 
221 /* Port 3, pin 6 */
222 #define UARTMSP432_P3_6_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x36)
223 #define UARTMSP432_P3_6_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x36)
224 #define UARTMSP432_P3_6_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x36)
225 #define UARTMSP432_P3_6_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x36)
226 #define UARTMSP432_P3_6_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x36)
227 #define UARTMSP432_P3_6_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x36)
228 
229 /* Port 3, pin 7 */
230 #define UARTMSP432_P3_7_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x37)
231 #define UARTMSP432_P3_7_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x37)
232 #define UARTMSP432_P3_7_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x37)
233 #define UARTMSP432_P3_7_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x37)
234 #define UARTMSP432_P3_7_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x37)
235 #define UARTMSP432_P3_7_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x37)
236 
237 /* Port 7, pin 0 */
238 #define UARTMSP432_P7_0_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x70)
239 #define UARTMSP432_P7_0_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x70)
240 #define UARTMSP432_P7_0_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x70)
241 #define UARTMSP432_P7_0_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x70)
242 #define UARTMSP432_P7_0_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x70)
243 #define UARTMSP432_P7_0_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x70)
244 
245 /* Port 7, pin 1 */
246 #define UARTMSP432_P7_1_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x71)
247 #define UARTMSP432_P7_1_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x71)
248 #define UARTMSP432_P7_1_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x71)
249 #define UARTMSP432_P7_1_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x71)
250 #define UARTMSP432_P7_1_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x71)
251 #define UARTMSP432_P7_1_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x71)
252 
253 /* Port 7, pin 2 */
254 #define UARTMSP432_P7_2_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x72)
255 #define UARTMSP432_P7_2_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x72)
256 #define UARTMSP432_P7_2_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x72)
257 #define UARTMSP432_P7_2_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x72)
258 #define UARTMSP432_P7_2_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x72)
259 #define UARTMSP432_P7_2_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x72)
260 
261 /* Port 7, pin 3 */
262 #define UARTMSP432_P7_3_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x73)
263 #define UARTMSP432_P7_3_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x73)
264 #define UARTMSP432_P7_3_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x73)
265 #define UARTMSP432_P7_3_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x73)
266 #define UARTMSP432_P7_3_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x73)
267 #define UARTMSP432_P7_3_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x73)
268 
269 /* Port 7, pin 4 */
270 #define UARTMSP432_P7_4_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x74)
271 #define UARTMSP432_P7_4_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x74)
272 #define UARTMSP432_P7_4_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x74)
273 #define UARTMSP432_P7_4_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x74)
274 #define UARTMSP432_P7_4_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x74)
275 #define UARTMSP432_P7_4_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x74)
276 
277 /* Port 7, pin 5 */
278 #define UARTMSP432_P7_5_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x75)
279 #define UARTMSP432_P7_5_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x75)
280 #define UARTMSP432_P7_5_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x75)
281 #define UARTMSP432_P7_5_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x75)
282 #define UARTMSP432_P7_5_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x75)
283 #define UARTMSP432_P7_5_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x75)
284 
285 /* Port 7, pin 6 */
286 #define UARTMSP432_P7_6_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x76)
287 #define UARTMSP432_P7_6_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x76)
288 #define UARTMSP432_P7_6_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x76)
289 #define UARTMSP432_P7_6_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x76)
290 #define UARTMSP432_P7_6_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x76)
291 #define UARTMSP432_P7_6_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x76)
292 
293 /* Port 7, pin 7 */
294 #define UARTMSP432_P7_7_UCA0RXD ((PMAP_UCA0RXD << 10) | 0x77)
295 #define UARTMSP432_P7_7_UCA0TXD ((PMAP_UCA0TXD << 10) | 0x77)
296 #define UARTMSP432_P7_7_UCA1RXD ((PMAP_UCA1RXD << 10) | 0x77)
297 #define UARTMSP432_P7_7_UCA1TXD ((PMAP_UCA1TXD << 10) | 0x77)
298 #define UARTMSP432_P7_7_UCA2RXD ((PMAP_UCA2RXD << 10) | 0x77)
299 #define UARTMSP432_P7_7_UCA2TXD ((PMAP_UCA2TXD << 10) | 0x77)
300 
301 #define UARTMSP432_P9_6_UCA3RXD 0x00000196 /* Primary, port 9, pin 6 */
302 #define UARTMSP432_P9_7_UCA3TXD 0x00000197 /* Primeary, port 9, pin 7 */
303 
314 /* Add UARTMSP432_STATUS_* macros here */
315 
328 /* Add UARTMSP432_CMD_* macros here */
329 
332 /* UART function table pointer */
334 
347 typedef void (*UARTMSP432_ErrorCallback) (UART_Handle handle, uint32_t error);
348 
370 typedef struct UARTMSP432_FxnSet {
371  bool (*readIsrFxn) (UART_Handle handle);
372  int (*readTaskFxn) (UART_Handle handle);
374 
406  uint32_t outputBaudrate;
407  uint32_t inputClockFreq;
409  uint16_t prescalar;
410  uint8_t hwRegUCBRFx;
411  uint8_t hwRegUCBRSx;
412  uint8_t oversampling;
414 
467 typedef struct UARTMSP432_HWAttrsV1 {
469  unsigned int baseAddr;
471  unsigned int intNum;
473  unsigned int intPriority;
475  uint8_t clockSource;
477  uint32_t bitOrder;
483  unsigned char *ringBufPtr;
485  size_t ringBufSize;
486 
487  uint16_t rxPin;
488  uint16_t txPin;
492 
498 typedef struct UARTMSP432_Object {
499  /* UART state variable */
500  struct {
501  bool opened:1; /* Has the obj been opened */
502  UART_Mode readMode:1; /* Mode for all read calls */
503  UART_Mode writeMode:1; /* Mode for all write calls */
504  UART_DataMode readDataMode:1; /* Type of data being read */
505  UART_DataMode writeDataMode:1; /* Type of data being written */
506  UART_ReturnMode readReturnMode:1; /* Receive return mode */
507  UART_Echo readEcho:1; /* Echo received data back */
508  bool writeCR:1; /* Write a return character */
509  /*
510  * Flag to determine if a timeout has occurred when the user called
511  * UART_read(). This flag is set by the timeoutClk clock object.
512  */
513  bool bufTimeout:1;
514  /*
515  * Flag to determine when an ISR needs to perform a callback; in both
516  * UART_MODE_BLOCKING or UART_MODE_CALLBACK
517  */
518  bool callCallback:1;
519  /*
520  * Flag to determine if the ISR is in control draining the ring buffer
521  * when in UART_MODE_CALLBACK
522  */
523  bool drainByISR:1;
524  /* Flag to keep the state of the read Power constraints */
525  bool rxEnabled:1;
526  /* Flag to keep the state of the write Power constraints */
527  bool txEnabled:1;
528 
529  /* Flags to prevent recursion in read callback mode */
530  bool inReadCallback:1;
531  volatile bool readCallbackPending:1;
532  } state;
533 
534  HwiP_Handle hwiHandle; /* Hwi handle for interrupts */
535  ClockP_Handle timeoutClk; /* Clock object to for timeouts */
536  uint32_t baudRate; /* Baud rate for UART */
537  UART_STOP stopBits; /* Stop bits for UART */
538  UART_PAR parityType; /* Parity bit type for UART */
539  UART_LEN dataLength; /* 7 or 8-bit data supported */
540 
541  /* UART read variables */
542  RingBuf_Object ringBuffer; /* local circular buffer object */
543  /* A complement pair of read functions for both the ISR and UART_read() */
545  unsigned char *readBuf; /* Buffer data pointer */
546  size_t readSize; /* Desired number of bytes to read */
547  size_t readCount; /* Number of bytes left to read */
548  SemaphoreP_Handle readSem; /* UART read semaphore */
549  unsigned int readTimeout; /* Timeout for read semaphore */
550  UART_Callback readCallback; /* Pointer to read callback */
551 
552  /* UART write variables */
553  const unsigned char *writeBuf; /* Buffer data pointer */
554  size_t writeSize; /* Desired number of bytes to write*/
555  size_t writeCount; /* Number of bytes left to write */
556  SemaphoreP_Handle writeSem; /* UART write semaphore*/
557  unsigned int writeTimeout; /* Timeout for write semaphore */
558  UART_Callback writeCallback; /* Pointer to write callback */
559  unsigned int writeEmptyClkTimeout; /* TX FIFO timeout tick count */
560 
564 
565 #ifdef __cplusplus
566 }
567 #endif
568 
569 #endif /* ti_drivers_uart_UARTMSP432__include */
unsigned int baseAddr
Definition: UARTMSP432.h:469
UARTMSP432 Baudrate configuration.
Definition: UARTMSP432.h:405
uint32_t outputBaudrate
Definition: UARTMSP432.h:406
uint32_t baudRate
Definition: UARTMSP432.h:536
RingBuf_Object ringBuffer
Definition: UARTMSP432.h:542
enum UART_Echo_ UART_Echo
UART echo settings.
SemaphoreP_Handle writeSem
Definition: UARTMSP432.h:556
unsigned int writeEmptyClkTimeout
Definition: UARTMSP432.h:559
UART_LEN dataLength
Definition: UARTMSP432.h:539
uint8_t clockSource
Definition: UARTMSP432.h:475
unsigned char * ringBufPtr
Definition: UARTMSP432.h:483
struct UARTMSP432_BaudrateConfig UARTMSP432_BaudrateConfig
UARTMSP432 Baudrate configuration.
uint32_t inputClockFreq
Definition: UARTMSP432.h:407
uint16_t prescalar
Definition: UARTMSP432.h:409
enum UART_PAR_ UART_PAR
UART parity type settings.
const unsigned char * writeBuf
Definition: UARTMSP432.h:553
Power Manager interface.
enum UART_LEN_ UART_LEN
UART data length settings.
enum UART_Mode_ UART_Mode
UART mode settings.
Power notify object structure.
Definition: Power.h:121
struct UARTMSP432_FxnSet UARTMSP432_FxnSet
Complement set of read functions to be used by the UART ISR and UARTMSP432_read(). Internal use only.
uint32_t bitOrder
Definition: UARTMSP432.h:477
uint16_t txPin
Definition: UARTMSP432.h:488
ClockP_Handle timeoutClk
Definition: UARTMSP432.h:535
UART_PAR parityType
Definition: UARTMSP432.h:538
UART Global configuration.
Definition: UART.h:680
uint8_t numBaudrateEntries
Definition: UARTMSP432.h:479
void(* UARTMSP432_ErrorCallback)(UART_Handle handle, uint32_t error)
The definition of an optional callback function used by the UART driver to notify the application whe...
Definition: UARTMSP432.h:347
size_t writeSize
Definition: UARTMSP432.h:554
struct UARTMSP432_Object * UARTMSP432_Handle
size_t ringBufSize
Definition: UARTMSP432.h:485
uint16_t rxPin
Definition: UARTMSP432.h:487
Power_NotifyObj perfChangeNotify
Definition: UARTMSP432.h:561
size_t readCount
Definition: UARTMSP432.h:547
Complement set of read functions to be used by the UART ISR and UARTMSP432_read(). Internal use only.
Definition: UARTMSP432.h:370
UART_Callback writeCallback
Definition: UARTMSP432.h:558
The definition of a UART function table that contains the required set of functions to control a spec...
Definition: UART.h:637
HwiP_Handle hwiHandle
Definition: UARTMSP432.h:534
UARTMSP432 Hardware attributes.
Definition: UARTMSP432.h:467
UART driver interface.
const UART_FxnTable UARTMSP432_fxnTable
uint8_t oversampling
Definition: UARTMSP432.h:412
unsigned int readTimeout
Definition: UARTMSP432.h:549
size_t readSize
Definition: UARTMSP432.h:546
int(* readTaskFxn)(UART_Handle handle)
Definition: UARTMSP432.h:372
enum UART_STOP_ UART_STOP
UART stop bit settings.
enum UART_ReturnMode_ UART_ReturnMode
UART return mode settings.
unsigned int intPriority
Definition: UARTMSP432.h:473
SemaphoreP_Handle readSem
Definition: UARTMSP432.h:548
uint32_t perfConstraintMask
Definition: UARTMSP432.h:562
UART_STOP stopBits
Definition: UARTMSP432.h:537
Definition: RingBuf.h:44
uint8_t hwRegUCBRFx
Definition: UARTMSP432.h:410
UARTMSP432_FxnSet readFxns
Definition: UARTMSP432.h:544
UART_Callback readCallback
Definition: UARTMSP432.h:550
UARTMSP432 Object.
Definition: UARTMSP432.h:498
unsigned char * readBuf
Definition: UARTMSP432.h:545
bool(* readIsrFxn)(UART_Handle handle)
Definition: UARTMSP432.h:371
UARTMSP432_ErrorCallback errorFxn
Definition: UARTMSP432.h:490
struct UARTMSP432_HWAttrsV1 UARTMSP432_HWAttrsV1
UARTMSP432 Hardware attributes.
struct UARTMSP432_Object UARTMSP432_Object
UARTMSP432 Object.
unsigned int intNum
Definition: UARTMSP432.h:471
uint8_t hwRegUCBRSx
Definition: UARTMSP432.h:411
void(* UART_Callback)(UART_Handle handle, void *buf, size_t count)
The definition of a callback function used by the UART driver when used in UART_MODE_CALLBACK The cal...
Definition: UART.h:423
unsigned int writeTimeout
Definition: UARTMSP432.h:557
UARTMSP432_BaudrateConfig const * baudrateLUT
Definition: UARTMSP432.h:481
enum UART_DataMode_ UART_DataMode
UART data mode settings.
size_t writeCount
Definition: UARTMSP432.h:555
© Copyright 1995-2018, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale