]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS/driverlib/MSP430FR5xx_6xx/eusci_a_uart.h
Add CCS project for MSP430FR5969 demo.
[freertos] / FreeRTOS / Demo / MSP430X_MSP430FR5969_LaunchPad_IAR_CCS / driverlib / MSP430FR5xx_6xx / eusci_a_uart.h
1 /* --COPYRIGHT--,BSD\r
2  * Copyright (c) 2014, Texas Instruments Incorporated\r
3  * All rights reserved.\r
4  *\r
5  * Redistribution and use in source and binary forms, with or without\r
6  * modification, are permitted provided that the following conditions\r
7  * are met:\r
8  *\r
9  * *  Redistributions of source code must retain the above copyright\r
10  *    notice, this list of conditions and the following disclaimer.\r
11  *\r
12  * *  Redistributions in binary form must reproduce the above copyright\r
13  *    notice, this list of conditions and the following disclaimer in the\r
14  *    documentation and/or other materials provided with the distribution.\r
15  *\r
16  * *  Neither the name of Texas Instruments Incorporated nor the names of\r
17  *    its contributors may be used to endorse or promote products derived\r
18  *    from this software without specific prior written permission.\r
19  *\r
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\r
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\r
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
31  * --/COPYRIGHT--*/\r
32 //*****************************************************************************\r
33 //\r
34 // eusci_a_uart.h - Driver for the EUSCI_A_UART Module.\r
35 //\r
36 //*****************************************************************************\r
37 \r
38 #ifndef __MSP430WARE_EUSCI_A_UART_H__\r
39 #define __MSP430WARE_EUSCI_A_UART_H__\r
40 \r
41 #include "inc/hw_memmap.h"\r
42 \r
43 #ifdef __MSP430_HAS_EUSCI_Ax__\r
44 \r
45 //*****************************************************************************\r
46 //\r
47 // If building with a C++ compiler, make all of the definitions in this header\r
48 // have a C binding.\r
49 //\r
50 //*****************************************************************************\r
51 #ifdef __cplusplus\r
52 extern "C"\r
53 {\r
54 #endif\r
55 \r
56 #include "inc/hw_regaccess.h"\r
57 //*****************************************************************************\r
58 //\r
59 // The following values are the sync characters possible.\r
60 //\r
61 //*****************************************************************************\r
62 #define DEFAULT_SYNC                                                       0x00\r
63 #define EUSCI_A_UART_AUTOMATICBAUDRATE_SYNC                                0x55\r
64 \r
65 //*****************************************************************************\r
66 //\r
67 //! \brief Used in the EUSCI_A_UART_init() function as the param parameter.\r
68 //\r
69 //*****************************************************************************\r
70 typedef struct EUSCI_A_UART_initParam\r
71 {\r
72     //! Selects Clock source.\r
73     //! \n Valid values are:\r
74     //! - \b EUSCI_A_UART_CLOCKSOURCE_SMCLK\r
75     //! - \b EUSCI_A_UART_CLOCKSOURCE_ACLK\r
76     uint8_t selectClockSource;\r
77     //! Is the value to be written into UCBRx bits\r
78     uint16_t clockPrescalar;\r
79     //! Is First modulation stage register setting. This value is a pre-\r
80     //! calculated value which can be obtained from the Device Users Guide.\r
81     //! This value is written into UCBRFx bits of UCAxMCTLW.\r
82     uint8_t firstModReg;\r
83     //! Is Second modulation stage register setting. This value is a pre-\r
84     //! calculated value which can be obtained from the Device Users Guide.\r
85     //! This value is written into UCBRSx bits of UCAxMCTLW.\r
86     uint8_t secondModReg;\r
87     //! Is the desired parity.\r
88     //! \n Valid values are:\r
89     //! - \b EUSCI_A_UART_NO_PARITY [Default]\r
90     //! - \b EUSCI_A_UART_ODD_PARITY\r
91     //! - \b EUSCI_A_UART_EVEN_PARITY\r
92     uint8_t parity;\r
93     //! Controls direction of receive and transmit shift register.\r
94     //! \n Valid values are:\r
95     //! - \b EUSCI_A_UART_MSB_FIRST\r
96     //! - \b EUSCI_A_UART_LSB_FIRST [Default]\r
97     uint16_t msborLsbFirst;\r
98     //! Indicates one/two STOP bits\r
99     //! \n Valid values are:\r
100     //! - \b EUSCI_A_UART_ONE_STOP_BIT [Default]\r
101     //! - \b EUSCI_A_UART_TWO_STOP_BITS\r
102     uint16_t numberofStopBits;\r
103     //! Selects the mode of operation\r
104     //! \n Valid values are:\r
105     //! - \b EUSCI_A_UART_MODE [Default]\r
106     //! - \b EUSCI_A_UART_IDLE_LINE_MULTI_PROCESSOR_MODE\r
107     //! - \b EUSCI_A_UART_ADDRESS_BIT_MULTI_PROCESSOR_MODE\r
108     //! - \b EUSCI_A_UART_AUTOMATIC_BAUDRATE_DETECTION_MODE\r
109     uint16_t uartMode;\r
110     //! Indicates low frequency or oversampling baud generation\r
111     //! \n Valid values are:\r
112     //! - \b EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION\r
113     //! - \b EUSCI_A_UART_LOW_FREQUENCY_BAUDRATE_GENERATION\r
114     uint8_t overSampling;\r
115 } EUSCI_A_UART_initParam;\r
116 \r
117 //*****************************************************************************\r
118 //\r
119 // The following are values that can be passed to the param parameter for\r
120 // functions: EUSCI_A_UART_init().\r
121 //\r
122 //*****************************************************************************\r
123 #define EUSCI_A_UART_NO_PARITY                                             0x00\r
124 #define EUSCI_A_UART_ODD_PARITY                                            0x01\r
125 #define EUSCI_A_UART_EVEN_PARITY                                           0x02\r
126 \r
127 //*****************************************************************************\r
128 //\r
129 // The following are values that can be passed to the param parameter for\r
130 // functions: EUSCI_A_UART_init().\r
131 //\r
132 //*****************************************************************************\r
133 #define EUSCI_A_UART_MSB_FIRST                                            UCMSB\r
134 #define EUSCI_A_UART_LSB_FIRST                                             0x00\r
135 \r
136 //*****************************************************************************\r
137 //\r
138 // The following are values that can be passed to the param parameter for\r
139 // functions: EUSCI_A_UART_init().\r
140 //\r
141 //*****************************************************************************\r
142 #define EUSCI_A_UART_MODE                                              UCMODE_0\r
143 #define EUSCI_A_UART_IDLE_LINE_MULTI_PROCESSOR_MODE                    UCMODE_1\r
144 #define EUSCI_A_UART_ADDRESS_BIT_MULTI_PROCESSOR_MODE                  UCMODE_2\r
145 #define EUSCI_A_UART_AUTOMATIC_BAUDRATE_DETECTION_MODE                 UCMODE_3\r
146 \r
147 //*****************************************************************************\r
148 //\r
149 // The following are values that can be passed to the param parameter for\r
150 // functions: EUSCI_A_UART_init().\r
151 //\r
152 //*****************************************************************************\r
153 #define EUSCI_A_UART_CLOCKSOURCE_SMCLK                            UCSSEL__SMCLK\r
154 #define EUSCI_A_UART_CLOCKSOURCE_ACLK                              UCSSEL__ACLK\r
155 \r
156 //*****************************************************************************\r
157 //\r
158 // The following are values that can be passed to the param parameter for\r
159 // functions: EUSCI_A_UART_init().\r
160 //\r
161 //*****************************************************************************\r
162 #define EUSCI_A_UART_ONE_STOP_BIT                                          0x00\r
163 #define EUSCI_A_UART_TWO_STOP_BITS                                        UCSPB\r
164 \r
165 //*****************************************************************************\r
166 //\r
167 // The following are values that can be passed to the param parameter for\r
168 // functions: EUSCI_A_UART_init().\r
169 //\r
170 //*****************************************************************************\r
171 #define EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION                      0x01\r
172 #define EUSCI_A_UART_LOW_FREQUENCY_BAUDRATE_GENERATION                     0x00\r
173 \r
174 //*****************************************************************************\r
175 //\r
176 // The following are values that can be passed to the mask parameter for\r
177 // functions: EUSCI_A_UART_enableInterrupt(), and\r
178 // EUSCI_A_UART_disableInterrupt().\r
179 //\r
180 //*****************************************************************************\r
181 #define EUSCI_A_UART_RECEIVE_INTERRUPT                                   UCRXIE\r
182 #define EUSCI_A_UART_TRANSMIT_INTERRUPT                                  UCTXIE\r
183 #define EUSCI_A_UART_RECEIVE_ERRONEOUSCHAR_INTERRUPT                    UCRXEIE\r
184 #define EUSCI_A_UART_BREAKCHAR_INTERRUPT                                UCBRKIE\r
185 #define EUSCI_A_UART_STARTBIT_INTERRUPT                                 UCSTTIE\r
186 #define EUSCI_A_UART_TRANSMIT_COMPLETE_INTERRUPT                      UCTXCPTIE\r
187 \r
188 //*****************************************************************************\r
189 //\r
190 // The following are values that can be passed to the mask parameter for\r
191 // functions: EUSCI_A_UART_getInterruptStatus(), and\r
192 // EUSCI_A_UART_clearInterrupt() as well as returned by the\r
193 // EUSCI_A_UART_getInterruptStatus() function.\r
194 //\r
195 //*****************************************************************************\r
196 #define EUSCI_A_UART_RECEIVE_INTERRUPT_FLAG                             UCRXIFG\r
197 #define EUSCI_A_UART_TRANSMIT_INTERRUPT_FLAG                            UCTXIFG\r
198 #define EUSCI_A_UART_STARTBIT_INTERRUPT_FLAG                           UCSTTIFG\r
199 #define EUSCI_A_UART_TRANSMIT_COMPLETE_INTERRUPT_FLAG                UCTXCPTIFG\r
200 \r
201 //*****************************************************************************\r
202 //\r
203 // The following are values that can be passed to the mask parameter for\r
204 // functions: EUSCI_A_UART_queryStatusFlags() as well as returned by the\r
205 // EUSCI_A_UART_queryStatusFlags() function.\r
206 //\r
207 //*****************************************************************************\r
208 #define EUSCI_A_UART_LISTEN_ENABLE                                     UCLISTEN\r
209 #define EUSCI_A_UART_FRAMING_ERROR                                         UCFE\r
210 #define EUSCI_A_UART_OVERRUN_ERROR                                         UCOE\r
211 #define EUSCI_A_UART_PARITY_ERROR                                          UCPE\r
212 #define EUSCI_A_UART_BREAK_DETECT                                         UCBRK\r
213 #define EUSCI_A_UART_RECEIVE_ERROR                                      UCRXERR\r
214 #define EUSCI_A_UART_ADDRESS_RECEIVED                                    UCADDR\r
215 #define EUSCI_A_UART_IDLELINE                                            UCIDLE\r
216 #define EUSCI_A_UART_BUSY                                                UCBUSY\r
217 \r
218 //*****************************************************************************\r
219 //\r
220 // The following are values that can be passed to the deglitchTime parameter\r
221 // for functions: EUSCI_A_UART_selectDeglitchTime().\r
222 //\r
223 //*****************************************************************************\r
224 #define EUSCI_A_UART_DEGLITCH_TIME_2ns                                     0x00\r
225 #define EUSCI_A_UART_DEGLITCH_TIME_50ns                                 UCGLIT0\r
226 #define EUSCI_A_UART_DEGLITCH_TIME_100ns                                UCGLIT1\r
227 #define EUSCI_A_UART_DEGLITCH_TIME_200ns                    (UCGLIT0 + UCGLIT1)\r
228 \r
229 //*****************************************************************************\r
230 //\r
231 // Prototypes for the APIs.\r
232 //\r
233 //*****************************************************************************\r
234 \r
235 //*****************************************************************************\r
236 //\r
237 //! \brief Advanced initialization routine for the UART block. The values to be\r
238 //! written into the clockPrescalar, firstModReg, secondModReg and overSampling\r
239 //! parameters should be pre-computed and passed into the initialization\r
240 //! function.\r
241 //!\r
242 //! Upon successful initialization of the UART block, this function will have\r
243 //! initialized the module, but the UART block still remains disabled and must\r
244 //! be enabled with EUSCI_A_UART_enable(). To calculate values for\r
245 //! clockPrescalar, firstModReg, secondModReg and overSampling please use the\r
246 //! link below.\r
247 //!\r
248 //! http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430BaudRateConverter/index.html\r
249 //!\r
250 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
251 //! \param param is the pointer to struct for initialization.\r
252 //!\r
253 //! Modified bits are \b UCPEN, \b UCPAR, \b UCMSB, \b UC7BIT, \b UCSPB, \b\r
254 //! UCMODEx and \b UCSYNC of \b UCAxCTL0 register; bits \b UCSSELx and \b\r
255 //! UCSWRST of \b UCAxCTL1 register.\r
256 //!\r
257 //! \return STATUS_SUCCESS or STATUS_FAIL of the initialization process\r
258 //\r
259 //*****************************************************************************\r
260 extern bool EUSCI_A_UART_init(uint16_t baseAddress,\r
261                               EUSCI_A_UART_initParam *param);\r
262 \r
263 //*****************************************************************************\r
264 //\r
265 //! \brief Transmits a byte from the UART Module.\r
266 //!\r
267 //! This function will place the supplied data into UART transmit data register\r
268 //! to start transmission\r
269 //!\r
270 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
271 //! \param transmitData data to be transmitted from the UART module\r
272 //!\r
273 //! Modified bits of \b UCAxTXBUF register.\r
274 //!\r
275 //! \return None\r
276 //\r
277 //*****************************************************************************\r
278 extern void EUSCI_A_UART_transmitData(uint16_t baseAddress,\r
279                                       uint8_t transmitData);\r
280 \r
281 //*****************************************************************************\r
282 //\r
283 //! \brief Receives a byte that has been sent to the UART Module.\r
284 //!\r
285 //! This function reads a byte of data from the UART receive data Register.\r
286 //!\r
287 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
288 //!\r
289 //! Modified bits of \b UCAxRXBUF register.\r
290 //!\r
291 //! \return Returns the byte received from by the UART module, cast as an\r
292 //!         uint8_t.\r
293 //\r
294 //*****************************************************************************\r
295 extern uint8_t EUSCI_A_UART_receiveData(uint16_t baseAddress);\r
296 \r
297 //*****************************************************************************\r
298 //\r
299 //! \brief Enables individual UART interrupt sources.\r
300 //!\r
301 //! Enables the indicated UART interrupt sources.  The interrupt flag is first\r
302 //! and then the corresponding interrupt is enabled. Only the sources that are\r
303 //! enabled can be reflected to the processor interrupt; disabled sources have\r
304 //! no effect on the processor. Does not clear interrupt flags.\r
305 //!\r
306 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
307 //! \param mask is the bit mask of the interrupt sources to be enabled.\r
308 //!        Mask value is the logical OR of any of the following:\r
309 //!        - \b EUSCI_A_UART_RECEIVE_INTERRUPT - Receive interrupt\r
310 //!        - \b EUSCI_A_UART_TRANSMIT_INTERRUPT - Transmit interrupt\r
311 //!        - \b EUSCI_A_UART_RECEIVE_ERRONEOUSCHAR_INTERRUPT - Receive\r
312 //!           erroneous-character interrupt enable\r
313 //!        - \b EUSCI_A_UART_BREAKCHAR_INTERRUPT - Receive break character\r
314 //!           interrupt enable\r
315 //!        - \b EUSCI_A_UART_STARTBIT_INTERRUPT - Start bit received interrupt\r
316 //!           enable\r
317 //!        - \b EUSCI_A_UART_TRANSMIT_COMPLETE_INTERRUPT - Transmit complete\r
318 //!           interrupt enable\r
319 //!\r
320 //! Modified bits of \b UCAxCTL1 register and bits of \b UCAxIE register.\r
321 //!\r
322 //! \return None\r
323 //\r
324 //*****************************************************************************\r
325 extern void EUSCI_A_UART_enableInterrupt(uint16_t baseAddress,\r
326                                          uint8_t mask);\r
327 \r
328 //*****************************************************************************\r
329 //\r
330 //! \brief Disables individual UART interrupt sources.\r
331 //!\r
332 //! Disables the indicated UART interrupt sources. Only the sources that are\r
333 //! enabled can be reflected to the processor interrupt; disabled sources have\r
334 //! no effect on the processor.\r
335 //!\r
336 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
337 //! \param mask is the bit mask of the interrupt sources to be disabled.\r
338 //!        Mask value is the logical OR of any of the following:\r
339 //!        - \b EUSCI_A_UART_RECEIVE_INTERRUPT - Receive interrupt\r
340 //!        - \b EUSCI_A_UART_TRANSMIT_INTERRUPT - Transmit interrupt\r
341 //!        - \b EUSCI_A_UART_RECEIVE_ERRONEOUSCHAR_INTERRUPT - Receive\r
342 //!           erroneous-character interrupt enable\r
343 //!        - \b EUSCI_A_UART_BREAKCHAR_INTERRUPT - Receive break character\r
344 //!           interrupt enable\r
345 //!        - \b EUSCI_A_UART_STARTBIT_INTERRUPT - Start bit received interrupt\r
346 //!           enable\r
347 //!        - \b EUSCI_A_UART_TRANSMIT_COMPLETE_INTERRUPT - Transmit complete\r
348 //!           interrupt enable\r
349 //!\r
350 //! Modified bits of \b UCAxCTL1 register and bits of \b UCAxIE register.\r
351 //!\r
352 //! \return None\r
353 //\r
354 //*****************************************************************************\r
355 extern void EUSCI_A_UART_disableInterrupt(uint16_t baseAddress,\r
356                                           uint8_t mask);\r
357 \r
358 //*****************************************************************************\r
359 //\r
360 //! \brief Gets the current UART interrupt status.\r
361 //!\r
362 //! This returns the interrupt status for the UART module based on which flag\r
363 //! is passed.\r
364 //!\r
365 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
366 //! \param mask is the masked interrupt flag status to be returned.\r
367 //!        Mask value is the logical OR of any of the following:\r
368 //!        - \b EUSCI_A_UART_RECEIVE_INTERRUPT_FLAG\r
369 //!        - \b EUSCI_A_UART_TRANSMIT_INTERRUPT_FLAG\r
370 //!        - \b EUSCI_A_UART_STARTBIT_INTERRUPT_FLAG\r
371 //!        - \b EUSCI_A_UART_TRANSMIT_COMPLETE_INTERRUPT_FLAG\r
372 //!\r
373 //! Modified bits of \b UCAxIFG register.\r
374 //!\r
375 //! \return Logical OR of any of the following:\r
376 //!         - \b EUSCI_A_UART_RECEIVE_INTERRUPT_FLAG\r
377 //!         - \b EUSCI_A_UART_TRANSMIT_INTERRUPT_FLAG\r
378 //!         - \b EUSCI_A_UART_STARTBIT_INTERRUPT_FLAG\r
379 //!         - \b EUSCI_A_UART_TRANSMIT_COMPLETE_INTERRUPT_FLAG\r
380 //!         \n indicating the status of the masked flags\r
381 //\r
382 //*****************************************************************************\r
383 extern uint8_t EUSCI_A_UART_getInterruptStatus(uint16_t baseAddress,\r
384                                                uint8_t mask);\r
385 \r
386 //*****************************************************************************\r
387 //\r
388 //! \brief Clears UART interrupt sources.\r
389 //!\r
390 //! The UART interrupt source is cleared, so that it no longer asserts. The\r
391 //! highest interrupt flag is automatically cleared when an interrupt vector\r
392 //! generator is used.\r
393 //!\r
394 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
395 //! \param mask is a bit mask of the interrupt sources to be cleared.\r
396 //!        Mask value is the logical OR of any of the following:\r
397 //!        - \b EUSCI_A_UART_RECEIVE_INTERRUPT_FLAG\r
398 //!        - \b EUSCI_A_UART_TRANSMIT_INTERRUPT_FLAG\r
399 //!        - \b EUSCI_A_UART_STARTBIT_INTERRUPT_FLAG\r
400 //!        - \b EUSCI_A_UART_TRANSMIT_COMPLETE_INTERRUPT_FLAG\r
401 //!\r
402 //! Modified bits of \b UCAxIFG register.\r
403 //!\r
404 //! \return None\r
405 //\r
406 //*****************************************************************************\r
407 extern void EUSCI_A_UART_clearInterrupt(uint16_t baseAddress,\r
408                                         uint8_t mask);\r
409 \r
410 //*****************************************************************************\r
411 //\r
412 //! \brief Enables the UART block.\r
413 //!\r
414 //! This will enable operation of the UART block.\r
415 //!\r
416 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
417 //!\r
418 //! Modified bits are \b UCSWRST of \b UCAxCTL1 register.\r
419 //!\r
420 //! \return None\r
421 //\r
422 //*****************************************************************************\r
423 extern void EUSCI_A_UART_enable(uint16_t baseAddress);\r
424 \r
425 //*****************************************************************************\r
426 //\r
427 //! \brief Disables the UART block.\r
428 //!\r
429 //! This will disable operation of the UART block.\r
430 //!\r
431 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
432 //!\r
433 //! Modified bits are \b UCSWRST of \b UCAxCTL1 register.\r
434 //!\r
435 //! \return None\r
436 //\r
437 //*****************************************************************************\r
438 extern void EUSCI_A_UART_disable(uint16_t baseAddress);\r
439 \r
440 //*****************************************************************************\r
441 //\r
442 //! \brief Gets the current UART status flags.\r
443 //!\r
444 //! This returns the status for the UART module based on which flag is passed.\r
445 //!\r
446 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
447 //! \param mask is the masked interrupt flag status to be returned.\r
448 //!        Mask value is the logical OR of any of the following:\r
449 //!        - \b EUSCI_A_UART_LISTEN_ENABLE\r
450 //!        - \b EUSCI_A_UART_FRAMING_ERROR\r
451 //!        - \b EUSCI_A_UART_OVERRUN_ERROR\r
452 //!        - \b EUSCI_A_UART_PARITY_ERROR\r
453 //!        - \b EUSCI_A_UART_BREAK_DETECT\r
454 //!        - \b EUSCI_A_UART_RECEIVE_ERROR\r
455 //!        - \b EUSCI_A_UART_ADDRESS_RECEIVED\r
456 //!        - \b EUSCI_A_UART_IDLELINE\r
457 //!        - \b EUSCI_A_UART_BUSY\r
458 //!\r
459 //! Modified bits of \b UCAxSTAT register.\r
460 //!\r
461 //! \return Logical OR of any of the following:\r
462 //!         - \b EUSCI_A_UART_LISTEN_ENABLE\r
463 //!         - \b EUSCI_A_UART_FRAMING_ERROR\r
464 //!         - \b EUSCI_A_UART_OVERRUN_ERROR\r
465 //!         - \b EUSCI_A_UART_PARITY_ERROR\r
466 //!         - \b EUSCI_A_UART_BREAK_DETECT\r
467 //!         - \b EUSCI_A_UART_RECEIVE_ERROR\r
468 //!         - \b EUSCI_A_UART_ADDRESS_RECEIVED\r
469 //!         - \b EUSCI_A_UART_IDLELINE\r
470 //!         - \b EUSCI_A_UART_BUSY\r
471 //!         \n indicating the status of the masked interrupt flags\r
472 //\r
473 //*****************************************************************************\r
474 extern uint8_t EUSCI_A_UART_queryStatusFlags(uint16_t baseAddress,\r
475                                              uint8_t mask);\r
476 \r
477 //*****************************************************************************\r
478 //\r
479 //! \brief Sets the UART module in dormant mode\r
480 //!\r
481 //! Puts USCI in sleep mode Only characters that are preceded by an idle-line\r
482 //! or with address bit set UCRXIFG. In UART mode with automatic baud-rate\r
483 //! detection, only the combination of a break and sync field sets UCRXIFG.\r
484 //!\r
485 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
486 //!\r
487 //! Modified bits of \b UCAxCTL1 register.\r
488 //!\r
489 //! \return None\r
490 //\r
491 //*****************************************************************************\r
492 extern void EUSCI_A_UART_setDormant(uint16_t baseAddress);\r
493 \r
494 //*****************************************************************************\r
495 //\r
496 //! \brief Re-enables UART module from dormant mode\r
497 //!\r
498 //! Not dormant. All received characters set UCRXIFG.\r
499 //!\r
500 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
501 //!\r
502 //! Modified bits are \b UCDORM of \b UCAxCTL1 register.\r
503 //!\r
504 //! \return None\r
505 //\r
506 //*****************************************************************************\r
507 extern void EUSCI_A_UART_resetDormant(uint16_t baseAddress);\r
508 \r
509 //*****************************************************************************\r
510 //\r
511 //! \brief Transmits the next byte to be transmitted marked as address\r
512 //! depending on selected multiprocessor mode\r
513 //!\r
514 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
515 //! \param transmitAddress is the next byte to be transmitted\r
516 //!\r
517 //! Modified bits of \b UCAxTXBUF register and bits of \b UCAxCTL1 register.\r
518 //!\r
519 //! \return None\r
520 //\r
521 //*****************************************************************************\r
522 extern void EUSCI_A_UART_transmitAddress(uint16_t baseAddress,\r
523                                          uint8_t transmitAddress);\r
524 \r
525 //*****************************************************************************\r
526 //\r
527 //! \brief Transmit break.\r
528 //!\r
529 //! Transmits a break with the next write to the transmit buffer. In UART mode\r
530 //! with automatic baud-rate detection,\r
531 //! EUSCI_A_UART_AUTOMATICBAUDRATE_SYNC(0x55) must be written into UCAxTXBUF to\r
532 //! generate the required break/sync fields. Otherwise, DEFAULT_SYNC(0x00) must\r
533 //! be written into the transmit buffer. Also ensures module is ready for\r
534 //! transmitting the next data.\r
535 //!\r
536 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
537 //!\r
538 //! Modified bits of \b UCAxTXBUF register and bits of \b UCAxCTL1 register.\r
539 //!\r
540 //! \return None\r
541 //\r
542 //*****************************************************************************\r
543 extern void EUSCI_A_UART_transmitBreak(uint16_t baseAddress);\r
544 \r
545 //*****************************************************************************\r
546 //\r
547 //! \brief Returns the address of the RX Buffer of the UART for the DMA module.\r
548 //!\r
549 //! Returns the address of the UART RX Buffer. This can be used in conjunction\r
550 //! with the DMA to store the received data directly to memory.\r
551 //!\r
552 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
553 //!\r
554 //! \return Address of RX Buffer\r
555 //\r
556 //*****************************************************************************\r
557 extern uint32_t EUSCI_A_UART_getReceiveBufferAddress(uint16_t baseAddress);\r
558 \r
559 //*****************************************************************************\r
560 //\r
561 //! \brief Returns the address of the TX Buffer of the UART for the DMA module.\r
562 //!\r
563 //! Returns the address of the UART TX Buffer. This can be used in conjunction\r
564 //! with the DMA to obtain transmitted data directly from memory.\r
565 //!\r
566 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
567 //!\r
568 //! \return Address of TX Buffer\r
569 //\r
570 //*****************************************************************************\r
571 extern uint32_t EUSCI_A_UART_getTransmitBufferAddress(uint16_t baseAddress);\r
572 \r
573 //*****************************************************************************\r
574 //\r
575 //! \brief Sets the deglitch time\r
576 //!\r
577 //! \param baseAddress is the base address of the EUSCI_A_UART module.\r
578 //! \param deglitchTime is the selected deglitch time\r
579 //!        Valid values are:\r
580 //!        - \b EUSCI_A_UART_DEGLITCH_TIME_2ns\r
581 //!        - \b EUSCI_A_UART_DEGLITCH_TIME_50ns\r
582 //!        - \b EUSCI_A_UART_DEGLITCH_TIME_100ns\r
583 //!        - \b EUSCI_A_UART_DEGLITCH_TIME_200ns\r
584 //!\r
585 //! \return None\r
586 //\r
587 //*****************************************************************************\r
588 extern void EUSCI_A_UART_selectDeglitchTime(uint16_t baseAddress,\r
589                                             uint16_t deglitchTime);\r
590 \r
591 //*****************************************************************************\r
592 //\r
593 // Mark the end of the C bindings section for C++ compilers.\r
594 //\r
595 //*****************************************************************************\r
596 #ifdef __cplusplus\r
597 }\r
598 #endif\r
599 \r
600 #endif\r
601 #endif // __MSP430WARE_EUSCI_A_UART_H__\r