AM64x MCU+ SDK  10.00.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 #define UART_CONFIG_MODE_POLLED_WITH_COUNTER (0x04U)
438 
440 #define UART_STATE_RX_DISABLED (0x0U)
441 #define UART_STATE_RX_ENABLED (0x1U)
442 
443 /* ========================================================================== */
444 /* Structures and Enums */
445 /* ========================================================================== */
446 typedef struct UART_ExtendedParams_s
447 {
448  void *args;
451 
456 typedef struct
457 {
458  void *buf;
461  uint32_t count;
465  uint32_t timeout;
467  uint32_t status;
469  void *args;
472 
473 typedef uint32_t (*UART_clockGet) (void);
474 typedef uint32_t (*UART_clockUsecToTick) (uint64_t usecs);
475 
482 typedef void (*UART_readCompCallbackFxn) (void *hUart);
483 
490 typedef void (*UART_writeCompCallbackFxn) (void *hUart);
491 
498 typedef void (*UART_errorCallbackFxn) (void *hUart);
499 
500 /* ========================================================================== */
501 /* Internal/Private Structure Declarations */
502 /* ========================================================================== */
506 typedef struct
507 {
508  /*
509  * SOC configuration
510  */
511  uint32_t inputClkFreq;
513  uint32_t baudRate;
515  uint32_t dataLength;
517  uint32_t stopBits;
519  uint32_t parityType;
521  uint32_t readReturnMode;
523  uint32_t hwFlowControl;
528  /*
529  * Driver configuration
530  */
531  uint32_t transferMode;
533  uint32_t intrNum;
535  uint8_t intrPriority;
538  /*
539  * UART configuration
540  */
541  uint32_t operMode;
543  uint32_t readMode;
545  uint32_t writeMode;
547  uint32_t rxTrigLvl;
549  uint32_t txTrigLvl;
551  uint32_t rxEvtNum;
553  uint32_t txEvtNum;
559  uint32_t timeGuardVal;
560  /* timeguard feature by UART*/
562  /* ClockP_get API */
564  /* clock usec to tick */
572 
576 typedef struct
577 {
578  uint32_t baseAddr;
583  /*
584  * UART write variables
585  */
586  const void *writeBuf;
588  uint32_t writeCount;
593  /*
594  * UART receive variables
595  */
596  void *readBuf;
598  uint32_t readCount;
602  uint32_t rxTimeoutCnt;
604  uint32_t readErrorCnt;
607  /*
608  * UART ransaction status variables
609  */
614  uint32_t currIntMask;
615 
616  /*
617  * State variables
618  */
619  uint32_t state;
626  void* args;
631 
632 /* ========================================================================== */
633 /* Internal/Private Structure Declarations */
634 /* ========================================================================== */
635 
636 /* ========================================================================== */
637 /* Global Variables Declarations */
638 /* ========================================================================== */
639 
640 /* None */
641 
642 /* ========================================================================== */
643 /* Function Declarations */
644 /* ========================================================================== */
645 
646 uint32_t UART_operatingModeSelect(uint32_t baseAddr, uint32_t modeFlag);
647 uint32_t UART_spaceAvail(uint32_t baseAddr);
648 uint32_t UART_IsTxRxFifoEmpty(uint32_t baseAddr);
651 
652 /* ========================================================================== */
653 /* Advanced Function Declarations */
654 /* ========================================================================== */
655 
665 
674 void UART_enableLoopbackMode(uint32_t baseAddr);
675 
684 void UART_disableLoopbackMode(uint32_t baseAddr);
685 
695 
705 
715 
725 
738 int32_t UART_lld_write(UARTLLD_Handle hUart, void * txBuf, uint32_t size, uint32_t timeout,
739  const UART_ExtendedParams *extendedParams);
740 
752 int32_t UART_lld_writeIntr(UARTLLD_Handle hUart, void * txBuf, uint32_t size,
753  const UART_ExtendedParams *extendedParams);
754 
766 int32_t UART_lld_writeDma(UARTLLD_Handle hUart, void * txBuf, uint32_t size,
767  const UART_ExtendedParams *extendedParams);
768 
781 int32_t UART_lld_read(UARTLLD_Handle hUart, void * rxBuf, uint32_t size, uint32_t timeout,
782  const UART_ExtendedParams *extendedParams);
783 
796 int32_t UART_lld_readWithCounter(UARTLLD_Handle hUart, void * rxBuf, uint32_t size, uint32_t timeout,
797  const UART_ExtendedParams *extendedParams);
798 
810 int32_t UART_lld_readIntr(UARTLLD_Handle hUart, void * rxBuf, uint32_t size,
811  const UART_ExtendedParams *extendedParams);
812 
824 int32_t UART_lld_readDma(UARTLLD_Handle hUart, void * rxBuf, uint32_t size,
825  const UART_ExtendedParams *extendedParams);
826 
837 
848 
857 
866 
875 int32_t UART_lld_setRxState(UARTLLD_Handle hUart, uint32_t state);
876 
883 void UART_lld_controllerIsr(void* args);
884 
909 void UART_intrDisable(uint32_t baseAddr, uint32_t intrFlag);
910 
928 void UART_intr2Disable(uint32_t baseAddr, uint32_t intrFlag);
929 
944 uint32_t UART_checkCharsAvailInFifo(uint32_t baseAddr);
945 
956 uint32_t UART_readLineStatus(uint32_t baseAddr);
957 
971 uint8_t UART_getCharFifo(uint32_t baseAddr, uint8_t *readBuf);
972 
990 void UART_putChar(uint32_t baseAddr, uint8_t byteTx);
991 
1020 void UART_intrEnable(uint32_t baseAddr, uint32_t intrFlag);
1021 
1036 uint32_t UART_getChar(uint32_t baseAddr, uint8_t *pChar);
1037 
1050 uint32_t UART_getIntr2Status(uint32_t baseAddr);
1051 
1077 uint32_t UART_getIntrIdentityStatus(uint32_t baseAddr);
1078 
1097 void UART_intr2Enable(uint32_t baseAddr, uint32_t intrFlag);
1098 
1106 
1114 
1115 #ifdef __cplusplus
1116 }
1117 #endif
1118 
1119 #endif /* #ifndef UART_V0_LLD_H_ */
1120 
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:541
UART_ExtendedParams
Definition: uart_lld.h:447
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:482
UARTLLD_Object::rxTimeoutCnt
uint32_t rxTimeoutCnt
Definition: uart_lld.h:602
UART_lld_deInit
int32_t UART_lld_deInit(UARTLLD_Handle hUart)
This API De-Initializes the UART instance.
size
uint16_t size
Definition: tisci_boardcfg.h:1
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:604
UART_readCancelNoCB
int32_t UART_readCancelNoCB(UARTLLD_Handle hUart)
UARTLLD_Object::readSizeRemaining
uint32_t readSizeRemaining
Definition: uart_lld.h:600
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:553
UARTLLD_InitObject::transferMode
uint32_t transferMode
Definition: uart_lld.h:531
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:567
UART_Transaction::timeout
uint32_t timeout
Definition: uart_lld.h:465
UART_DmaChConfig
void * UART_DmaChConfig
Definition: uart_lld.h:71
UARTLLD_Object::readCount
uint32_t readCount
Definition: uart_lld.h:598
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:515
UARTLLD_InitObject::rxEvtNum
uint32_t rxEvtNum
Definition: uart_lld.h:551
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:513
UARTLLD_Handle
struct UARTLLD_Object * UARTLLD_Handle
UARTLLD_InitObject::uartDmaHandle
UART_DmaHandle uartDmaHandle
Definition: uart_lld.h:555
UARTLLD_InitObject::readCompleteCallbackFxn
UART_readCompCallbackFxn readCompleteCallbackFxn
Definition: uart_lld.h:565
UARTLLD_InitObject::hwFlowControl
uint32_t hwFlowControl
Definition: uart_lld.h:523
UARTLLD_Object::args
void * args
Definition: uart_lld.h:626
state
uint8_t state
Definition: tisci_pm_clock.h:3
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:561
UARTLLD_InitObject::clockP_usecToTick
UART_clockUsecToTick clockP_usecToTick
Definition: uart_lld.h:563
UARTLLD_InitObject
UART driver initialization object.
Definition: uart_lld.h:507
UART_Transaction::args
void * args
Definition: uart_lld.h:469
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:621
UARTLLD_InitObject::parityType
uint32_t parityType
Definition: uart_lld.h:519
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:577
UARTLLD_InitObject::readMode
uint32_t readMode
Definition: uart_lld.h:543
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:525
UARTLLD_InitObject::stopBits
uint32_t stopBits
Definition: uart_lld.h:517
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:569
UARTLLD_InitObject::timeGuardVal
uint32_t timeGuardVal
Definition: uart_lld.h:559
UARTLLD_InitObject::intrPriority
uint8_t intrPriority
Definition: uart_lld.h:535
UARTLLD_Object::readBuf
void * readBuf
Definition: uart_lld.h:596
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:498
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:545
UARTLLD_InitObject::dmaChCfg
UART_DmaChConfig dmaChCfg
Definition: uart_lld.h:557
UART_Transaction::status
uint32_t status
Definition: uart_lld.h:467
UART_Transaction
Data structure used with UART_read() and UART_write()
Definition: uart_lld.h:457
UARTLLD_Object::currIntMask
uint32_t currIntMask
Definition: uart_lld.h:614
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:590
UART_IsTxRxFifoEmpty
uint32_t UART_IsTxRxFifoEmpty(uint32_t baseAddr)
UARTLLD_Object::hUartInit
UARTLLD_InitHandle hUartInit
Definition: uart_lld.h:580
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:623
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:490
UARTLLD_Object::state
uint32_t state
Definition: uart_lld.h:619
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:511
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:533
UARTLLD_Object::writeBuf
const void * writeBuf
Definition: uart_lld.h:586
UARTLLD_Object::readTrans
UART_Transaction readTrans
Definition: uart_lld.h:610
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:549
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_lld_readWithCounter
int32_t UART_lld_readWithCounter(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.
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:521
UART_Transaction::buf
void * buf
Definition: uart_lld.h:458
UARTLLD_Object::writeCount
uint32_t writeCount
Definition: uart_lld.h:588
UARTLLD_Object::writeTrans
UART_Transaction writeTrans
Definition: uart_lld.h:612
UART_clockGet
uint32_t(* UART_clockGet)(void)
Definition: uart_lld.h:473
UART_clockUsecToTick
uint32_t(* UART_clockUsecToTick)(uint64_t usecs)
Definition: uart_lld.h:474
UARTLLD_InitObject::rxTrigLvl
uint32_t rxTrigLvl
Definition: uart_lld.h:547
UARTLLD_Object::lineStatusTimeout
uint64_t lineStatusTimeout
Definition: uart_lld.h:628
UART_Transaction::count
uint32_t count
Definition: uart_lld.h:461
UARTLLD_Object::baseAddr
uint32_t baseAddr
Definition: uart_lld.h:578
UART_ExtendedParams::args
void * args
Definition: uart_lld.h:448
UART_procLineStatusErr
int32_t UART_procLineStatusErr(UARTLLD_Handle hUart)
Function to check various error conditions in uart.