AM263x MCU+ SDK  09.02.00
uart_lld.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021-2023 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * 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
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
48 #ifndef UART_LLD_H_
49 #define UART_LLD_H_
50 
51 /* ========================================================================== */
52 /* Include Files */
53 /* ========================================================================== */
54 
55 #include <stdint.h>
56 #include <drivers/hw_include/cslr.h>
57 #include <drivers/hw_include/cslr_uart.h>
58 #include <drivers/hw_include/hw_types.h>
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
64 /* ========================================================================== */
65 /* Macros & Typedefs */
66 /* ========================================================================== */
67 
69 typedef void *UART_DmaHandle;
70 
71 typedef void *UART_DmaChConfig;
72 
74 #define UART_FIFO_SIZE (64U)
75 
81 #define UART_TRANSMITEMPTY_TRIALCOUNT (3000U)
82 
84 #define UART_ERROR_COUNT (0x00FFFFFFU)
85 
95 #define UART_STATUS_SUCCESS ((int32_t)0)
96 
97 #define UART_STATUS_FAILURE ((int32_t)-1)
98 
99 #define UART_TRANSFER_STATUS_SUCCESS ((int32_t)0)
100 
101 #define UART_TRANSFER_STATUS_FAILURE ((int32_t)-1)
102 
107 #define UART_WAIT_FOREVER ((int32_t)-1)
108 
111 #define UART_INVALID_PARAM ((int32_t)-3)
112 
116 #define UART_TRANSFER_BUSY ((int32_t)-4)
117 
122 #define UART_TRANSFER_TIMEOUT ((int32_t)-2)
123 
128 #define UART_TRANSFER_INVALID_STATE ((int32_t)-5)
129 
130 #define UART_TRANSFER_STATUS_TIMEOUT (1U)
131 
132 #define UART_TRANSFER_STATUS_ERROR_BI (2U)
133 
134 #define UART_TRANSFER_STATUS_ERROR_FE (3U)
135 
136 #define UART_TRANSFER_STATUS_ERROR_PE (4U)
137 
138 #define UART_TRANSFER_STATUS_ERROR_OE (5U)
139 
140 #define UART_TRANSFER_STATUS_CANCELLED (6U)
141 
142 #define UART_TRANSFER_STATUS_STARTED (7U)
143 
144 #define UART_TRANSFER_STATUS_READ_TIMEOUT (8U)
145 
146 #define UART_TRANSFER_STATUS_ERROR_INUSE (9U)
147 
148 #define UART_TRANSFER_STATUS_ERROR_OTH (10U)
149 
171 #define UART_READ_RETURN_MODE_FULL (0U)
172 
175 #define UART_READ_RETURN_MODE_PARTIAL (1U)
176 
186 #define UART_LEN_5 (0U)
187 #define UART_LEN_6 (1U)
188 #define UART_LEN_7 (2U)
189 #define UART_LEN_8 (3U)
190 
200 #define UART_STATE_RESET (0U)
201 #define UART_STATE_READY (1U)
202 #define UART_STATE_BUSY (2U)
203 #define UART_STATE_ERROR (3U)
204 
209 #define UART_NOT_IN_USE(x) (void) 0
210 
218 #define UART_STOPBITS_1 (0U)
219 #define UART_STOPBITS_2 (1U)
220 #define UART_STOPBITS_1P5 (UART_STOPBITS_1)
221 
231 #define UART_PARITY_NONE (0x00U)
232 #define UART_PARITY_ODD (0x01U)
233 #define UART_PARITY_EVEN (0x03U)
234 #define UART_PARITY_FORCED0 (0x07U)
235 #define UART_PARITY_FORCED1 (0x05U)
236 
246 #define UART_FCTYPE_NONE (0x00U)
247 #define UART_FCTYPE_HW (0x02U)
248 
258 #define UART_FCPARAM_RXNONE (0x00U)
259 #define UART_FCPARAM_RXXONXOFF_2 (0x01U)
260 #define UART_FCPARAM_RXXONXOFF_1 (0x02U)
261 #define UART_FCPARAM_RXXONXOFF_12 (0x03U)
262 #define UART_FCPARAM_AUTO_RTS (0x40U)
263 
273 #define UART_FCPARAM_TXNONE (0x00U)
274 #define UART_FCPARAM_TXXONXOFF_2 (0x04U)
275 #define UART_FCPARAM_TXXONXOFF_1 (0x08U)
276 #define UART_FCPARAM_TXXONXOFF_12 (0x0CU)
277 #define UART_FCPARAM_AUTO_CTS (0x80U)
278 
288 #define UART_RXTRIGLVL_1 (1U)
289 #define UART_RXTRIGLVL_8 (8U)
290 #define UART_RXTRIGLVL_16 (16U)
291 #define UART_RXTRIGLVL_56 (56U)
292 #define UART_RXTRIGLVL_60 (60U)
293 
303 #define UART_TXTRIGLVL_1 (1U)
304 #define UART_TXTRIGLVL_8 (8U)
305 #define UART_TXTRIGLVL_16 (16U)
306 #define UART_TXTRIGLVL_32 (32U)
307 #define UART_TXTRIGLVL_56 (56U)
308 
318 #define UART_OPER_MODE_16X (0U)
319 #define UART_OPER_MODE_SIR (1U)
320 #define UART_OPER_MODE_16X_AUTO_BAUD (2U)
321 #define UART_OPER_MODE_13X (3U)
322 #define UART_OPER_MODE_MIR (4U)
323 #define UART_OPER_MODE_FIR (5U)
324 #define UART_OPER_MODE_CIR (6U)
325 #define UART_OPER_MODE_DISABLED (7U)
326 
337 #define UART_TX_FIFO_NOT_FULL ( \
338  UART_SSR_TX_FIFO_FULL_TX_FIFO_FULL_VALUE_0)
339 #define UART_TX_FIFO_FULL ( \
340  UART_SSR_TX_FIFO_FULL_TX_FIFO_FULL_VALUE_1)
341 
351 #define UART_INTID_MODEM_STAT (UART_IIR_IT_TYPE_IT_TYPE_VALUE_0 \
352  << \
353  UART_IIR_IT_TYPE_SHIFT)
354 #define UART_INTID_TX_THRES_REACH (UART_IIR_IT_TYPE_IT_TYPE_VALUE_1 \
355  << \
356  UART_IIR_IT_TYPE_SHIFT)
357 #define UART_INTID_RX_THRES_REACH (UART_IIR_IT_TYPE_IT_TYPE_VALUE_2 \
358  << \
359  UART_IIR_IT_TYPE_SHIFT)
360 #define UART_INTID_RX_LINE_STAT_ERROR (UART_IIR_IT_TYPE_IT_TYPE_VALUE_3 \
361  << \
362  UART_IIR_IT_TYPE_SHIFT)
363 #define UART_INTID_CHAR_TIMEOUT (UART_IIR_IT_TYPE_IT_TYPE_VALUE_6 \
364  << \
365  UART_IIR_IT_TYPE_SHIFT)
366 #define UART_INTID_XOFF_SPEC_CHAR_DETECT (UART_IIR_IT_TYPE_IT_TYPE_VALUE_8 \
367  << \
368  UART_IIR_IT_TYPE_SHIFT)
369 #define UART_INTID_MODEM_SIG_STATE_CHANGE (UART_IIR_IT_TYPE_IT_TYPE_VALUE_10 \
370  << \
371  UART_IIR_IT_TYPE_SHIFT)
372 
374 #define UART_INTR_PENDING (0U)
375 #define UART_N0_INTR_PENDING (1U)
376 
385 #define UART_INTR_CTS (UART_IER_CTS_IT_MASK)
386 #define UART_INTR_RTS (UART_IER_RTS_IT_MASK)
387 #define UART_INTR_XOFF (UART_IER_XOFF_IT_MASK)
388 #define UART_INTR_SLEEPMODE (UART_IER_SLEEP_MODE_MASK)
389 #define UART_INTR_MODEM_STAT (UART_IER_MODEM_STS_IT_MASK)
390 #define UART_INTR_LINE_STAT (UART_IER_LINE_STS_IT_MASK)
391 #define UART_INTR_THR (UART_IER_THR_IT_MASK)
392 #define UART_INTR_RHR_CTI (UART_IER_RHR_IT_MASK)
393 
394 #define UART_INTR2_RX_EMPTY (UART_IER2_EN_RXFIFO_EMPTY_MASK)
395 #define UART_INTR2_TX_EMPTY (UART_IER2_EN_TXFIFO_EMPTY_MASK)
396 
405 #define UART_FIFO_PE_FE_BI_DETECTED (UART_LSR_RX_FIFO_STS_MASK)
406 #define UART_BREAK_DETECTED_ERROR (UART_LSR_RX_BI_MASK)
407 #define UART_FRAMING_ERROR (UART_LSR_RX_FE_MASK)
408 #define UART_PARITY_ERROR (UART_LSR_RX_PE_MASK)
409 #define UART_OVERRUN_ERROR (UART_LSR_RX_OE_MASK)
410 
419 #define UART_REG_CONFIG_MODE_A ((uint32_t) 0x0080)
420 #define UART_REG_CONFIG_MODE_B ((uint32_t) 0x00BF)
421 #define UART_REG_OPERATIONAL_MODE ((uint32_t) 0x007F)
422 
433 #define UART_CONFIG_MODE_POLLED (0x00U)
434 #define UART_CONFIG_MODE_INTERRUPT (0x01U)
435 #define UART_CONFIG_MODE_USER_INTR (0x02U)
436 #define UART_CONFIG_MODE_DMA (0x03U)
437 
439 #define UART_STATE_RX_DISABLED (0x0U)
440 #define UART_STATE_RX_ENABLED (0x1U)
441 
442 /* ========================================================================== */
443 /* Structures and Enums */
444 /* ========================================================================== */
445 typedef struct UART_ExtendedParams_s
446 {
447  void *args;
450 
455 typedef struct
456 {
457  void *buf;
460  uint32_t count;
464  uint32_t timeout;
466  uint32_t status;
468  void *args;
471 
472 typedef uint32_t (*UART_clockGet) (void);
473 typedef uint32_t (*UART_clockUsecToTick) (uint64_t usecs);
474 
481 typedef void (*UART_readCompCallbackFxn) (void *hUart);
482 
489 typedef void (*UART_writeCompCallbackFxn) (void *hUart);
490 
497 typedef void (*UART_errorCallbackFxn) (void *hUart);
498 
499 /* ========================================================================== */
500 /* Internal/Private Structure Declarations */
501 /* ========================================================================== */
505 typedef struct
506 {
507  /*
508  * SOC configuration
509  */
510  uint32_t inputClkFreq;
512  uint32_t baudRate;
514  uint32_t dataLength;
516  uint32_t stopBits;
518  uint32_t parityType;
520  uint32_t readReturnMode;
522  uint32_t hwFlowControl;
527  /*
528  * Driver configuration
529  */
530  uint32_t transferMode;
532  uint32_t intrNum;
534  uint8_t intrPriority;
537  /*
538  * UART configuration
539  */
540  uint32_t operMode;
542  uint32_t readMode;
544  uint32_t writeMode;
546  uint32_t rxTrigLvl;
548  uint32_t txTrigLvl;
550  uint32_t rxEvtNum;
552  uint32_t txEvtNum;
558  uint32_t timeGuardVal;
559  /* timeguard feature by UART*/
561  /* ClockP_get API */
563  /* clock usec to tick */
571 
575 typedef struct
576 {
577  uint32_t baseAddr;
582  /*
583  * UART write variables
584  */
585  const void *writeBuf;
587  uint32_t writeCount;
592  /*
593  * UART receive variables
594  */
595  void *readBuf;
597  uint32_t readCount;
601  uint32_t rxTimeoutCnt;
603  uint32_t readErrorCnt;
606  /*
607  * UART ransaction status variables
608  */
613  uint32_t currIntMask;
614 
615  /*
616  * State variables
617  */
618  uint32_t state;
625  void* args;
630 
631 /* ========================================================================== */
632 /* Internal/Private Structure Declarations */
633 /* ========================================================================== */
634 
635 /* ========================================================================== */
636 /* Global Variables Declarations */
637 /* ========================================================================== */
638 
639 /* None */
640 
641 /* ========================================================================== */
642 /* Function Declarations */
643 /* ========================================================================== */
644 
645 uint32_t UART_operatingModeSelect(uint32_t baseAddr, uint32_t modeFlag);
646 uint32_t UART_spaceAvail(uint32_t baseAddr);
647 uint32_t UART_IsTxRxFifoEmpty(uint32_t baseAddr);
650 
651 /* ========================================================================== */
652 /* Advanced Function Declarations */
653 /* ========================================================================== */
654 
664 
673 void UART_enableLoopbackMode(uint32_t baseAddr);
674 
683 void UART_disableLoopbackMode(uint32_t baseAddr);
684 
694 
704 
714 
724 
737 int32_t UART_lld_write(UARTLLD_Handle hUart, void * txBuf, uint32_t size, uint32_t timeout,
738  const UART_ExtendedParams *extendedParams);
739 
751 int32_t UART_lld_writeIntr(UARTLLD_Handle hUart, void * txBuf, uint32_t size,
752  const UART_ExtendedParams *extendedParams);
753 
765 int32_t UART_lld_writeDma(UARTLLD_Handle hUart, void * txBuf, uint32_t size,
766  const UART_ExtendedParams *extendedParams);
767 
780 int32_t UART_lld_read(UARTLLD_Handle hUart, void * rxBuf, uint32_t size, uint32_t timeout,
781  const UART_ExtendedParams *extendedParams);
782 
794 int32_t UART_lld_readIntr(UARTLLD_Handle hUart, void * rxBuf, uint32_t size,
795  const UART_ExtendedParams *extendedParams);
796 
808 int32_t UART_lld_readDma(UARTLLD_Handle hUart, void * rxBuf, uint32_t size,
809  const UART_ExtendedParams *extendedParams);
810 
821 
832 
841 
850 
859 int32_t UART_lld_setRxState(UARTLLD_Handle hUart, uint32_t state);
860 
868 
893 void UART_intrDisable(uint32_t baseAddr, uint32_t intrFlag);
894 
912 void UART_intr2Disable(uint32_t baseAddr, uint32_t intrFlag);
913 
928 uint32_t UART_checkCharsAvailInFifo(uint32_t baseAddr);
929 
940 uint32_t UART_readLineStatus(uint32_t baseAddr);
941 
955 uint8_t UART_getCharFifo(uint32_t baseAddr, uint8_t *readBuf);
956 
974 void UART_putChar(uint32_t baseAddr, uint8_t byteTx);
975 
1004 void UART_intrEnable(uint32_t baseAddr, uint32_t intrFlag);
1005 
1020 uint32_t UART_getChar(uint32_t baseAddr, uint8_t *pChar);
1021 
1034 uint32_t UART_getIntr2Status(uint32_t baseAddr);
1035 
1061 uint32_t UART_getIntrIdentityStatus(uint32_t baseAddr);
1062 
1081 void UART_intr2Enable(uint32_t baseAddr, uint32_t intrFlag);
1082 
1090 
1098 
1099 #ifdef __cplusplus
1100 }
1101 #endif
1102 
1103 #endif /* #ifndef UART_V0_LLD_H_ */
1104 
UART_lld_readIntr
int32_t UART_lld_readIntr(UARTLLD_Handle hUart, void *rxBuf, uint32_t size, const UART_ExtendedParams *extendedParams)
This API writes data to the UART instance in Interrupt mode.
UART_writeCancelNoCB
int32_t UART_writeCancelNoCB(UARTLLD_Handle hUart)
UART_lld_read
int32_t UART_lld_read(UARTLLD_Handle hUart, void *rxBuf, uint32_t size, uint32_t timeout, const UART_ExtendedParams *extendedParams)
This API writes data to the UART instance in Polling mode.
UARTLLD_InitObject::operMode
uint32_t operMode
Definition: uart_lld.h:540
args
void * args
Definition: hsmclient_msg.h:4
UART_ExtendedParams
Definition: uart_lld.h:446
UART_readCompCallbackFxn
void(* UART_readCompCallbackFxn)(void *hUart)
The definition of a read complete callback function used by the UART driver when used in UART_TRANSFE...
Definition: uart_lld.h:481
UARTLLD_Object::rxTimeoutCnt
uint32_t rxTimeoutCnt
Definition: uart_lld.h:601
UART_lld_deInit
int32_t UART_lld_deInit(UARTLLD_Handle hUart)
This API De-Initializes the UART instance.
UART_lld_Transaction_init
void UART_lld_Transaction_init(UART_Transaction *trans)
Function to initialize the UART_Transaction struct to its defaults.
UARTLLD_Object::readErrorCnt
uint32_t readErrorCnt
Definition: uart_lld.h:603
UART_readCancelNoCB
int32_t UART_readCancelNoCB(UARTLLD_Handle hUart)
UARTLLD_Object::readSizeRemaining
uint32_t readSizeRemaining
Definition: uart_lld.h:599
UART_lld_readCancel
int32_t UART_lld_readCancel(UARTLLD_Handle hUart, UART_Transaction *trans)
This API cancels current UART Read.
UARTLLD_InitObject::txEvtNum
uint32_t txEvtNum
Definition: uart_lld.h:552
UARTLLD_InitObject::transferMode
uint32_t transferMode
Definition: uart_lld.h:530
UART_readLineStatus
uint32_t UART_readLineStatus(uint32_t baseAddr)
This API reads the line status register value.
UART_lld_writeIntr
int32_t UART_lld_writeIntr(UARTLLD_Handle hUart, void *txBuf, uint32_t size, const UART_ExtendedParams *extendedParams)
This API writes data to the UART instance in Interrupt mode.
UARTLLD_InitObject::writeCompleteCallbackFxn
UART_writeCompCallbackFxn writeCompleteCallbackFxn
Definition: uart_lld.h:566
UART_Transaction::timeout
uint32_t timeout
Definition: uart_lld.h:464
UART_DmaChConfig
void * UART_DmaChConfig
Definition: uart_lld.h:71
UARTLLD_Object::readCount
uint32_t readCount
Definition: uart_lld.h:597
UART_lld_flushTxFifo
int32_t UART_lld_flushTxFifo(UARTLLD_Handle hUart)
Function to flush a TX FIFO of peripheral specified by the UART handle.
UARTLLD_InitObject::dataLength
uint32_t dataLength
Definition: uart_lld.h:514
UARTLLD_InitObject::rxEvtNum
uint32_t rxEvtNum
Definition: uart_lld.h:550
UART_lld_writeDma
int32_t UART_lld_writeDma(UARTLLD_Handle hUart, void *txBuf, uint32_t size, const UART_ExtendedParams *extendedParams)
This API writes data to the UART instance in DMA mode.
UARTLLD_InitObject::baudRate
uint32_t baudRate
Definition: uart_lld.h:512
UARTLLD_Handle
struct UARTLLD_Object * UARTLLD_Handle
UARTLLD_InitObject::uartDmaHandle
UART_DmaHandle uartDmaHandle
Definition: uart_lld.h:554
UARTLLD_InitObject::readCompleteCallbackFxn
UART_readCompCallbackFxn readCompleteCallbackFxn
Definition: uart_lld.h:564
UARTLLD_InitObject::hwFlowControl
uint32_t hwFlowControl
Definition: uart_lld.h:522
UARTLLD_Object::args
void * args
Definition: uart_lld.h:625
UART_lld_deInitDma
int32_t UART_lld_deInitDma(UARTLLD_Handle hUart)
This API De-Initializes the UART instance in DMA mode.
UART_operatingModeSelect
uint32_t UART_operatingModeSelect(uint32_t baseAddr, uint32_t modeFlag)
UART_lld_initDma
int32_t UART_lld_initDma(UARTLLD_Handle hUart)
This API Initializes the UART instance in DMA mode.
UARTLLD_InitObject::clockP_get
UART_clockGet clockP_get
Definition: uart_lld.h:560
UARTLLD_InitObject::clockP_usecToTick
UART_clockUsecToTick clockP_usecToTick
Definition: uart_lld.h:562
UARTLLD_InitObject
UART driver initialization object.
Definition: uart_lld.h:506
UART_Transaction::args
void * args
Definition: uart_lld.h:468
UART_intrEnable
void UART_intrEnable(uint32_t baseAddr, uint32_t intrFlag)
This API enables the specified interrupts in the UART mode of operation.
UART_getIntrIdentityStatus
uint32_t UART_getIntrIdentityStatus(uint32_t baseAddr)
This API determines the UART Interrupt Status.
UART_lld_Transaction_deInit
void UART_lld_Transaction_deInit(UART_Transaction *trans)
Function to de-initialize the UART_Transaction struct to its defaults.
UARTLLD_Object::readTransferMutex
void * readTransferMutex
Definition: uart_lld.h:620
UARTLLD_InitObject::parityType
uint32_t parityType
Definition: uart_lld.h:518
UART_lld_controllerIsr
void UART_lld_controllerIsr(void *args)
This is the UART ISR and can be used as IRQ handler.
UARTLLD_Object
UART driver object.
Definition: uart_lld.h:576
UARTLLD_InitObject::readMode
uint32_t readMode
Definition: uart_lld.h:542
UART_enableLoopbackMode
void UART_enableLoopbackMode(uint32_t baseAddr)
Function to enable loopback mode. This function is for internal use. Not recommended for customers to...
UART_putChar
void UART_putChar(uint32_t baseAddr, uint8_t byteTx)
This API writes a byte to the Transmitter FIFO without checking for the emptiness of the Transmitter ...
UARTLLD_InitObject::hwFlowControlThr
uint32_t hwFlowControlThr
Definition: uart_lld.h:524
UARTLLD_InitObject::stopBits
uint32_t stopBits
Definition: uart_lld.h:516
UART_disableLoopbackMode
void UART_disableLoopbackMode(uint32_t baseAddr)
Function to disable loopback mode. This function is for internal use. Not recommended for customers t...
UARTLLD_InitObject::errorCallbackFxn
UART_errorCallbackFxn errorCallbackFxn
Definition: uart_lld.h:568
UARTLLD_InitObject::timeGuardVal
uint32_t timeGuardVal
Definition: uart_lld.h:558
UARTLLD_InitObject::intrPriority
uint8_t intrPriority
Definition: uart_lld.h:534
UARTLLD_Object::readBuf
void * readBuf
Definition: uart_lld.h:595
UART_getBaseAddr_lld
uint32_t UART_getBaseAddr_lld(UARTLLD_Handle handle)
Function to get base address of UART instance of a particular handle.
UART_errorCallbackFxn
void(* UART_errorCallbackFxn)(void *hUart)
The definition of a error callback function used by the UART driver when used in UART_TRANSFER_MODE_C...
Definition: uart_lld.h:497
UART_lld_setRxState
int32_t UART_lld_setRxState(UARTLLD_Handle hUart, uint32_t state)
Function to enable/disable UART RX.
UART_lld_init
int32_t UART_lld_init(UARTLLD_Handle hUart)
This API Initializes the UART instance.
UARTLLD_InitObject::writeMode
uint32_t writeMode
Definition: uart_lld.h:544
UARTLLD_InitObject::dmaChCfg
UART_DmaChConfig dmaChCfg
Definition: uart_lld.h:556
UART_Transaction::status
uint32_t status
Definition: uart_lld.h:466
UART_Transaction
Data structure used with UART_read() and UART_write()
Definition: uart_lld.h:456
UARTLLD_Object::currIntMask
uint32_t currIntMask
Definition: uart_lld.h:613
UART_lld_write
int32_t UART_lld_write(UARTLLD_Handle hUart, void *txBuf, uint32_t size, uint32_t timeout, const UART_ExtendedParams *extendedParams)
This API writes data to the UART instance in Polling mode.
UART_getIntr2Status
uint32_t UART_getIntr2Status(uint32_t baseAddr)
This API determines the UART Interrupt Status 2.
UART_intr2Disable
void UART_intr2Disable(uint32_t baseAddr, uint32_t intrFlag)
This API disables the specified interrupts in the UART mode of operation for IER2.
UARTLLD_Object::writeSizeRemaining
uint32_t writeSizeRemaining
Definition: uart_lld.h:589
UART_IsTxRxFifoEmpty
uint32_t UART_IsTxRxFifoEmpty(uint32_t baseAddr)
UARTLLD_Object::hUartInit
UARTLLD_InitHandle hUartInit
Definition: uart_lld.h:579
UART_getChar
uint32_t UART_getChar(uint32_t baseAddr, uint8_t *pChar)
This API reads a byte from the Receiver Buffer Register (RBR). It checks once if any character is rea...
UARTLLD_Object::writeTransferMutex
void * writeTransferMutex
Definition: uart_lld.h:622
UART_writeCompCallbackFxn
void(* UART_writeCompCallbackFxn)(void *hUart)
The definition of a write complete callback function used by the UART driver when used in UART_TRANSF...
Definition: uart_lld.h:489
UARTLLD_Object::state
uint32_t state
Definition: uart_lld.h:618
UART_DmaHandle
void * UART_DmaHandle
A handle that is returned from a UART_open() call.
Definition: uart_lld.h:69
UARTLLD_InitObject::inputClkFreq
uint32_t inputClkFreq
Definition: uart_lld.h:510
UART_intr2Enable
void UART_intr2Enable(uint32_t baseAddr, uint32_t intrFlag)
This API enables the specified interrupts in the UART mode of operation for IER2.
UART_checkCharsAvailInFifo
uint32_t UART_checkCharsAvailInFifo(uint32_t baseAddr)
This API checks if the RX FIFO (or RHR in non-FIFO mode) has atleast one byte of data to be read.
UARTLLD_InitObject::intrNum
uint32_t intrNum
Definition: uart_lld.h:532
UARTLLD_Object::writeBuf
const void * writeBuf
Definition: uart_lld.h:585
UARTLLD_Object::readTrans
UART_Transaction readTrans
Definition: uart_lld.h:609
UART_lld_readDma
int32_t UART_lld_readDma(UARTLLD_Handle hUart, void *rxBuf, uint32_t size, const UART_ExtendedParams *extendedParams)
This API writes data to the UART instance in DMA mode.
UART_spaceAvail
uint32_t UART_spaceAvail(uint32_t baseAddr)
UART_getCharFifo
uint8_t UART_getCharFifo(uint32_t baseAddr, uint8_t *readBuf)
This API reads the data present at the top of the RX FIFO, that is, the data in the Receive Holding R...
UARTLLD_InitObject::txTrigLvl
uint32_t txTrigLvl
Definition: uart_lld.h:548
UARTLLD_InitHandle
struct UARTLLD_InitObject * UARTLLD_InitHandle
UART_lld_writeCancel
int32_t UART_lld_writeCancel(UARTLLD_Handle hUart, UART_Transaction *trans)
This API cancels current UART Write.
UART_intrDisable
void UART_intrDisable(uint32_t baseAddr, uint32_t intrFlag)
This API disables the specified interrupts in the UART mode of operation.
UARTLLD_InitObject::readReturnMode
uint32_t readReturnMode
Definition: uart_lld.h:520
UART_Transaction::buf
void * buf
Definition: uart_lld.h:457
UARTLLD_Object::writeCount
uint32_t writeCount
Definition: uart_lld.h:587
UARTLLD_Object::writeTrans
UART_Transaction writeTrans
Definition: uart_lld.h:611
UART_clockGet
uint32_t(* UART_clockGet)(void)
Definition: uart_lld.h:472
UART_clockUsecToTick
uint32_t(* UART_clockUsecToTick)(uint64_t usecs)
Definition: uart_lld.h:473
UARTLLD_InitObject::rxTrigLvl
uint32_t rxTrigLvl
Definition: uart_lld.h:546
UARTLLD_Object::lineStatusTimeout
uint64_t lineStatusTimeout
Definition: uart_lld.h:627
UART_Transaction::count
uint32_t count
Definition: uart_lld.h:460
UARTLLD_Object::baseAddr
uint32_t baseAddr
Definition: uart_lld.h:577
UART_ExtendedParams::args
void * args
Definition: uart_lld.h:447
UART_procLineStatusErr
int32_t UART_procLineStatusErr(UARTLLD_Handle hUart)
Function to check various error conditions in uart.