MSPM0L11XX_L13XX Driver Library  1.00.01.03
dl_uart.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020, 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  */
32 /*!****************************************************************************
33  * @file dl_uart.h
34  * @brief UART Driver Library
35  * @defgroup UART Universal Asynchronous Receiver-Transmitter (UART)
36  *
37  * @anchor ti_dl_dl_uart_Overview
38  * # Overview
39  *
40  * The Universal Asynchronous Receiver-Transmitter Driver Library allows
41  * full configuration of the MSPM0 UART module.
42  * This module provides common functionality for UART-Main and UART-Extend, but
43  * developers should use the corresponding dl_uart_extend or dl_uart_main APIs
44  * directly.
45  *
46  * <hr>
47  ******************************************************************************
48  */
52 #ifndef ti_dl_dl_uart__include
53 #define ti_dl_dl_uart__include
54 
55 #if defined(ti_dl_dl_uart_main__include) || \
56  defined(ti_dl_dl_uart_extend__include) || defined(DOXYGEN__INCLUDE)
57 
58 #include <stdbool.h>
59 #include <stdint.h>
60 
61 #include <ti/devices/msp/msp.h>
62 #include <ti/driverlib/dl_common.h>
63 
64 #if defined(__MSPM0_HAS_UART_MAIN__) || defined(__MSPM0_HAS_UART_EXTD__)
65 
66 #ifdef __cplusplus
67 extern "C" {
68 #endif
69 
70 /* clang-format off */
71 
78 #define DL_UART_INTERRUPT_DMA_DONE_TX (UART_INT_EVENT0_IMASK_DMA_DONE_TX_SET)
79 
83 #define DL_UART_INTERRUPT_DMA_DONE_RX (UART_INT_EVENT0_IMASK_DMA_DONE_RX_SET)
84 
88 #define DL_UART_INTERRUPT_CTS_DONE (UART_INT_EVENT0_IMASK_CTS_SET)
89 
93 #define DL_UART_INTERRUPT_ADDRESS_MATCH (UART_INT_EVENT0_IMASK_ADDR_MATCH_SET)
94 
98 #define DL_UART_INTERRUPT_LINC0_MATCH (UART_INT_EVENT0_IMASK_LINC0_SET)
99 
103 #define DL_UART_INTERRUPT_EOT_DONE (UART_INT_EVENT0_IMASK_EOT_SET)
104 
108 #define DL_UART_INTERRUPT_TX (UART_INT_EVENT0_IMASK_TXINT_SET)
109 
113 #define DL_UART_INTERRUPT_RX (UART_INT_EVENT0_IMASK_RXINT_SET)
114 
118 #define DL_UART_INTERRUPT_LIN_COUNTER_OVERFLOW \
119  (UART_INT_EVENT0_IMASK_LINOVF_SET)
120 
124 #define DL_UART_INTERRUPT_LIN_RISING_EDGE \
125  (UART_INT_EVENT0_IMASK_LINC1_SET)
126 
130 #define DL_UART_INTERRUPT_LIN_FALLING_EDGE \
131  (UART_INT_EVENT0_IMASK_LINC0_SET)
132 
136 #define DL_UART_INTERRUPT_RXD_POS_EDGE (UART_INT_EVENT0_IMASK_RXPE_SET)
137 
141 #define DL_UART_INTERRUPT_RXD_NEG_EDGE (UART_INT_EVENT0_IMASK_RXNE_SET)
142 
146 #define DL_UART_INTERRUPT_OVERRUN_ERROR (UART_INT_EVENT0_IMASK_OVRERR_SET)
147 
151 #define DL_UART_INTERRUPT_BREAK_ERROR (UART_INT_EVENT0_IMASK_BRKERR_SET)
152 
156 #define DL_UART_INTERRUPT_PARITY_ERROR (UART_INT_EVENT0_IMASK_PARERR_SET)
157 
161 #define DL_UART_INTERRUPT_FRAMING_ERROR (UART_INT_EVENT0_IMASK_FRMERR_SET)
162 
166 #define DL_UART_INTERRUPT_RX_TIMEOUT_ERROR (UART_INT_EVENT0_IMASK_RTOUT_SET)
167 
168 
172 #define DL_UART_INTERRUPT_NOISE_ERROR (UART_INT_EVENT0_IMASK_NERR_SET)
173 
174 
178 typedef enum {
180  DL_UART_IIDX_DMA_DONE_TX = UART_INT_EVENT0_IIDX_STAT_DMA_DONE_TX,
182  DL_UART_IIDX_DMA_DONE_RX = UART_INT_EVENT0_IIDX_STAT_DMA_DONE_RX,
184  DL_UART_IIDX_CTS_DONE = UART_INT_EVENT0_IIDX_STAT_CTS,
186  DL_UART_IIDX_ADDRESS_MATCH = UART_INT_EVENT0_IIDX_STAT_MODE_9B,
188  DL_UART_IIDX_EOT_DONE = UART_INT_EVENT0_IIDX_STAT_EOT,
190  DL_UART_IIDX_TX = UART_INT_EVENT0_IIDX_STAT_TXIFG,
192  DL_UART_IIDX_RX = UART_INT_EVENT0_IIDX_STAT_RXIFG,
194  DL_UART_IIDX_LIN_COUNTER_OVERFLOW = UART_INT_EVENT0_IIDX_STAT_LINOVF,
196  DL_UART_IIDX_LIN_RISING_EDGE = UART_INT_EVENT0_IIDX_STAT_LINC1,
198  DL_UART_IIDX_LIN_FALLING_EDGE = UART_INT_EVENT0_IIDX_STAT_LINC0,
200  DL_UART_IIDX_RXD_POS_EDGE = UART_INT_EVENT0_IIDX_STAT_RXPE,
202  DL_UART_IIDX_RXD_NEG_EDGE = UART_INT_EVENT0_IIDX_STAT_RXNE,
204  DL_UART_IIDX_OVERRUN_ERROR = UART_INT_EVENT0_IIDX_STAT_OEFG,
206  DL_UART_IIDX_BREAK_ERROR = UART_INT_EVENT0_IIDX_STAT_BEFG,
208  DL_UART_IIDX_PARITY_ERROR = UART_INT_EVENT0_IIDX_STAT_PEFG,
210  DL_UART_IIDX_FRAMING_ERROR = UART_INT_EVENT0_IIDX_STAT_FEFG,
212  DL_UART_IIDX_RX_TIMEOUT_ERROR = UART_INT_EVENT0_IIDX_STAT_RTFG,
213 
214 
216  DL_UART_IIDX_NOISE_ERROR = UART_INT_EVENT0_IIDX_STAT_NERR_EVT,
217 
218 
220  DL_UART_IIDX_NO_INTERRUPT = UART_INT_EVENT0_IIDX_STAT_NO_INTR
221 } DL_UART_IIDX;
222 
224 typedef enum {
226  DL_UART_DMA_IIDX_RX_TRIGGER = UART_INT_EVENT1_IIDX_STAT_RXIFG,
228  DL_UART_DMA_IIDX_RX_TIMEOUT_TRIGGER = UART_INT_EVENT1_IIDX_STAT_RTFG
230 
232 typedef enum {
234  DL_UART_DMA_IIDX_TX_TRIGGER = UART_INT_EVENT2_IIDX_STAT_TXIFG
236 
243 #define DL_UART_DMA_INTERRUPT_RX (UART_INT_EVENT1_IMASK_RXINT_SET)
244 
248 #define DL_UART_DMA_INTERRUPT_RX_TIMEOUT (UART_INT_EVENT1_IMASK_RTOUT_SET)
249 
255 #define DL_UART_DMA_INTERRUPT_TX (UART_INT_EVENT2_IMASK_TXINT_SET)
256 
263 #define DL_UART_ERROR_OVERRUN (UART_RXDATA_OVRERR_SET)
264 
268 #define DL_UART_ERROR_BREAK (UART_RXDATA_BRKERR_SET)
269 
273 #define DL_UART_ERROR_PARITY (UART_RXDATA_BRKERR_SET)
274 
278 #define DL_UART_ERROR_FRAMING (UART_RXDATA_FRMERR_SET)
279 
283 typedef enum {
285  DL_UART_PULSE_WIDTH_5_NS = UART_GFCTL_AGFSEL_AGLIT_5,
287  DL_UART_PULSE_WIDTH_10_NS = UART_GFCTL_AGFSEL_AGLIT_10,
289  DL_UART_PULSE_WIDTH_25_NS = UART_GFCTL_AGFSEL_AGLIT_25,
291  DL_UART_PULSE_WIDTH_50_NS = UART_GFCTL_AGFSEL_AGLIT_50
293 
295 typedef enum {
297  DL_UART_OVERSAMPLING_RATE_16X = UART_CTL0_HSE_OVS16,
299  DL_UART_OVERSAMPLING_RATE_8X = UART_CTL0_HSE_OVS8,
303  DL_UART_OVERSAMPLING_RATE_3X = UART_CTL0_HSE_OVS3
305 
307 typedef enum {
309  DL_UART_PARITY_EVEN = (UART_LCRH_PEN_ENABLE | UART_LCRH_EPS_EVEN),
311  DL_UART_PARITY_ODD = (UART_LCRH_PEN_ENABLE | UART_LCRH_EPS_ODD),
315  DL_UART_PARITY_STICK_ONE = (UART_LCRH_PEN_ENABLE | UART_LCRH_SPS_ENABLE | UART_LCRH_EPS_ODD),
319  DL_UART_PARITY_STICK_ZERO = (UART_LCRH_PEN_ENABLE | UART_LCRH_SPS_ENABLE | UART_LCRH_EPS_EVEN),
321  DL_UART_PARITY_NONE = UART_LCRH_PEN_DISABLE
323 
325 typedef enum {
327  DL_UART_WORD_LENGTH_5_BITS = UART_LCRH_WLEN_DATABIT5,
329  DL_UART_WORD_LENGTH_6_BITS = UART_LCRH_WLEN_DATABIT6,
331  DL_UART_WORD_LENGTH_7_BITS = UART_LCRH_WLEN_DATABIT7,
333  DL_UART_WORD_LENGTH_8_BITS = UART_LCRH_WLEN_DATABIT8
335 
337 typedef enum {
339  DL_UART_MODE_NORMAL = UART_CTL0_MODE_UART,
341  DL_UART_MODE_RS485 = UART_CTL0_MODE_RS485,
343  DL_UART_MODE_IDLE_LINE = UART_CTL0_MODE_IDLELINE,
345  DL_UART_MODE_ADDR_9_BIT = UART_CTL0_MODE_ADDR9BIT,
347  DL_UART_MODE_SMART_CARD = UART_CTL0_MODE_SMART,
349  DL_UART_MODE_DALI = UART_CTL0_MODE_DALI
350 } DL_UART_MODE;
351 
353 typedef enum {
355  DL_UART_DIRECTION_TX = UART_CTL0_TXE_ENABLE,
357  DL_UART_DIRECTION_RX = UART_CTL0_RXE_ENABLE,
359  DL_UART_DIRECTION_TX_RX = (UART_CTL0_RXE_ENABLE | UART_CTL0_TXE_ENABLE),
361  DL_UART_DIRECTION_NONE = (UART_CTL0_RXE_DISABLE | UART_CTL0_TXE_DISABLE)
363 
365 typedef enum {
367  DL_UART_CLOCK_BUSCLK = UART_CLKSEL_BUSCLK_SEL_ENABLE,
369  DL_UART_CLOCK_MFCLK = UART_CLKSEL_MFCLK_SEL_ENABLE,
371  DL_UART_CLOCK_LFCLK = UART_CLKSEL_LFCLK_SEL_ENABLE
372 } DL_UART_CLOCK;
373 
375 typedef enum {
377  DL_UART_FLOW_CONTROL_RTS = UART_CTL0_RTSEN_ENABLE,
379  DL_UART_FLOW_CONTROL_CTS = UART_CTL0_CTSEN_ENABLE,
381  DL_UART_FLOW_CONTROL_RTS_CTS = (UART_CTL0_RTSEN_ENABLE | UART_CTL0_CTSEN_ENABLE),
383  DL_UART_FLOW_CONTROL_NONE = (UART_CTL0_CTSEN_DISABLE | UART_CTL0_RTSEN_DISABLE)
385 
387 typedef enum {
389  DL_UART_RTS_ASSERT = UART_CTL0_RTS_SET,
391  DL_UART_RTS_DEASSERT = UART_CTL0_RTS_CLR
392 } DL_UART_RTS;
393 
395 typedef enum {
397  DL_UART_STOP_BITS_ONE = UART_LCRH_STP2_DISABLE,
399  DL_UART_STOP_BITS_TWO = UART_LCRH_STP2_ENABLE
401 
403 typedef enum {
405  DL_UART_TXD_OUT_LOW = UART_CTL0_TXD_OUT_LOW,
407  DL_UART_TXD_OUT_HIGH = UART_CTL0_TXD_OUT_HIGH
409 
411 typedef enum {
413  DL_UART_TX_FIFO_LEVEL_3_4_EMPTY = UART_IFLS_TXIFLSEL_LVL_3_4,
415  DL_UART_TX_FIFO_LEVEL_1_2_EMPTY = UART_IFLS_TXIFLSEL_LVL_1_2,
417  DL_UART_TX_FIFO_LEVEL_1_4_EMPTY = UART_IFLS_TXIFLSEL_LVL_1_4,
419  DL_UART_TX_FIFO_LEVEL_EMPTY = UART_IFLS_TXIFLSEL_LVL_EMPTY,
421  DL_UART_TX_FIFO_LEVEL_ONE_ENTRY = UART_IFLS_TXIFLSEL_LVL_1
423 
425 typedef enum {
428  DL_UART_RX_FIFO_LEVEL_ONE_ENTRY = UART_IFLS_RXIFLSEL_LVL_1,
430  DL_UART_RX_FIFO_LEVEL_FULL = UART_IFLS_RXIFLSEL_LVL_FULL,
432  DL_UART_RX_FIFO_LEVEL_3_4_FULL = UART_IFLS_RXIFLSEL_LVL_3_4,
434  DL_UART_RX_FIFO_LEVEL_1_2_FULL = UART_IFLS_RXIFLSEL_LVL_1_2,
436  DL_UART_RX_FIFO_LEVEL_1_4_FULL = UART_IFLS_RXIFLSEL_LVL_1_4,
438 
440 typedef enum {
442  DL_UART_IRDA_CLOCK_BAUD_RATE = UART_IRCTL_IRTXCLK_BRCLK,
444  DL_UART_IRDA_CLOCK_FUNCTIONAL = UART_IRCTL_IRTXCLK_BITCLK
446 
448 typedef enum {
450  DL_UART_IRDA_POLARITY_LOW = UART_IRCTL_IRRXPL_LOW,
452  DL_UART_IRDA_POLARITY_HIGH = UART_IRCTL_IRRXPL_HIGH
454 
458 #define DL_UART_PULSE_WIDTH_3_16_BIT_PERIOD ((uint32_t) 0x00000000U)
459 
461 typedef enum {
463  DL_UART_CLOCK_DIVIDE_RATIO_1 = UART_CLKDIV2_RATIO_DIV_BY_1,
465  DL_UART_CLOCK_DIVIDE_RATIO_2 = UART_CLKDIV2_RATIO_DIV_BY_2,
467  DL_UART_CLOCK_DIVIDE_RATIO_3 = UART_CLKDIV2_RATIO_DIV_BY_3,
469  DL_UART_CLOCK_DIVIDE_RATIO_4 = UART_CLKDIV2_RATIO_DIV_BY_4,
471  DL_UART_CLOCK_DIVIDE_RATIO_5 = UART_CLKDIV2_RATIO_DIV_BY_5,
473  DL_UART_CLOCK_DIVIDE_RATIO_6 = UART_CLKDIV2_RATIO_DIV_BY_6,
475  DL_UART_CLOCK_DIVIDE_RATIO_7 = UART_CLKDIV2_RATIO_DIV_BY_7,
477  DL_UART_CLOCK_DIVIDE_RATIO_8 = UART_CLKDIV2_RATIO_DIV_BY_8
479 
480 /* clang-format on */
481 
485 typedef struct {
487  DL_UART_MODE mode;
488 
491 
494 
496  DL_UART_PARITY parity;
497 
499  DL_UART_WORD_LENGTH wordLength;
500 
502  DL_UART_STOP_BITS stopBits;
503 
505 
509 typedef struct {
511  DL_UART_CLOCK clockSel;
512 
514  DL_UART_CLOCK_DIVIDE_RATIO divideRatio;
515 
517 
518 #ifdef __MSPM0_HAS_UART_MAIN__
519 
526 typedef struct {
531  uint32_t controlWord;
532 
534  uint32_t clockSel;
535 
537  uint32_t divideRatio;
538 
543 
545  uint32_t ibrd;
546 
548  uint32_t fbrd;
549 
555 
560 
563  uint32_t interruptMask0;
564 
567  uint32_t interruptMask1;
568 
571  uint32_t interruptMask2;
572 
575  bool backupRdy;
577 
578 #endif /* __MSPM0_HAS_UART_MAIN__ */
579 
580 #ifdef __MSPM0_HAS_UART_EXTD__
581 
588 typedef struct {
593  uint32_t controlWord;
594 
596  uint32_t clockSel;
597 
599  uint32_t divideRatio;
600 
606 
611 
613  uint32_t ibrd;
614 
616  uint32_t fbrd;
617 
622 
626  uint32_t linControlWord;
627 
631  uint32_t irdaControlWord;
632 
634  uint32_t addressMask;
635 
637  uint32_t address;
638 
641  uint32_t interruptMask0;
642 
645  uint32_t interruptMask1;
646 
649  uint32_t interruptMask2;
650 
653  bool backupRdy;
655 
656 #endif /* __MSPM0_HAS_UART_EXTD__ */
657 
668 void DL_UART_init(UART_Regs *uart, DL_UART_Config *config);
669 
675 __STATIC_INLINE void DL_UART_enablePower(UART_Regs *uart)
676 {
677  uart->GPRCM.PWREN = (UART_PWREN_KEY_UNLOCK_W | UART_PWREN_ENABLE_ENABLE);
678 }
679 
685 __STATIC_INLINE void DL_UART_disablePower(UART_Regs *uart)
686 {
687  uart->GPRCM.PWREN = (UART_PWREN_KEY_UNLOCK_W | UART_PWREN_ENABLE_DISABLE);
688 }
689 
698 __STATIC_INLINE bool DL_UART_isPowerEnabled(UART_Regs *uart)
699 {
700  return ((uart->GPRCM.PWREN & UART_PWREN_ENABLE_MASK) ==
701  UART_PWREN_ENABLE_ENABLE);
702 }
703 
709 __STATIC_INLINE void DL_UART_reset(UART_Regs *uart)
710 {
711  uart->GPRCM.RSTCTL =
712  (UART_RSTCTL_KEY_UNLOCK_W | UART_RSTCTL_RESETSTKYCLR_CLR |
713  UART_RSTCTL_RESETASSERT_ASSERT);
714 }
715 
725 __STATIC_INLINE bool DL_UART_isReset(UART_Regs *uart)
726 {
727  return ((uart->GPRCM.STAT & UART_GPRCM_STAT_RESETSTKY_MASK) ==
728  UART_GPRCM_STAT_RESETSTKY_RESET);
729 }
730 
736 __STATIC_INLINE void DL_UART_enable(UART_Regs *uart)
737 {
738  uart->CTL0 |= UART_CTL0_ENABLE_ENABLE;
739 }
740 
752 __STATIC_INLINE bool DL_UART_isEnabled(UART_Regs *uart)
753 {
754  return ((uart->CTL0 & UART_CTL0_ENABLE_MASK) == UART_CTL0_ENABLE_ENABLE);
755 }
756 
762 __STATIC_INLINE void DL_UART_disable(UART_Regs *uart)
763 {
764  uart->CTL0 &= ~(UART_CTL0_ENABLE_MASK);
765 }
766 
775 void DL_UART_setClockConfig(UART_Regs *uart, DL_UART_ClockConfig *config);
776 
785 void DL_UART_getClockConfig(UART_Regs *uart, DL_UART_ClockConfig *config);
786 
809  UART_Regs *uart, uint32_t clockFreq, uint32_t baudRate);
810 
823 __STATIC_INLINE void DL_UART_setOversampling(
824  UART_Regs *uart, DL_UART_OVERSAMPLING_RATE rate)
825 {
826  DL_Common_updateReg(&uart->CTL0, (uint32_t) rate, UART_CTL0_HSE_MASK);
827 }
828 
839 __STATIC_INLINE DL_UART_OVERSAMPLING_RATE DL_UART_getOversampling(
840  UART_Regs *uart)
841 {
842  uint32_t rate = uart->CTL0 & UART_CTL0_HSE_MASK;
843 
844  return (DL_UART_OVERSAMPLING_RATE)(rate);
845 }
846 
860 __STATIC_INLINE void DL_UART_enableLoopbackMode(UART_Regs *uart)
861 {
862  uart->CTL0 |= UART_CTL0_LBE_ENABLE;
863 }
864 
875 __STATIC_INLINE bool DL_UART_isLoopbackModeEnabled(UART_Regs *uart)
876 {
877  return ((uart->CTL0 & UART_CTL0_LBE_MASK) == UART_CTL0_LBE_ENABLE);
878 }
879 
893 __STATIC_INLINE void DL_UART_disableLoopbackMode(UART_Regs *uart)
894 {
895  uart->CTL0 &= ~(UART_CTL0_LBE_MASK);
896 }
897 
914 __STATIC_INLINE void DL_UART_setDirection(
915  UART_Regs *uart, DL_UART_DIRECTION direction)
916 {
917  DL_Common_updateReg(&uart->CTL0, (uint32_t) direction,
918  UART_CTL0_TXE_MASK | UART_CTL0_RXE_MASK);
919 }
920 
930 __STATIC_INLINE DL_UART_DIRECTION DL_UART_getDirection(UART_Regs *uart)
931 {
932  uint32_t direction =
933  uart->CTL0 & (UART_CTL0_TXE_MASK | UART_CTL0_RXE_MASK);
934 
935  return (DL_UART_DIRECTION)(direction);
936 }
937 
963 __STATIC_INLINE void DL_UART_enableMajorityVoting(UART_Regs *uart)
964 {
965  uart->CTL0 |= UART_CTL0_MAJVOTE_ENABLE;
966 }
967 
978 __STATIC_INLINE bool DL_UART_isMajorityVotingEnabled(UART_Regs *uart)
979 {
980  return ((uart->CTL0 & UART_CTL0_MAJVOTE_MASK) == UART_CTL0_MAJVOTE_ENABLE);
981 }
982 
995 __STATIC_INLINE void DL_UART_disableMajorityVoting(UART_Regs *uart)
996 {
997  uart->CTL0 &= ~(UART_CTL0_MAJVOTE_MASK);
998 }
999 
1014 __STATIC_INLINE void DL_UART_enableMSBFirst(UART_Regs *uart)
1015 {
1016  uart->CTL0 |= UART_CTL0_MSBFIRST_ENABLE;
1017 }
1018 
1029 __STATIC_INLINE bool DL_UART_isMSBFirstEnabled(UART_Regs *uart)
1030 {
1031  return (
1032  (uart->CTL0 & UART_CTL0_MSBFIRST_MASK) == UART_CTL0_MSBFIRST_ENABLE);
1033 }
1034 
1049 __STATIC_INLINE void DL_UART_disableMSBFirst(UART_Regs *uart)
1050 {
1051  uart->CTL0 &= ~(UART_CTL0_MSBFIRST_MASK);
1052 }
1053 
1070 __STATIC_INLINE void DL_UART_enableTransmitPinManualControl(UART_Regs *uart)
1071 {
1072  uart->CTL0 |= UART_CTL0_TXD_OUT_EN_ENABLE;
1073 }
1074 
1085 __STATIC_INLINE bool DL_UART_isTransmitPinManualControlEnabled(UART_Regs *uart)
1086 {
1087  return ((uart->CTL0 & UART_CTL0_TXD_OUT_EN_MASK) ==
1088  UART_CTL0_TXD_OUT_EN_ENABLE);
1089 }
1090 
1103 __STATIC_INLINE void DL_UART_disableTransmitPinManualControl(UART_Regs *uart)
1104 {
1105  uart->CTL0 &= ~(UART_CTL0_TXD_OUT_EN_MASK);
1106 }
1107 
1130  UART_Regs *uart, DL_UART_TXD_OUT txdOutVal)
1131 {
1132  DL_Common_updateReg(&uart->CTL0,
1133  UART_CTL0_TXD_OUT_EN_ENABLE | (uint32_t) txdOutVal,
1134  UART_CTL0_TXD_OUT_EN_MASK | UART_CTL0_TXD_OUT_MASK);
1135 }
1136 
1146 __STATIC_INLINE DL_UART_TXD_OUT DL_UART_getTransmitPinManualOutput(
1147  UART_Regs *uart)
1148 {
1149  uint32_t txdOutVal = uart->CTL0 & UART_CTL0_TXD_OUT_MASK;
1150 
1151  return (DL_UART_TXD_OUT)(txdOutVal);
1152 }
1153 
1159 __STATIC_INLINE void DL_UART_enableManchesterEncoding(UART_Regs *uart)
1160 {
1161  uart->CTL0 |= UART_CTL0_MENC_ENABLE;
1162 }
1163 
1169 __STATIC_INLINE void DL_UART_disableManchesterEncoding(UART_Regs *uart)
1170 {
1171  uart->CTL0 &= ~(UART_CTL0_MENC_MASK);
1172 }
1173 
1184 __STATIC_INLINE bool DL_UART_isManchesterEncodingEnabled(UART_Regs *uart)
1185 {
1186  return ((uart->CTL0 & UART_CTL0_MENC_MASK) == UART_CTL0_MENC_ENABLE);
1187 }
1188 
1201 __STATIC_INLINE void DL_UART_setCommunicationMode(
1202  UART_Regs *uart, DL_UART_MODE mode)
1203 {
1204  DL_Common_updateReg(&uart->CTL0, (uint32_t) mode, UART_CTL0_MODE_MASK);
1205 }
1206 
1216 __STATIC_INLINE DL_UART_MODE DL_UART_getCommunicationMode(UART_Regs *uart)
1217 {
1218  uint32_t mode = uart->CTL0 & UART_CTL0_MODE_MASK;
1219 
1220  return (DL_UART_MODE)(mode);
1221 }
1222 
1235 __STATIC_INLINE void DL_UART_setFlowControl(
1236  UART_Regs *uart, DL_UART_FLOW_CONTROL config)
1237 {
1238  DL_Common_updateReg(&uart->CTL0, (uint32_t) config,
1239  UART_CTL0_RTSEN_MASK | UART_CTL0_CTSEN_MASK);
1240 }
1241 
1252 __STATIC_INLINE DL_UART_FLOW_CONTROL DL_UART_getFlowControl(UART_Regs *uart)
1253 {
1254  uint32_t config =
1255  uart->CTL0 & (UART_CTL0_RTSEN_MASK | UART_CTL0_CTSEN_MASK);
1256 
1257  return (DL_UART_FLOW_CONTROL)(config);
1258 }
1259 
1281 __STATIC_INLINE void DL_UART_setRTSOutput(UART_Regs *uart, DL_UART_RTS val)
1282 {
1283  DL_Common_updateReg(&uart->CTL0, (uint32_t) val, UART_CTL0_RTS_MASK);
1284 }
1285 
1305 __STATIC_INLINE DL_UART_RTS DL_UART_getRTSOutput(UART_Regs *uart)
1306 {
1307  uint32_t val = uart->CTL0 & UART_CTL0_RTS_MASK;
1308 
1309  return (DL_UART_RTS)(val);
1310 }
1311 
1326 __STATIC_INLINE void DL_UART_enableFIFOs(UART_Regs *uart)
1327 {
1328  uart->CTL0 |= UART_CTL0_FEN_ENABLE;
1329 }
1330 
1344 __STATIC_INLINE void DL_UART_disableFIFOs(UART_Regs *uart)
1345 {
1346  uart->CTL0 &= ~(UART_CTL0_FEN_MASK);
1347 }
1348 
1359 __STATIC_INLINE bool DL_UART_isFIFOsEnabled(UART_Regs *uart)
1360 {
1361  return ((uart->CTL0 & UART_CTL0_FEN_MASK) == UART_CTL0_FEN_ENABLE);
1362 }
1363 
1373 __STATIC_INLINE void DL_UART_enableLINSendBreak(UART_Regs *uart)
1374 {
1375  uart->LCRH |= UART_LCRH_BRK_ENABLE;
1376 }
1377 
1386 __STATIC_INLINE void DL_UART_disableLINSendBreak(UART_Regs *uart)
1387 {
1388  uart->LCRH &= ~(UART_LCRH_BRK_MASK);
1389 }
1390 
1401 __STATIC_INLINE bool DL_UART_isLINSendBreakEnabled(UART_Regs *uart)
1402 {
1403  return ((uart->LCRH & UART_LCRH_BRK_MASK) == UART_LCRH_BRK_ENABLE);
1404 }
1405 
1416 __STATIC_INLINE bool DL_UART_isParityEnabled(UART_Regs *uart)
1417 {
1418  return ((uart->LCRH & UART_LCRH_PEN_MASK) == UART_LCRH_PEN_ENABLE);
1419 }
1420 
1434 __STATIC_INLINE void DL_UART_setParityMode(
1435  UART_Regs *uart, DL_UART_PARITY parity)
1436 {
1437  DL_Common_updateReg(&uart->LCRH, (uint32_t) parity,
1438  (UART_LCRH_PEN_MASK | UART_LCRH_EPS_MASK | UART_LCRH_SPS_MASK));
1439 }
1440 
1451 __STATIC_INLINE DL_UART_PARITY DL_UART_getParityMode(UART_Regs *uart)
1452 {
1453  uint32_t parity = uart->LCRH & (UART_LCRH_PEN_MASK | UART_LCRH_EPS_MASK |
1454  UART_LCRH_SPS_MASK);
1455 
1456  return (DL_UART_PARITY)(parity);
1457 }
1458 
1469 __STATIC_INLINE void DL_UART_setStopBits(
1470  UART_Regs *uart, DL_UART_STOP_BITS numStopBits)
1471 {
1473  &uart->LCRH, (uint32_t) numStopBits, UART_LCRH_STP2_MASK);
1474 }
1475 
1485 __STATIC_INLINE DL_UART_STOP_BITS DL_UART_getStopBits(UART_Regs *uart)
1486 {
1487  uint32_t numStopBits = uart->LCRH & UART_LCRH_STP2_MASK;
1488 
1489  return (DL_UART_STOP_BITS)(numStopBits);
1490 }
1491 
1499 __STATIC_INLINE void DL_UART_setWordLength(
1500  UART_Regs *uart, DL_UART_WORD_LENGTH wordLength)
1501 {
1503  &uart->LCRH, (uint32_t) wordLength, UART_LCRH_WLEN_MASK);
1504 }
1505 
1515 __STATIC_INLINE DL_UART_WORD_LENGTH DL_UART_getWordLength(UART_Regs *uart)
1516 {
1517  uint32_t wordLength = uart->LCRH & UART_LCRH_WLEN_MASK;
1518 
1519  return (DL_UART_WORD_LENGTH)(wordLength);
1520 }
1521 
1530 __STATIC_INLINE void DL_UART_enableSendIdlePattern(UART_Regs *uart)
1531 {
1532  uart->LCRH |= UART_LCRH_SENDIDLE_ENABLE;
1533 }
1534 
1540 __STATIC_INLINE void DL_UART_disableSendIdlePattern(UART_Regs *uart)
1541 {
1542  uart->LCRH &= ~(UART_LCRH_SENDIDLE_MASK);
1543 }
1544 
1555 __STATIC_INLINE bool DL_UART_isSendIdlePatternEnabled(UART_Regs *uart)
1556 {
1557  return (
1558  (uart->LCRH & UART_LCRH_SENDIDLE_MASK) == UART_LCRH_SENDIDLE_ENABLE);
1559 }
1560 
1571 __STATIC_INLINE void DL_UART_setExternalDriverSetup(
1572  UART_Regs *uart, uint32_t val)
1573 {
1574  DL_Common_updateReg(&uart->LCRH, val << UART_LCRH_EXTDIR_SETUP_OFS,
1575  UART_LCRH_EXTDIR_SETUP_MASK);
1576 }
1577 
1588 __STATIC_INLINE uint32_t DL_UART_getExternalDriverSetup(UART_Regs *uart)
1589 {
1590  return ((uart->LCRH &
1591  UART_LCRH_EXTDIR_SETUP_MASK >> UART_LCRH_EXTDIR_SETUP_OFS));
1592 }
1593 
1607 __STATIC_INLINE void DL_UART_setExternalDriverHold(
1608  UART_Regs *uart, uint32_t val)
1609 {
1610  DL_Common_updateReg(&uart->LCRH, val << UART_LCRH_EXTDIR_HOLD_OFS,
1611  UART_LCRH_EXTDIR_HOLD_MASK);
1612 }
1613 
1624 __STATIC_INLINE uint32_t DL_UART_getExternalDriverHold(UART_Regs *uart)
1625 {
1626  return ((
1627  uart->LCRH & UART_LCRH_EXTDIR_HOLD_MASK >> UART_LCRH_EXTDIR_HOLD_OFS));
1628 }
1629 
1649 __STATIC_INLINE bool DL_UART_isBusy(UART_Regs *uart)
1650 {
1651  return ((uart->STAT & UART_STAT_BUSY_MASK) == UART_STAT_BUSY_SET);
1652 }
1653 
1669 __STATIC_INLINE bool DL_UART_isRXFIFOEmpty(UART_Regs *uart)
1670 {
1671  return ((uart->STAT & UART_STAT_RXFE_MASK) == UART_STAT_RXFE_SET);
1672 }
1673 
1690 __STATIC_INLINE bool DL_UART_isRXFIFOFull(UART_Regs *uart)
1691 {
1692  return ((uart->STAT & UART_STAT_RXFF_MASK) == UART_STAT_RXFF_SET);
1693 }
1694 
1710 __STATIC_INLINE bool DL_UART_isTXFIFOEmpty(UART_Regs *uart)
1711 {
1712  return ((uart->STAT & UART_STAT_TXFE_MASK) == UART_STAT_TXFE_SET);
1713 }
1714 
1731 __STATIC_INLINE bool DL_UART_isTXFIFOFull(UART_Regs *uart)
1732 {
1733  return ((uart->STAT & UART_STAT_TXFF_MASK) == UART_STAT_TXFF_SET);
1734 }
1735 
1748 __STATIC_INLINE bool DL_UART_isClearToSend(UART_Regs *uart)
1749 {
1750  return ((uart->STAT & UART_STAT_CTS_MASK) == UART_STAT_CTS_SET);
1751 }
1752 
1769 __STATIC_INLINE bool DL_UART_isIdleModeDetected(UART_Regs *uart)
1770 {
1771  return ((uart->STAT & UART_STAT_IDLE_MASK) == UART_STAT_IDLE_SET);
1772 }
1773 
1790 __STATIC_INLINE void DL_UART_setTXFIFOThreshold(
1791  UART_Regs *uart, DL_UART_TX_FIFO_LEVEL threshold)
1792 {
1794  &uart->IFLS, (uint32_t) threshold, UART_IFLS_TXIFLSEL_MASK);
1795 }
1796 
1806 __STATIC_INLINE DL_UART_TX_FIFO_LEVEL DL_UART_getTXFIFOThreshold(
1807  UART_Regs *uart)
1808 {
1809  uint32_t threshold = uart->IFLS & UART_IFLS_TXIFLSEL_MASK;
1810 
1811  return (DL_UART_TX_FIFO_LEVEL)(threshold);
1812 }
1813 
1826 __STATIC_INLINE void DL_UART_setRXFIFOThreshold(
1827  UART_Regs *uart, DL_UART_RX_FIFO_LEVEL threshold)
1828 {
1830  &uart->IFLS, (uint32_t) threshold, UART_IFLS_RXIFLSEL_MASK);
1831 }
1832 
1842 __STATIC_INLINE DL_UART_RX_FIFO_LEVEL DL_UART_getRXFIFOThreshold(
1843  UART_Regs *uart)
1844 {
1845  uint32_t threshold = uart->IFLS & UART_IFLS_RXIFLSEL_MASK;
1846 
1847  return (DL_UART_RX_FIFO_LEVEL)(threshold);
1848 }
1849 
1861 __STATIC_INLINE void DL_UART_setRXInterruptTimeout(
1862  UART_Regs *uart, uint32_t timeout)
1863 {
1865  &uart->IFLS, timeout << UART_IFLS_RXTOSEL_OFS, UART_IFLS_RXTOSEL_MASK);
1866 }
1867 
1878 __STATIC_INLINE uint32_t DL_UART_getRXInterruptTimeout(UART_Regs *uart)
1879 {
1880  return ((uart->IFLS & UART_IFLS_RXTOSEL_MASK) >> UART_IFLS_RXTOSEL_OFS);
1881 }
1882 
1892 __STATIC_INLINE uint32_t DL_UART_getIntegerBaudRateDivisor(UART_Regs *uart)
1893 {
1894  return (uart->IBRD & UART_IBRD_DIVINT_MASK);
1895 }
1896 
1906 __STATIC_INLINE uint32_t DL_UART_getFractionalBaudRateDivisor(UART_Regs *uart)
1907 {
1908  return (uart->FBRD & UART_FBRD_DIVFRAC_MASK);
1909 }
1910 
1924 __STATIC_INLINE void DL_UART_setBaudRateDivisor(
1925  UART_Regs *uart, uint32_t integerDivisor, uint32_t fractionalDivisor)
1926 {
1927  DL_Common_updateReg(&uart->IBRD, integerDivisor, UART_IBRD_DIVINT_MASK);
1929  &uart->FBRD, fractionalDivisor, UART_FBRD_DIVFRAC_MASK);
1930 
1931  // When updating the baud-rate divisor (UARTIBRD or UARTIFRD),
1932  // the LCRH register must also be written to (any bit in LCRH can
1933  // be written to for updating the baud-rate divisor).
1935  &uart->LCRH, (uart->LCRH & UART_LCRH_BRK_MASK), UART_LCRH_BRK_MASK);
1936 }
1937 
1951 __STATIC_INLINE void DL_UART_setDigitalPulseWidth(
1952  UART_Regs *uart, uint32_t pulseWidth)
1953 {
1954  DL_Common_updateReg(&uart->GFCTL, pulseWidth, UART_GFCTL_DGFSEL_MASK);
1955 }
1956 
1970 __STATIC_INLINE uint32_t DL_UART_getDigitalPulseWidth(UART_Regs *uart)
1971 {
1972  return (uart->GFCTL & UART_GFCTL_DGFSEL_MASK);
1973 }
1974 
1993 __STATIC_INLINE void DL_UART_transmitData(UART_Regs *uart, uint8_t data)
1994 {
1995  uart->TXDATA = data;
1996 }
1997 
2012 __STATIC_INLINE uint8_t DL_UART_receiveData(UART_Regs *uart)
2013 {
2014  return ((uint8_t)(uart->RXDATA & UART_RXDATA_DATA_MASK));
2015 }
2016 
2028 __STATIC_INLINE uint32_t DL_UART_getErrorStatus(
2029  UART_Regs *uart, uint32_t errorMask)
2030 {
2031  return (uart->RXDATA & errorMask);
2032 }
2033 
2043 __STATIC_INLINE void DL_UART_setLINCounterValue(
2044  UART_Regs *uart, uint16_t value)
2045 {
2046  DL_Common_updateReg(&uart->LINCNT, value, UART_LINCNT_VALUE_MASK);
2047 }
2048 
2062 __STATIC_INLINE uint16_t DL_UART_getLINCounterValue(UART_Regs *uart)
2063 {
2064  return ((uint16_t)(uart->LINCNT & UART_LINCNT_VALUE_MASK));
2065 }
2066 
2074 __STATIC_INLINE void DL_UART_enableLINCounter(UART_Regs *uart)
2075 {
2076  uart->LINCTL |= UART_LINCTL_CTRENA_ENABLE;
2077 }
2078 
2089 __STATIC_INLINE bool DL_UART_isLINCounterEnabled(UART_Regs *uart)
2090 {
2091  return (
2092  (uart->LINCTL & UART_LINCTL_CTRENA_MASK) == UART_LINCTL_CTRENA_ENABLE);
2093 }
2094 
2102 __STATIC_INLINE void DL_UART_disableLINCounter(UART_Regs *uart)
2103 {
2104  uart->LINCTL &= ~(UART_LINCTL_CTRENA_MASK);
2105 }
2106 
2120  UART_Regs *uart)
2121 {
2122  uart->LINCTL |= UART_LINCTL_ZERONE_ENABLE;
2123 }
2124 
2135 __STATIC_INLINE bool DL_UART_isLINCounterClearOnFallingEdge(UART_Regs *uart)
2136 {
2137  return (
2138  (uart->LINCTL & UART_LINCTL_ZERONE_MASK) == UART_LINCTL_ZERONE_ENABLE);
2139 }
2140 
2147  UART_Regs *uart)
2148 {
2149  uart->LINCTL &= ~(UART_LINCTL_ZERONE_MASK);
2150 }
2151 
2162 __STATIC_INLINE void DL_UART_enableLINCountWhileLow(UART_Regs *uart)
2163 {
2164  uart->LINCTL |= UART_LINCTL_CNTRXLOW_ENABLE;
2165 }
2166 
2177 __STATIC_INLINE bool DL_UART_isLINCountWhileLowEnabled(UART_Regs *uart)
2178 {
2179  return ((uart->LINCTL & UART_LINCTL_CNTRXLOW_MASK) ==
2180  UART_LINCTL_CNTRXLOW_ENABLE);
2181 }
2182 
2190 __STATIC_INLINE void DL_UART_disableLINCountWhileLow(UART_Regs *uart)
2191 {
2192  uart->LINCTL &= ~(UART_LINCTL_CNTRXLOW_MASK);
2193 }
2194 
2207 __STATIC_INLINE void DL_UART_enableLINFallingEdgeCapture(UART_Regs *uart)
2208 {
2209  DL_Common_updateReg(&uart->LINCTL,
2210  UART_LINCTL_LINC0CAP_ENABLE | UART_LINCTL_LINC0_MATCH_DISABLE,
2211  UART_LINCTL_LINC0CAP_MASK | UART_LINCTL_LINC0_MATCH_MASK);
2212 }
2213 
2224 __STATIC_INLINE bool DL_UART_isLINFallingEdgeCaptureEnabled(UART_Regs *uart)
2225 {
2226  return ((uart->LINCTL & UART_LINCTL_LINC0CAP_MASK) ==
2227  UART_LINCTL_LINC0CAP_ENABLE);
2228 }
2229 
2235 __STATIC_INLINE void DL_UART_disableLINFallingEdgeCapture(UART_Regs *uart)
2236 {
2237  uart->LINCTL &= ~(UART_LINCTL_LINC0CAP_MASK);
2238 }
2239 
2249 __STATIC_INLINE void DL_UART_enableLINRisingEdgeCapture(UART_Regs *uart)
2250 {
2251  uart->LINCTL |= UART_LINCTL_LINC1CAP_ENABLE;
2252 }
2253 
2264 __STATIC_INLINE bool DL_UART_isLINRisingEdgeCaptureEnabled(UART_Regs *uart)
2265 {
2266  return ((uart->LINCTL & UART_LINCTL_LINC1CAP_MASK) ==
2267  UART_LINCTL_LINC1CAP_ENABLE);
2268 }
2269 
2275 __STATIC_INLINE void DL_UART_disableLINRisingEdgeCapture(UART_Regs *uart)
2276 {
2277  uart->LINCTL &= ~(UART_LINCTL_LINC1CAP_MASK);
2278 }
2279 
2288 __STATIC_INLINE void DL_UART_enableLINCounterCompareMatch(UART_Regs *uart)
2289 {
2290  DL_Common_updateReg(&uart->LINCTL,
2291  UART_LINCTL_LINC0_MATCH_ENABLE | UART_LINCTL_LINC0CAP_DISABLE,
2292  UART_LINCTL_LINC0CAP_MASK | UART_LINCTL_LINC0_MATCH_MASK);
2293 }
2294 
2304  UART_Regs *uart)
2305 {
2306  DL_Common_updateReg(&uart->LINCTL,
2307  UART_LINCTL_LINC0CAP_ENABLE | UART_LINCTL_LINC1CAP_ENABLE |
2308  UART_LINCTL_ZERONE_ENABLE | UART_LINCTL_CTRENA_ENABLE,
2309  UART_LINCTL_LINC0CAP_MASK | UART_LINCTL_LINC1CAP_MASK |
2310  UART_LINCTL_ZERONE_MASK | UART_LINCTL_CTRENA_MASK);
2311 }
2312 
2321 __STATIC_INLINE void DL_UART_enableLINReceptionCountControl(UART_Regs *uart)
2322 {
2323  DL_Common_updateReg(&uart->LINCTL,
2324  UART_LINCTL_CNTRXLOW_ENABLE | UART_LINCTL_ZERONE_ENABLE |
2325  UART_LINCTL_CTRENA_ENABLE,
2326  UART_LINCTL_CNTRXLOW_MASK | UART_LINCTL_ZERONE_MASK |
2327  UART_LINCTL_CTRENA_MASK);
2328 }
2329 
2340 __STATIC_INLINE bool DL_UART_isLINCounterCompareMatchEnabled(UART_Regs *uart)
2341 {
2342  return ((uart->LINCTL & UART_LINCTL_LINC0_MATCH_MASK) ==
2343  UART_LINCTL_LINC0_MATCH_ENABLE);
2344 }
2345 
2351 __STATIC_INLINE void DL_UART_disableLINCounterCompareMatch(UART_Regs *uart)
2352 {
2353  uart->LINCTL &= ~(UART_LINCTL_LINC0_MATCH_MASK);
2354 }
2355 
2369  UART_Regs *uart, uint16_t value)
2370 {
2371  DL_Common_updateReg(&uart->LINC0, value, UART_LINC0_DATA_MASK);
2372 }
2373 
2393 __STATIC_INLINE uint16_t DL_UART_getLINFallingEdgeCaptureValue(UART_Regs *uart)
2394 {
2395  return ((uint16_t)(uart->LINC0 & UART_LINC0_DATA_MASK));
2396 }
2397 
2412 __STATIC_INLINE uint16_t DL_UART_getLINRisingEdgeCaptureValue(UART_Regs *uart)
2413 {
2414  return ((uint16_t)(uart->LINC1 & UART_LINC1_DATA_MASK));
2415 }
2416 
2422 __STATIC_INLINE void DL_UART_enableIrDAMode(UART_Regs *uart)
2423 {
2424  uart->IRCTL |= UART_IRCTL_IREN_ENABLE;
2425 }
2426 
2437 __STATIC_INLINE bool DL_UART_isIrDAModeEnabled(UART_Regs *uart)
2438 {
2439  return ((uart->IRCTL & UART_IRCTL_IREN_MASK) == UART_IRCTL_IREN_ENABLE);
2440 }
2441 
2447 __STATIC_INLINE void DL_UART_disableIrDAMode(UART_Regs *uart)
2448 {
2449  uart->IRCTL &= ~(UART_IRCTL_IREN_MASK);
2450 }
2451 
2460  UART_Regs *uart, DL_UART_IRDA_CLOCK uartClock)
2461 {
2463  &uart->IRCTL, (uint32_t) uartClock, UART_IRCTL_IRTXCLK_MASK);
2464 }
2465 
2476 __STATIC_INLINE DL_UART_IRDA_CLOCK DL_UART_getIrDATXPulseClockSelect(
2477  UART_Regs *uart)
2478 {
2479  uint32_t uartClock = uart->IRCTL & UART_IRCTL_IRTXCLK_MASK;
2480 
2481  return (DL_UART_IRDA_CLOCK)(uartClock);
2482 }
2483 
2497 void DL_UART_configIrDAMode(UART_Regs *uart, DL_UART_IRDA_POLARITY polarity,
2498  uint32_t pulseLength, DL_UART_IRDA_CLOCK irdaClk);
2499 
2518  UART_Regs *uart, uint32_t pulseLength, DL_UART_IRDA_CLOCK irdaClk);
2519 
2529 __STATIC_INLINE uint32_t DL_UART_getIrDATXPulseLength(UART_Regs *uart)
2530 {
2531  return (uart->IRCTL & UART_IRCTL_IRTXPL_MASK);
2532 }
2533 
2541 __STATIC_INLINE void DL_UART_setIrDARXPulsePolarity(
2542  UART_Regs *uart, DL_UART_IRDA_POLARITY polarity)
2543 {
2545  &uart->IRCTL, (uint32_t) polarity, UART_IRCTL_IRRXPL_MASK);
2546 }
2547 
2557 __STATIC_INLINE DL_UART_IRDA_POLARITY DL_UART_getIrDARXPulsePolarity(
2558  UART_Regs *uart)
2559 {
2560  uint32_t polarity = uart->IRCTL & UART_IRCTL_IRRXPL_MASK;
2561 
2562  return (DL_UART_IRDA_POLARITY)(polarity);
2563 }
2564 
2581 __STATIC_INLINE void DL_UART_setAddressMask(
2582  UART_Regs *uart, uint32_t addressMask)
2583 {
2584  DL_Common_updateReg(&uart->AMASK, addressMask, UART_AMASK_VALUE_MASK);
2585 }
2586 
2607 __STATIC_INLINE uint32_t DL_UART_getAddressMask(UART_Regs *uart)
2608 {
2609  return (uart->AMASK & UART_AMASK_VALUE_MASK);
2610 }
2611 
2625 __STATIC_INLINE void DL_UART_setAddress(UART_Regs *uart, uint32_t address)
2626 {
2627  DL_Common_updateReg(&uart->ADDR, address, UART_ADDR_VALUE_MASK);
2628 }
2629 
2647 __STATIC_INLINE uint32_t DL_UART_getAddress(UART_Regs *uart)
2648 {
2649  return (uart->ADDR & UART_ADDR_VALUE_MASK);
2650 }
2651 
2660 __STATIC_INLINE void DL_UART_enableInterrupt(
2661  UART_Regs *uart, uint32_t interruptMask)
2662 {
2663  uart->INT_EVENT0.IMASK |= interruptMask;
2664 }
2665 
2674 __STATIC_INLINE void DL_UART_disableInterrupt(
2675  UART_Regs *uart, uint32_t interruptMask)
2676 {
2677  uart->INT_EVENT0.IMASK &= ~(interruptMask);
2678 }
2679 
2692 __STATIC_INLINE uint32_t DL_UART_getEnabledInterrupts(
2693  UART_Regs *uart, uint32_t interruptMask)
2694 {
2695  return (uart->INT_EVENT0.IMASK & interruptMask);
2696 }
2697 
2715 __STATIC_INLINE uint32_t DL_UART_getEnabledInterruptStatus(
2716  UART_Regs *uart, uint32_t interruptMask)
2717 {
2718  return (uart->INT_EVENT0.MIS & interruptMask);
2719 }
2720 
2736 __STATIC_INLINE uint32_t DL_UART_getRawInterruptStatus(
2737  UART_Regs *uart, uint32_t interruptMask)
2738 {
2739  return (uart->INT_EVENT0.RIS & interruptMask);
2740 }
2741 
2755 __STATIC_INLINE DL_UART_IIDX DL_UART_getPendingInterrupt(UART_Regs *uart)
2756 {
2757  return (DL_UART_IIDX)(uart->INT_EVENT0.IIDX);
2758 }
2759 
2768 __STATIC_INLINE void DL_UART_clearInterruptStatus(
2769  UART_Regs *uart, uint32_t interruptMask)
2770 {
2771  uart->INT_EVENT0.ICLR = interruptMask;
2772 }
2773 
2791 __STATIC_INLINE void DL_UART_changeConfig(UART_Regs *uart)
2792 {
2793  DL_UART_disable(uart);
2794  while (DL_UART_isBusy(uart)) {
2795  ;
2796  }
2797  DL_UART_disableFIFOs(uart);
2798 }
2799 
2805 __STATIC_INLINE void DL_UART_enableAnalogGlitchFilter(UART_Regs *uart)
2806 {
2807  uart->GFCTL |= UART_GFCTL_AGFEN_ENABLE;
2808 }
2809 
2815 __STATIC_INLINE void DL_UART_disableAnalogGlitchFilter(UART_Regs *uart)
2816 {
2817  uart->GFCTL &= ~(UART_GFCTL_AGFEN_MASK);
2818 }
2819 
2828 __STATIC_INLINE bool DL_UART_isAnalogGlitchFilterEnabled(UART_Regs *uart)
2829 {
2830  return ((uart->GFCTL & UART_GFCTL_AGFEN_MASK) == UART_GFCTL_AGFEN_ENABLE);
2831 }
2832 
2841 __STATIC_INLINE void DL_UART_enableGlitchFilterChaining(UART_Regs *uart)
2842 {
2843  uart->GFCTL |= UART_GFCTL_CHAIN_ENABLED;
2844 }
2845 
2854 __STATIC_INLINE void DL_UART_disableGlitchFilterChaining(UART_Regs *uart)
2855 {
2856  uart->GFCTL &= ~(UART_GFCTL_CHAIN_MASK);
2857 }
2858 
2867 __STATIC_INLINE bool DL_UART_isGlitchFilterChainingEnabled(UART_Regs *uart)
2868 {
2869  return ((uart->GFCTL & UART_GFCTL_CHAIN_MASK) == UART_GFCTL_CHAIN_ENABLED);
2870 }
2871 
2884 __STATIC_INLINE void DL_UART_setAnalogPulseWidth(
2885  UART_Regs *uart, DL_UART_PULSE_WIDTH pulseWidth)
2886 {
2888  &uart->GFCTL, (uint32_t) pulseWidth, UART_GFCTL_AGFSEL_MASK);
2889 }
2890 
2906 __STATIC_INLINE DL_UART_PULSE_WIDTH DL_UART_getAnalogPulseWidth(
2907  UART_Regs *uart)
2908 {
2909  uint32_t pulseWidth = uart->GFCTL & UART_GFCTL_AGFSEL_MASK;
2910 
2911  return (DL_UART_PULSE_WIDTH)(pulseWidth);
2912 }
2913 
2929 void DL_UART_transmitDataBlocking(UART_Regs *uart, uint8_t data);
2930 
2947 uint8_t DL_UART_receiveDataBlocking(UART_Regs *uart);
2948 
2969 bool DL_UART_transmitDataCheck(UART_Regs *uart, uint8_t data);
2970 
2991 bool DL_UART_receiveDataCheck(UART_Regs *uart, uint8_t *buffer);
2992 
3002 uint32_t DL_UART_drainRXFIFO(
3003  UART_Regs *uart, uint8_t *buffer, uint32_t maxCount);
3004 
3017 uint32_t DL_UART_fillTXFIFO(UART_Regs *uart, uint8_t *buffer, uint32_t count);
3018 
3034 __STATIC_INLINE void DL_UART_enableDMAReceiveEvent(
3035  UART_Regs *uart, uint32_t interrupt)
3036 {
3037  uart->INT_EVENT1.IMASK = interrupt;
3038 }
3039 
3053 __STATIC_INLINE void DL_UART_enableDMATransmitEvent(UART_Regs *uart)
3054 {
3055  uart->INT_EVENT2.IMASK = UART_INT_EVENT2_IMASK_TXINT_SET;
3056 }
3057 
3071 __STATIC_INLINE void DL_UART_disableDMAReceiveEvent(
3072  UART_Regs *uart, uint32_t interrupt)
3073 {
3074  uart->INT_EVENT1.IMASK &= ~(interrupt);
3075 }
3076 
3090 __STATIC_INLINE void DL_UART_disableDMATransmitEvent(UART_Regs *uart)
3091 {
3092  uart->INT_EVENT2.IMASK = UART_INT_EVENT2_IMASK_TXINT_CLR;
3093 }
3094 
3110 __STATIC_INLINE uint32_t DL_UART_getEnabledDMAReceiveEvent(
3111  UART_Regs *uart, uint32_t interruptMask)
3112 {
3113  return (uart->INT_EVENT1.IMASK & interruptMask);
3114 }
3115 
3129 __STATIC_INLINE uint32_t DL_UART_getEnabledDMATransmitEvent(UART_Regs *uart)
3130 {
3131  return (uart->INT_EVENT2.IMASK & UART_INT_EVENT2_IMASK_TXINT_MASK);
3132 }
3133 
3154  UART_Regs *uart, uint32_t interruptMask)
3155 {
3156  return (uart->INT_EVENT1.MIS & interruptMask);
3157 }
3158 
3177  UART_Regs *uart)
3178 {
3179  return (uart->INT_EVENT2.MIS & UART_INT_EVENT2_MIS_TXINT_MASK);
3180 }
3181 
3199 __STATIC_INLINE uint32_t DL_UART_getRawDMAReceiveEventStatus(
3200  UART_Regs *uart, uint32_t interruptMask)
3201 {
3202  return (uart->INT_EVENT1.RIS & interruptMask);
3203 }
3204 
3220 __STATIC_INLINE uint32_t DL_UART_getRawDMATransmitEventStatus(UART_Regs *uart)
3221 {
3222  return (uart->INT_EVENT2.RIS & UART_INT_EVENT2_RIS_TXINT_MASK);
3223 }
3224 
3241 __STATIC_INLINE DL_UART_DMA_IIDX_RX DL_UART_getPendingDMAReceiveEvent(
3242  UART_Regs *uart)
3243 {
3244  return (DL_UART_DMA_IIDX_RX)(uart->INT_EVENT1.IIDX);
3245 }
3246 
3263 __STATIC_INLINE DL_UART_DMA_IIDX_TX DL_UART_getPendingDMATransmitEvent(
3264  UART_Regs *uart)
3265 {
3266  return (DL_UART_DMA_IIDX_TX)(uart->INT_EVENT2.IIDX);
3267 }
3268 
3281  UART_Regs *uart, uint32_t interruptMask)
3282 {
3283  uart->INT_EVENT1.ICLR = interruptMask;
3284 }
3285 
3296 __STATIC_INLINE void DL_UART_clearDMATransmitEventStatus(UART_Regs *uart)
3297 {
3298  uart->INT_EVENT2.ICLR = UART_INT_EVENT2_ICLR_TXINT_CLR;
3299 }
3300 
3310 __STATIC_INLINE void DL_UART_setClockDivider2(
3311  UART_Regs *uart, DL_UART_CLOCK_DIVIDE_RATIO ratio)
3312 {
3313  uart->CLKDIV2 = (uint32_t) ratio;
3314 }
3315 
3329 __STATIC_INLINE DL_UART_CLOCK_DIVIDE_RATIO DL_UART_getClockDivider2(
3330  UART_Regs *uart)
3331 {
3332  uint32_t ratio = uart->CLKDIV2;
3333  return (DL_UART_CLOCK_DIVIDE_RATIO) ratio;
3334 }
3335 #ifdef __MSPM0_HAS_UART_MAIN__
3336 
3354  UART_Regs *uart, DL_UART_Main_backupConfig *ptr);
3355 
3373  UART_Regs *uart, DL_UART_Main_backupConfig *ptr);
3374 
3375 #endif /* __MSPM0_HAS_UART_MAIN__ */
3376 
3377 #ifdef __MSPM0_HAS_UART_EXTD__
3378 
3397  UART_Regs *uart, DL_UART_Extend_backupConfig *ptr);
3398 
3417  UART_Regs *uart, DL_UART_Extend_backupConfig *ptr);
3418 
3419 #endif /* __MSPM0_HAS_UART_EXTD__ */
3420 
3421 #ifdef __cplusplus
3422 }
3423 #endif
3424 
3425 #endif /* __MSPM0_HAS_UART_MAIN__ || __MSPM0_HAS_UART_EXTD__ */
3426 
3427 #else
3428 #warning \
3429  "TI highly recommends accessing uart with dl_uart_main, dl_uart_extend.h only."
3430 #endif /* ti_dl_dl_uart_main__include ti_dl_dl_uart_extend__include */
3431 
3432 #endif /* ti_dl_dl_uart__include */
3433 
Definition: dl_uart.h:452
DL_UART_CLOCK clockSel
Definition: dl_uart.h:511
__STATIC_INLINE void DL_UART_disable(UART_Regs *uart)
Disable the UART peripheral.
Definition: dl_uart.h:762
__STATIC_INLINE uint32_t DL_UART_getExternalDriverHold(UART_Regs *uart)
Get the external driver setup hold.
Definition: dl_uart.h:1624
bool DL_UART_Extend_restoreConfiguration(UART_Regs *uart, DL_UART_Extend_backupConfig *ptr)
Restore UART Extend configuration after leaving a power loss state.
bool DL_UART_receiveDataCheck(UART_Regs *uart, uint8_t *buffer)
Checks the RX FIFO before trying to transmit data.
__STATIC_INLINE bool DL_UART_isRXFIFOEmpty(UART_Regs *uart)
Checks if the RX FIFO is empty.
Definition: dl_uart.h:1669
__STATIC_INLINE void DL_Common_updateReg(volatile uint32_t *reg, uint32_t val, uint32_t mask)
Writes value to specified register - retaining bits unaffected by mask.
Definition: dl_common.h:63
__STATIC_INLINE void DL_UART_enableMSBFirst(UART_Regs *uart)
Enable most significant bit (MSB) first.
Definition: dl_uart.h:1014
Definition: dl_uart.h:194
bool backupRdy
Definition: dl_uart.h:653
Definition: dl_uart.h:417
__STATIC_INLINE uint32_t DL_UART_getRawDMAReceiveEventStatus(UART_Regs *uart, uint32_t interruptMask)
Check interrupt flag of any UART interrupt for DMA receive event.
Definition: dl_uart.h:3199
Definition: dl_uart.h:204
__STATIC_INLINE DL_UART_IRDA_POLARITY DL_UART_getIrDARXPulsePolarity(UART_Regs *uart)
Get the IrDA receive input UCAxRXD polarity.
Definition: dl_uart.h:2557
Definition: dl_uart.h:192
Definition: dl_uart.h:361
__STATIC_INLINE void DL_UART_enablePower(UART_Regs *uart)
Enables power on UART module.
Definition: dl_uart.h:675
uint32_t clockSel
Definition: dl_uart.h:596
__STATIC_INLINE uint32_t DL_UART_getEnabledDMAReceiveEvent(UART_Regs *uart, uint32_t interruptMask)
Check which UART interrupt for DMA receive events is enabled.
Definition: dl_uart.h:3110
__STATIC_INLINE bool DL_UART_isPowerEnabled(UART_Regs *uart)
Returns if power on uart module.
Definition: dl_uart.h:698
__STATIC_INLINE void DL_UART_setAnalogPulseWidth(UART_Regs *uart, DL_UART_PULSE_WIDTH pulseWidth)
Set the pulse width select for the analog glitch suppresion.
Definition: dl_uart.h:2884
Definition: dl_uart.h:186
__STATIC_INLINE void DL_UART_disableDMATransmitEvent(UART_Regs *uart)
Disables UART interrupt from triggering the DMA transmit event.
Definition: dl_uart.h:3090
__STATIC_INLINE void DL_UART_disableSendIdlePattern(UART_Regs *uart)
Disable send idle pattern.
Definition: dl_uart.h:1540
__STATIC_INLINE void DL_UART_enableAnalogGlitchFilter(UART_Regs *uart)
Enable the analog glitch filter on the RX input.
Definition: dl_uart.h:2805
__STATIC_INLINE uint8_t DL_UART_receiveData(UART_Regs *uart)
Reads data from the RX FIFO.
Definition: dl_uart.h:2012
__STATIC_INLINE void DL_UART_disableLINCountWhileLow(UART_Regs *uart)
Disable LIN counter increments while RXD signal is low.
Definition: dl_uart.h:2190
Definition: dl_uart.h:477
Definition: dl_uart.h:206
__STATIC_INLINE void DL_UART_disableLINRisingEdgeCapture(UART_Regs *uart)
Disable capture of LIN counter on a rising edge.
Definition: dl_uart.h:2275
DL_UART_IIDX
Definition: dl_uart.h:178
__STATIC_INLINE void DL_UART_enableLINCountWhileLow(UART_Regs *uart)
Enable LIN counter incrementing while RXD signal is low.
Definition: dl_uart.h:2162
DL_UART_FLOW_CONTROL flowControl
Definition: dl_uart.h:493
__STATIC_INLINE void DL_UART_enableIrDAMode(UART_Regs *uart)
Enable the IrDA encoder/decoder.
Definition: dl_uart.h:2422
__STATIC_INLINE uint32_t DL_UART_getEnabledDMATransmitEventStatus(UART_Regs *uart)
Check interrupt flag of enabled UART interrupt for DMA transmit event.
Definition: dl_uart.h:3176
Definition: dl_uart.h:327
Definition: dl_uart.h:442
Definition: dl_uart.h:471
__STATIC_INLINE void DL_UART_setOversampling(UART_Regs *uart, DL_UART_OVERSAMPLING_RATE rate)
Set the oversampling rate.
Definition: dl_uart.h:823
uint32_t ibrd
Definition: dl_uart.h:545
Definition: dl_uart.h:357
__STATIC_INLINE bool DL_UART_isTXFIFOEmpty(UART_Regs *uart)
Checks if the TX FIFO is empty.
Definition: dl_uart.h:1710
Definition: dl_uart.h:303
Definition: dl_uart.h:367
Definition: dl_uart.h:188
__STATIC_INLINE void DL_UART_disableAnalogGlitchFilter(UART_Regs *uart)
Disable the analog glitch filter on the RX input.
Definition: dl_uart.h:2815
__STATIC_INLINE void DL_UART_setExternalDriverHold(UART_Regs *uart, uint32_t val)
Set external driver setup hold.
Definition: dl_uart.h:1607
__STATIC_INLINE bool DL_UART_isIdleModeDetected(UART_Regs *uart)
Checks if Idle mode has been detected.
Definition: dl_uart.h:1769
__STATIC_INLINE uint32_t DL_UART_getEnabledInterruptStatus(UART_Regs *uart, uint32_t interruptMask)
Check interrupt flag of enabled UART interrupts.
Definition: dl_uart.h:2715
Definition: dl_uart.h:285
__STATIC_INLINE void DL_UART_enable(UART_Regs *uart)
Enable the UART peripheral.
Definition: dl_uart.h:736
Definition: dl_uart.h:315
Definition: dl_uart.h:196
uint32_t controlWord
Definition: dl_uart.h:593
DL_UART_FLOW_CONTROL
Definition: dl_uart.h:375
__STATIC_INLINE uint32_t DL_UART_getFractionalBaudRateDivisor(UART_Regs *uart)
Get Fractional Baud-Rate Divisor.
Definition: dl_uart.h:1906
__STATIC_INLINE bool DL_UART_isMajorityVotingEnabled(UART_Regs *uart)
Check if majority voting is enabled.
Definition: dl_uart.h:978
__STATIC_INLINE bool DL_UART_isLINRisingEdgeCaptureEnabled(UART_Regs *uart)
Check status of capture of LIN counter on a rising edge.
Definition: dl_uart.h:2264
__STATIC_INLINE void DL_UART_setBaudRateDivisor(UART_Regs *uart, uint32_t integerDivisor, uint32_t fractionalDivisor)
Set the baud rate divisor.
Definition: dl_uart.h:1924
void DL_UART_configBaudRate(UART_Regs *uart, uint32_t clockFreq, uint32_t baudRate)
Configure the baud rate.
__STATIC_INLINE void DL_UART_disableLINCounterCompareMatch(UART_Regs *uart)
Disable LIN counter compare match mode.
Definition: dl_uart.h:2351
DL_UART_PARITY parity
Definition: dl_uart.h:496
__STATIC_INLINE bool DL_UART_isClearToSend(UART_Regs *uart)
Checks if UART is clear to send.
Definition: dl_uart.h:1748
uint32_t divideRatio
Definition: dl_uart.h:537
__STATIC_INLINE DL_UART_TX_FIFO_LEVEL DL_UART_getTXFIFOThreshold(UART_Regs *uart)
Get the TX FIFO interrupt threshold level.
Definition: dl_uart.h:1806
Definition: dl_uart.h:381
__STATIC_INLINE bool DL_UART_isTransmitPinManualControlEnabled(UART_Regs *uart)
Check if control of the TXD pin is enabled.
Definition: dl_uart.h:1085
Definition: dl_uart.h:475
__STATIC_INLINE void DL_UART_clearDMATransmitEventStatus(UART_Regs *uart)
Clear pending UART interrupt for DMA transmit event.
Definition: dl_uart.h:3296
__STATIC_INLINE void DL_UART_enableDMAReceiveEvent(UART_Regs *uart, uint32_t interrupt)
Enable UART interrupt for triggering the DMA receive event.
Definition: dl_uart.h:3034
DL_UART_DMA_IIDX_RX
Definition: dl_uart.h:224
__STATIC_INLINE DL_UART_MODE DL_UART_getCommunicationMode(UART_Regs *uart)
Get the communication mode/protocol being used.
Definition: dl_uart.h:1216
void DL_UART_transmitDataBlocking(UART_Regs *uart, uint8_t data)
Blocks to ensure transmit is ready before sending data.
__STATIC_INLINE bool DL_UART_isLINSendBreakEnabled(UART_Regs *uart)
Check if send break is enabled.
Definition: dl_uart.h:1401
Definition: dl_uart.h:331
__STATIC_INLINE void DL_UART_setParityMode(UART_Regs *uart, DL_UART_PARITY parity)
Set the parity mode.
Definition: dl_uart.h:1434
uint32_t interruptFifoLevelSelectWord
Definition: dl_uart.h:542
Definition: dl_uart.h:450
__STATIC_INLINE void DL_UART_enableLINCounterCompareMatch(UART_Regs *uart)
Enable LIN counter compare match mode.
Definition: dl_uart.h:2288
__STATIC_INLINE uint16_t DL_UART_getLINCounterValue(UART_Regs *uart)
Get the LIN counter value.
Definition: dl_uart.h:2062
__STATIC_INLINE DL_UART_STOP_BITS DL_UART_getStopBits(UART_Regs *uart)
Get the number of stop bits.
Definition: dl_uart.h:1485
uint32_t divideRatio
Definition: dl_uart.h:599
__STATIC_INLINE uint32_t DL_UART_getIrDATXPulseLength(UART_Regs *uart)
Get the IrDA transmit pulse length.
Definition: dl_uart.h:2529
Definition: dl_uart.h:463
Definition: dl_uart.h:329
DL_UART_WORD_LENGTH
Definition: dl_uart.h:325
__STATIC_INLINE void DL_UART_enableLoopbackMode(UART_Regs *uart)
Enable loopback mode.
Definition: dl_uart.h:860
__STATIC_INLINE void DL_UART_enableMajorityVoting(UART_Regs *uart)
Enable majority voting control.
Definition: dl_uart.h:963
uint8_t DL_UART_receiveDataBlocking(UART_Regs *uart)
Blocks to ensure receive is ready before reading data.
DL_UART_TX_FIFO_LEVEL
Definition: dl_uart.h:411
DL_UART_IRDA_CLOCK
Definition: dl_uart.h:440
Definition: dl_uart.h:391
__STATIC_INLINE void DL_UART_setRTSOutput(UART_Regs *uart, DL_UART_RTS val)
Set the request to send output signal.
Definition: dl_uart.h:1281
Definition: dl_uart.h:421
DriverLib Common APIs.
Definition: dl_uart.h:413
__STATIC_INLINE void DL_UART_enableDMATransmitEvent(UART_Regs *uart)
Enable UART interrupt for triggering the DMA transmit event.
Definition: dl_uart.h:3053
uint32_t glitchFilterControlWord
Definition: dl_uart.h:559
Definition: dl_uart.h:345
__STATIC_INLINE uint32_t DL_UART_getRawInterruptStatus(UART_Regs *uart, uint32_t interruptMask)
Check interrupt flag of any UART interrupt.
Definition: dl_uart.h:2736
__STATIC_INLINE void DL_UART_enableLINReceptionCountControl(UART_Regs *uart)
Setup LIN counter control for LIN reception.
Definition: dl_uart.h:2321
Definition: dl_uart.h:432
uint32_t DL_UART_fillTXFIFO(UART_Regs *uart, uint8_t *buffer, uint32_t count)
Fill the TX FIFO until full using 8 bit access.
__STATIC_INLINE void DL_UART_setClockDivider2(UART_Regs *uart, DL_UART_CLOCK_DIVIDE_RATIO ratio)
Sets the second clock divider ratio.
Definition: dl_uart.h:3310
__STATIC_INLINE uint32_t DL_UART_getEnabledDMATransmitEvent(UART_Regs *uart)
Check if UART interrupt for DMA transmit event is enabled.
Definition: dl_uart.h:3129
Definition: dl_uart.h:383
uint32_t ibrd
Definition: dl_uart.h:613
Definition: dl_uart.h:200
__STATIC_INLINE bool DL_UART_isAnalogGlitchFilterEnabled(UART_Regs *uart)
Returns if analog glitch filter is enabled.
Definition: dl_uart.h:2828
__STATIC_INLINE uint32_t DL_UART_getRawDMATransmitEventStatus(UART_Regs *uart)
Check interrupt flag of any UART interrupt for DMA transmit event.
Definition: dl_uart.h:3220
uint32_t interruptMask0
Definition: dl_uart.h:563
__STATIC_INLINE void DL_UART_disableTransmitPinManualControl(UART_Regs *uart)
Disable control of the TXD pin.
Definition: dl_uart.h:1103
Definition: dl_uart.h:333
__STATIC_INLINE uint32_t DL_UART_getEnabledInterrupts(UART_Regs *uart, uint32_t interruptMask)
Check which UART interrupts are enabled.
Definition: dl_uart.h:2692
__STATIC_INLINE DL_UART_CLOCK_DIVIDE_RATIO DL_UART_getClockDivider2(UART_Regs *uart)
Gets the value of CLKDIV2.
Definition: dl_uart.h:3329
__STATIC_INLINE DL_UART_RX_FIFO_LEVEL DL_UART_getRXFIFOThreshold(UART_Regs *uart)
Get the RX FIFO interrupt threshold level.
Definition: dl_uart.h:1842
Definition: dl_uart.h:220
__STATIC_INLINE void DL_UART_disableMSBFirst(UART_Regs *uart)
Disable most significant bit (MSB) first.
Definition: dl_uart.h:1049
uint32_t linControlWord
Definition: dl_uart.h:626
__STATIC_INLINE void DL_UART_enableLINRisingEdgeCapture(UART_Regs *uart)
Enable capture of the LIN counter on a rising edge.
Definition: dl_uart.h:2249
__STATIC_INLINE uint32_t DL_UART_getRXInterruptTimeout(UART_Regs *uart)
Get the RX interrupt timeout.
Definition: dl_uart.h:1878
__STATIC_INLINE DL_UART_DIRECTION DL_UART_getDirection(UART_Regs *uart)
Get the direction of the UART communication.
Definition: dl_uart.h:930
DL_UART_MODE
Definition: dl_uart.h:337
__STATIC_INLINE uint32_t DL_UART_getEnabledDMAReceiveEventStatus(UART_Regs *uart, uint32_t interruptMask)
Check interrupt flag of enabled UART interrupt for DMA receive event.
Definition: dl_uart.h:3153
DL_UART_DMA_IIDX_TX
Definition: dl_uart.h:232
DL_UART_CLOCK_DIVIDE_RATIO divideRatio
Definition: dl_uart.h:514
__STATIC_INLINE bool DL_UART_isFIFOsEnabled(UART_Regs *uart)
Check if FIFOs are enabled.
Definition: dl_uart.h:1359
Definition: dl_uart.h:208
__STATIC_INLINE void DL_UART_setExternalDriverSetup(UART_Regs *uart, uint32_t val)
Set external driver setup value.
Definition: dl_uart.h:1571
Definition: dl_uart.h:339
__STATIC_INLINE bool DL_UART_isParityEnabled(UART_Regs *uart)
Check if parity is enabled.
Definition: dl_uart.h:1416
Configuration structure to backup UART Main peripheral state before going to STOP/STANDBY mode...
Definition: dl_uart.h:526
__STATIC_INLINE void DL_UART_enableSendIdlePattern(UART_Regs *uart)
Send idle pattern.
Definition: dl_uart.h:1530
__STATIC_INLINE bool DL_UART_isReset(UART_Regs *uart)
Returns if uart peripheral was reset.
Definition: dl_uart.h:725
Definition: dl_uart.h:399
__STATIC_INLINE DL_UART_DMA_IIDX_RX DL_UART_getPendingDMAReceiveEvent(UART_Regs *uart)
Get highest priority pending UART interrupt for DMA receive event.
Definition: dl_uart.h:3241
DL_UART_PULSE_WIDTH
Definition: dl_uart.h:283
Definition: dl_uart.h:212
__STATIC_INLINE void DL_UART_setIrDATXPulseClockSelect(UART_Regs *uart, DL_UART_IRDA_CLOCK uartClock)
Set the IrDA transmit pulse clock select.
Definition: dl_uart.h:2459
__STATIC_INLINE bool DL_UART_isSendIdlePatternEnabled(UART_Regs *uart)
Check if send idle pattern is enabled.
Definition: dl_uart.h:1555
__STATIC_INLINE void DL_UART_enableInterrupt(UART_Regs *uart, uint32_t interruptMask)
Enable UART interrupts.
Definition: dl_uart.h:2660
__STATIC_INLINE void DL_UART_setAddress(UART_Regs *uart, uint32_t address)
Set the address.
Definition: dl_uart.h:2625
Definition: dl_uart.h:184
__STATIC_INLINE uint16_t DL_UART_getLINFallingEdgeCaptureValue(UART_Regs *uart)
Get the LINC0 counter value.
Definition: dl_uart.h:2393
uint32_t fbrd
Definition: dl_uart.h:616
__STATIC_INLINE bool DL_UART_isLINCounterEnabled(UART_Regs *uart)
Check if the LIN counter is enabled.
Definition: dl_uart.h:2089
__STATIC_INLINE void DL_UART_clearDMAReceiveEventStatus(UART_Regs *uart, uint32_t interruptMask)
Clear pending UART interrupts for DMA receive event.
Definition: dl_uart.h:3280
Definition: dl_uart.h:428
Definition: dl_uart.h:436
DL_UART_RX_FIFO_LEVEL
Definition: dl_uart.h:425
__STATIC_INLINE void DL_UART_enableLINCounter(UART_Regs *uart)
Enable the LIN counter.
Definition: dl_uart.h:2074
Configuration struct for DL_UART_setClockConfig.
Definition: dl_uart.h:509
__STATIC_INLINE void DL_UART_enableLINFallingEdgeCapture(UART_Regs *uart)
Enable capture of the LIN counter on a falling edge.
Definition: dl_uart.h:2207
Definition: dl_uart.h:379
__STATIC_INLINE void DL_UART_setIrDARXPulsePolarity(UART_Regs *uart, DL_UART_IRDA_POLARITY polarity)
Set the IrDA receive input UCAxRXD polarity.
Definition: dl_uart.h:2541
DL_UART_PARITY
Definition: dl_uart.h:307
DL_UART_TXD_OUT
Definition: dl_uart.h:403
DL_UART_CLOCK_DIVIDE_RATIO
Definition: dl_uart.h:461
uint32_t DL_UART_drainRXFIFO(UART_Regs *uart, uint8_t *buffer, uint32_t maxCount)
Read all available data out of the RX FIFO using 8 bit access.
Definition: dl_uart.h:190
Configuration struct for DL_UART_init.
Definition: dl_uart.h:485
void DL_UART_configIrDAMode(UART_Regs *uart, DL_UART_IRDA_POLARITY polarity, uint32_t pulseLength, DL_UART_IRDA_CLOCK irdaClk)
Set the IrDA configurations.
uint32_t address
Definition: dl_uart.h:637
__STATIC_INLINE uint32_t DL_UART_getErrorStatus(UART_Regs *uart, uint32_t errorMask)
Gets the status of the error flags of the received data.
Definition: dl_uart.h:2028
Definition: dl_uart.h:321
__STATIC_INLINE uint32_t DL_UART_getIntegerBaudRateDivisor(UART_Regs *uart)
Get Integer Baud-Rate Divisor.
Definition: dl_uart.h:1892
DL_UART_STOP_BITS
Definition: dl_uart.h:395
Definition: dl_uart.h:415
DL_UART_CLOCK
Definition: dl_uart.h:365
Definition: dl_uart.h:430
bool DL_UART_Main_saveConfiguration(UART_Regs *uart, DL_UART_Main_backupConfig *ptr)
Save UART Main configuration before entering a power loss state.
Definition: dl_uart.h:343
Definition: dl_uart.h:287
__STATIC_INLINE bool DL_UART_isMSBFirstEnabled(UART_Regs *uart)
Check if most significant bit (MSB) first is enabled.
Definition: dl_uart.h:1029
Definition: dl_uart.h:465
__STATIC_INLINE void DL_UART_disableLINFallingEdgeCapture(UART_Regs *uart)
Disable capture of LIN counter on a falling edge.
Definition: dl_uart.h:2235
Definition: dl_uart.h:180
bool DL_UART_Main_restoreConfiguration(UART_Regs *uart, DL_UART_Main_backupConfig *ptr)
Restore UART Main configuration after leaving a power loss state.
__STATIC_INLINE void DL_UART_reset(UART_Regs *uart)
Resets uart peripheral.
Definition: dl_uart.h:709
uint32_t controlWord
Definition: dl_uart.h:531
__STATIC_INLINE void DL_UART_disableDMAReceiveEvent(UART_Regs *uart, uint32_t interrupt)
Disables UART interrupt from triggering the DMA receive event.
Definition: dl_uart.h:3071
DL_UART_STOP_BITS stopBits
Definition: dl_uart.h:502
__STATIC_INLINE bool DL_UART_isBusy(UART_Regs *uart)
Checks if the UART is busy.
Definition: dl_uart.h:1649
__STATIC_INLINE bool DL_UART_isTXFIFOFull(UART_Regs *uart)
Checks if the TX FIFO is full.
Definition: dl_uart.h:1731
__STATIC_INLINE bool DL_UART_isGlitchFilterChainingEnabled(UART_Regs *uart)
Returns if glitch filter chaining enabled.
Definition: dl_uart.h:2867
Definition: dl_uart.h:226
Definition: dl_uart.h:434
__STATIC_INLINE void DL_UART_disableMajorityVoting(UART_Regs *uart)
Disable majority voting control.
Definition: dl_uart.h:995
__STATIC_INLINE void DL_UART_setTransmitPinManualOutput(UART_Regs *uart, DL_UART_TXD_OUT txdOutVal)
Set the output of the TXD pin.
Definition: dl_uart.h:1129
Definition: dl_uart.h:444
Definition: dl_uart.h:299
__STATIC_INLINE void DL_UART_setRXFIFOThreshold(UART_Regs *uart, DL_UART_RX_FIFO_LEVEL threshold)
Set the RX FIFO interrupt threshold level. The interrupts are generated based on a transition through...
Definition: dl_uart.h:1826
uint32_t interruptMask0
Definition: dl_uart.h:641
__STATIC_INLINE void DL_UART_disableFIFOs(UART_Regs *uart)
Disable FIFOs.
Definition: dl_uart.h:1344
__STATIC_INLINE DL_UART_DMA_IIDX_TX DL_UART_getPendingDMATransmitEvent(UART_Regs *uart)
Get highest priority pending UART interrupt for DMA transmit event.
Definition: dl_uart.h:3263
Configuration structure to backup UART Extend peripheral state before going to STOP/STANDBY mode...
Definition: dl_uart.h:588
__STATIC_INLINE void DL_UART_enableFIFOs(UART_Regs *uart)
Enable FIFOs.
Definition: dl_uart.h:1326
Definition: dl_uart.h:397
__STATIC_INLINE void DL_UART_disableLINSendBreak(UART_Regs *uart)
Disable send break.
Definition: dl_uart.h:1386
__STATIC_INLINE void DL_UART_setDigitalPulseWidth(UART_Regs *uart, uint32_t pulseWidth)
Set the pulse width select for the digital glitch suppresion.
Definition: dl_uart.h:1951
__STATIC_INLINE bool DL_UART_isIrDAModeEnabled(UART_Regs *uart)
Check if the IrDA encoder/decoder is enabled.
Definition: dl_uart.h:2437
Definition: dl_uart.h:469
DL_UART_IRDA_POLARITY
Definition: dl_uart.h:448
__STATIC_INLINE DL_UART_PULSE_WIDTH DL_UART_getAnalogPulseWidth(UART_Regs *uart)
Get the pulse width select for the glitch suppresion.
Definition: dl_uart.h:2906
__STATIC_INLINE void DL_UART_disableManchesterEncoding(UART_Regs *uart)
Disable Manchester encoding.
Definition: dl_uart.h:1169
__STATIC_INLINE void DL_UART_setLINCounterCompareValue(UART_Regs *uart, uint16_t value)
Set the value to be compared to the LIN counter.
Definition: dl_uart.h:2368
Definition: dl_uart.h:347
Definition: dl_uart.h:359
__STATIC_INLINE void DL_UART_setRXInterruptTimeout(UART_Regs *uart, uint32_t timeout)
Set the RX interrupt timeout.
Definition: dl_uart.h:1861
Definition: dl_uart.h:210
__STATIC_INLINE void DL_UART_setDirection(UART_Regs *uart, DL_UART_DIRECTION direction)
Set the direction of the UART communication.
Definition: dl_uart.h:914
Definition: dl_uart.h:202
__STATIC_INLINE void DL_UART_setCommunicationMode(UART_Regs *uart, DL_UART_MODE mode)
Set the communication mode/protocol to use.
Definition: dl_uart.h:1201
Definition: dl_uart.h:355
__STATIC_INLINE void DL_UART_disableLoopbackMode(UART_Regs *uart)
Disable loopback mode.
Definition: dl_uart.h:893
uint32_t interruptMask1
Definition: dl_uart.h:645
__STATIC_INLINE void DL_UART_enableLINCounterClearOnFallingEdge(UART_Regs *uart)
Enable LIN counter clear and start counting on falling edge of RXD.
Definition: dl_uart.h:2119
uint32_t interruptMask2
Definition: dl_uart.h:649
__STATIC_INLINE void DL_UART_setLINCounterValue(UART_Regs *uart, uint16_t value)
Set the LIN counter value.
Definition: dl_uart.h:2043
uint32_t glitchFilterControlWord
Definition: dl_uart.h:621
Definition: dl_uart.h:405
Definition: dl_uart.h:349
void DL_UART_setIrDAPulseLength(UART_Regs *uart, uint32_t pulseLength, DL_UART_IRDA_CLOCK irdaClk)
Set the IrDA transmit pulse length.
__STATIC_INLINE void DL_UART_disableIrDAMode(UART_Regs *uart)
Disable the IrDA encoder/decoder.
Definition: dl_uart.h:2447
Definition: dl_uart.h:341
void DL_UART_init(UART_Regs *uart, DL_UART_Config *config)
Initialize the UART peripheral.
uint32_t clockSel
Definition: dl_uart.h:534
__STATIC_INLINE void DL_UART_enableGlitchFilterChaining(UART_Regs *uart)
Enable analog and digital noise glitch filter chaining.
Definition: dl_uart.h:2841
DL_UART_DIRECTION
Definition: dl_uart.h:353
__STATIC_INLINE DL_UART_IRDA_CLOCK DL_UART_getIrDATXPulseClockSelect(UART_Regs *uart)
Get the IrDA transmit pulse clock select.
Definition: dl_uart.h:2476
uint32_t addressMask
Definition: dl_uart.h:634
uint32_t interruptMask2
Definition: dl_uart.h:571
Definition: dl_uart.h:311
DL_UART_OVERSAMPLING_RATE
Definition: dl_uart.h:295
__STATIC_INLINE DL_UART_WORD_LENGTH DL_UART_getWordLength(UART_Regs *uart)
Get the word length.
Definition: dl_uart.h:1515
__STATIC_INLINE void DL_UART_setWordLength(UART_Regs *uart, DL_UART_WORD_LENGTH wordLength)
Set the word length.
Definition: dl_uart.h:1499
uint32_t irdaControlWord
Definition: dl_uart.h:631
__STATIC_INLINE void DL_UART_setAddressMask(UART_Regs *uart, uint32_t addressMask)
Set the address mask for DALI, 9-bit, or Idle-Line mode.
Definition: dl_uart.h:2581
__STATIC_INLINE void DL_UART_changeConfig(UART_Regs *uart)
Prepares the UART to change the configuration.
Definition: dl_uart.h:2791
__STATIC_INLINE void DL_UART_disableLINCounterClearOnFallingEdge(UART_Regs *uart)
Disable LIN counting on falling edge of RXD.
Definition: dl_uart.h:2146
uint32_t lineControlRegisterWord
Definition: dl_uart.h:605
__STATIC_INLINE DL_UART_FLOW_CONTROL DL_UART_getFlowControl(UART_Regs *uart)
Check the flow control configuration.
Definition: dl_uart.h:1252
uint32_t interruptMask1
Definition: dl_uart.h:567
uint32_t lineControlRegisterWord
Definition: dl_uart.h:554
__STATIC_INLINE uint32_t DL_UART_getExternalDriverSetup(UART_Regs *uart)
Get the external driver setup value.
Definition: dl_uart.h:1588
bool DL_UART_transmitDataCheck(UART_Regs *uart, uint8_t data)
Checks the TX FIFO before trying to transmit data.
Definition: dl_uart.h:371
__STATIC_INLINE void DL_UART_disablePower(UART_Regs *uart)
Disables power on uart module.
Definition: dl_uart.h:685
DL_UART_DIRECTION direction
Definition: dl_uart.h:490
__STATIC_INLINE DL_UART_RTS DL_UART_getRTSOutput(UART_Regs *uart)
Get the request to send output signal.
Definition: dl_uart.h:1305
DL_UART_MODE mode
Definition: dl_uart.h:487
uint32_t interruptFifoLevelSelectWord
Definition: dl_uart.h:610
__STATIC_INLINE bool DL_UART_isEnabled(UART_Regs *uart)
Checks if the UART peripheral is enabled.
Definition: dl_uart.h:752
Definition: dl_uart.h:377
__STATIC_INLINE void DL_UART_enableManchesterEncoding(UART_Regs *uart)
Enable Manchester encoding.
Definition: dl_uart.h:1159
__STATIC_INLINE bool DL_UART_isLoopbackModeEnabled(UART_Regs *uart)
Check if loopback mode is enabled.
Definition: dl_uart.h:875
__STATIC_INLINE void DL_UART_setFlowControl(UART_Regs *uart, DL_UART_FLOW_CONTROL config)
Set the flow control configuration.
Definition: dl_uart.h:1235
Definition: dl_uart.h:407
DL_UART_WORD_LENGTH wordLength
Definition: dl_uart.h:499
Definition: dl_uart.h:182
__STATIC_INLINE uint16_t DL_UART_getLINRisingEdgeCaptureValue(UART_Regs *uart)
Get the LINC1 counter value.
Definition: dl_uart.h:2412
__STATIC_INLINE DL_UART_IIDX DL_UART_getPendingInterrupt(UART_Regs *uart)
Get highest priority pending UART interrupt.
Definition: dl_uart.h:2755
bool DL_UART_Extend_saveConfiguration(UART_Regs *uart, DL_UART_Extend_backupConfig *ptr)
Save UART Extend configuration before entering a power loss state.
__STATIC_INLINE bool DL_UART_isRXFIFOFull(UART_Regs *uart)
Checks if the RX FIFO is full.
Definition: dl_uart.h:1690
__STATIC_INLINE bool DL_UART_isLINCounterCompareMatchEnabled(UART_Regs *uart)
Check if LIN counter compare match mode is enabled.
Definition: dl_uart.h:2340
Definition: dl_uart.h:289
__STATIC_INLINE uint32_t DL_UART_getAddressMask(UART_Regs *uart)
Get the address mask being used.
Definition: dl_uart.h:2607
bool backupRdy
Definition: dl_uart.h:575
void DL_UART_setClockConfig(UART_Regs *uart, DL_UART_ClockConfig *config)
Configure UART source clock.
__STATIC_INLINE bool DL_UART_isManchesterEncodingEnabled(UART_Regs *uart)
Check if Manchester encoding is enabled.
Definition: dl_uart.h:1184
DL_UART_RTS
Definition: dl_uart.h:387
__STATIC_INLINE bool DL_UART_isLINFallingEdgeCaptureEnabled(UART_Regs *uart)
Check status of capture of LIN counter on a falling edge.
Definition: dl_uart.h:2224
__STATIC_INLINE void DL_UART_enableLINSendBreak(UART_Regs *uart)
Enable send break (for LIN protocol)
Definition: dl_uart.h:1373
__STATIC_INLINE DL_UART_PARITY DL_UART_getParityMode(UART_Regs *uart)
Get parity mode.
Definition: dl_uart.h:1451
void DL_UART_getClockConfig(UART_Regs *uart, DL_UART_ClockConfig *config)
Get UART source clock configuration.
Definition: dl_uart.h:234
Definition: dl_uart.h:467
__STATIC_INLINE bool DL_UART_isLINCounterClearOnFallingEdge(UART_Regs *uart)
Check if LIN counting on falling edge of RXD is enabled.
Definition: dl_uart.h:2135
__STATIC_INLINE DL_UART_TXD_OUT DL_UART_getTransmitPinManualOutput(UART_Regs *uart)
Get the output value of the TXD pin.
Definition: dl_uart.h:1146
__STATIC_INLINE bool DL_UART_isLINCountWhileLowEnabled(UART_Regs *uart)
Check if LIN counter increments while RXD signal is low is enabled.
Definition: dl_uart.h:2177
Definition: dl_uart.h:198
Definition: dl_uart.h:473
Definition: dl_uart.h:369
__STATIC_INLINE DL_UART_OVERSAMPLING_RATE DL_UART_getOversampling(UART_Regs *uart)
Get the oversampling rate.
Definition: dl_uart.h:839
__STATIC_INLINE uint32_t DL_UART_getAddress(UART_Regs *uart)
Get the address being used.
Definition: dl_uart.h:2647
__STATIC_INLINE void DL_UART_enableTransmitPinManualControl(UART_Regs *uart)
Enable control of the TXD pin.
Definition: dl_uart.h:1070
__STATIC_INLINE void DL_UART_disableGlitchFilterChaining(UART_Regs *uart)
Disable analog and digital noise glitch filter chaining.
Definition: dl_uart.h:2854
__STATIC_INLINE void DL_UART_setTXFIFOThreshold(UART_Regs *uart, DL_UART_TX_FIFO_LEVEL threshold)
Set the TX FIFO interrupt threshold level.
Definition: dl_uart.h:1790
Definition: dl_uart.h:419
uint32_t fbrd
Definition: dl_uart.h:548
__STATIC_INLINE void DL_UART_clearInterruptStatus(UART_Regs *uart, uint32_t interruptMask)
Clear pending UART interrupts.
Definition: dl_uart.h:2768
Definition: dl_uart.h:216
__STATIC_INLINE void DL_UART_disableInterrupt(UART_Regs *uart, uint32_t interruptMask)
Disable UART interrupts.
Definition: dl_uart.h:2674
Definition: dl_uart.h:297
Definition: dl_uart.h:319
__STATIC_INLINE void DL_UART_transmitData(UART_Regs *uart, uint8_t data)
Writes data into the TX FIFO to transmit.
Definition: dl_uart.h:1993
__STATIC_INLINE uint32_t DL_UART_getDigitalPulseWidth(UART_Regs *uart)
Get the pulse width select for the digital glitch suppresion.
Definition: dl_uart.h:1970
__STATIC_INLINE void DL_UART_setStopBits(UART_Regs *uart, DL_UART_STOP_BITS numStopBits)
Set the number of stop bits.
Definition: dl_uart.h:1469
__STATIC_INLINE void DL_UART_disableLINCounter(UART_Regs *uart)
Disable the LIN counter.
Definition: dl_uart.h:2102
__STATIC_INLINE void DL_UART_enableLINSyncFieldValidationCounterControl(UART_Regs *uart)
Setup LIN counter control for sync field validation.
Definition: dl_uart.h:2303
Definition: dl_uart.h:309
Definition: dl_uart.h:389
Definition: dl_uart.h:291
Definition: dl_uart.h:228
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale