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

Copyright 2020, Texas Instruments Incorporated