AM263Px MCU+ SDK: uart_lld.h Source File

| AM263Px MCU+ SDK 26.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 #include <drivers/uart/v0/lld/dma/uart_dma.h>
60
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64
65 /* ========================================================================== */
66 /* Macros & Typedefs */
67 /* ========================================================================== */
68
70 #define UART_FIFO_SIZE (64U)
71
77 #define UART_TRANSMITEMPTY_TRIALCOUNT (3000U)
78
80 #define UART_ERROR_COUNT (0x00FFFFFFU)
81
91 #define UART_STATUS_SUCCESS ((int32_t)0)
92
93 #define UART_STATUS_FAILURE ((int32_t)-1)
94
95 #define UART_TRANSFER_STATUS_SUCCESS ((int32_t)0)
96
97 #define UART_TRANSFER_STATUS_FAILURE ((int32_t)-1)
98
103 #define UART_WAIT_FOREVER ((int32_t)-1)
104
107 #define UART_INVALID_PARAM ((int32_t)-3)
108
112 #define UART_TRANSFER_BUSY ((int32_t)-4)
113
118 #define UART_TRANSFER_TIMEOUT ((int32_t)-2)
119
124 #define UART_TRANSFER_INVALID_STATE ((int32_t)-5)
125
126 #define UART_TRANSFER_STATUS_TIMEOUT (1U)
127
128 #define UART_TRANSFER_STATUS_ERROR_BI (2U)
129
130 #define UART_TRANSFER_STATUS_ERROR_FE (3U)
131
132 #define UART_TRANSFER_STATUS_ERROR_PE (4U)
133
134 #define UART_TRANSFER_STATUS_ERROR_OE (5U)
135
136 #define UART_TRANSFER_STATUS_CANCELLED (6U)
137
138 #define UART_TRANSFER_STATUS_STARTED (7U)
139
140 #define UART_TRANSFER_STATUS_READ_TIMEOUT (8U)
141
142 #define UART_TRANSFER_STATUS_ERROR_INUSE (9U)
143
144 #define UART_TRANSFER_STATUS_ERROR_OTH (10U)
145
167 #define UART_READ_RETURN_MODE_FULL (0U)
168
171 #define UART_READ_RETURN_MODE_PARTIAL (1U)
172
182 #define UART_LEN_5 (0U)
183 #define UART_LEN_6 (1U)
184 #define UART_LEN_7 (2U)
185 #define UART_LEN_8 (3U)
186
196 #define UART_STATE_RESET (0U)
197 #define UART_STATE_READY (1U)
198 #define UART_STATE_BUSY (2U)
199 #define UART_STATE_ERROR (3U)
200
205 #define UART_NOT_IN_USE(x) (void) 0
206
214 #define UART_STOPBITS_1 (0U)
215 #define UART_STOPBITS_2 (1U)
216 #define UART_STOPBITS_1P5 (UART_STOPBITS_1)
217
227 #define UART_PARITY_NONE (0x00U)
228 #define UART_PARITY_ODD (0x01U)
229 #define UART_PARITY_EVEN (0x03U)
230 #define UART_PARITY_FORCED0 (0x07U)
231 #define UART_PARITY_FORCED1 (0x05U)
232
242 #define UART_FCTYPE_NONE (0x00U)
243 #define UART_FCTYPE_HW (0x02U)
244
254 #define UART_FCPARAM_RXNONE (0x00U)
255 #define UART_FCPARAM_RXXONXOFF_2 (0x01U)
256 #define UART_FCPARAM_RXXONXOFF_1 (0x02U)
257 #define UART_FCPARAM_RXXONXOFF_12 (0x03U)
258 #define UART_FCPARAM_AUTO_RTS (0x40U)
259
269 #define UART_FCPARAM_TXNONE (0x00U)
270 #define UART_FCPARAM_TXXONXOFF_2 (0x04U)
271 #define UART_FCPARAM_TXXONXOFF_1 (0x08U)
272 #define UART_FCPARAM_TXXONXOFF_12 (0x0CU)
273 #define UART_FCPARAM_AUTO_CTS (0x80U)
274
284 #define UART_RXTRIGLVL_1 (1U)
285 #define UART_RXTRIGLVL_8 (8U)
286 #define UART_RXTRIGLVL_16 (16U)
287 #define UART_RXTRIGLVL_56 (56U)
288 #define UART_RXTRIGLVL_60 (60U)
289
299 #define UART_TXTRIGLVL_1 (1U)
300 #define UART_TXTRIGLVL_8 (8U)
301 #define UART_TXTRIGLVL_16 (16U)
302 #define UART_TXTRIGLVL_32 (32U)
303 #define UART_TXTRIGLVL_56 (56U)
304
314 #define UART_OPER_MODE_16X (0U)
315 #define UART_OPER_MODE_SIR (1U)
316 #define UART_OPER_MODE_16X_AUTO_BAUD (2U)
317 #define UART_OPER_MODE_13X (3U)
318 #define UART_OPER_MODE_MIR (4U)
319 #define UART_OPER_MODE_FIR (5U)
320 #define UART_OPER_MODE_CIR (6U)
321 #define UART_OPER_MODE_DISABLED (7U)
322
333 #define UART_TX_FIFO_NOT_FULL ( \
334 UART_SSR_TX_FIFO_FULL_TX_FIFO_FULL_VALUE_0)
335 #define UART_TX_FIFO_FULL ( \
336 UART_SSR_TX_FIFO_FULL_TX_FIFO_FULL_VALUE_1)
337
347 #define UART_INTID_MODEM_STAT (UART_IIR_IT_TYPE_IT_TYPE_VALUE_0 \
348 << \
349 UART_IIR_IT_TYPE_SHIFT)
350 #define UART_INTID_TX_THRES_REACH (UART_IIR_IT_TYPE_IT_TYPE_VALUE_1 \
351 << \
352 UART_IIR_IT_TYPE_SHIFT)
353 #define UART_INTID_RX_THRES_REACH (UART_IIR_IT_TYPE_IT_TYPE_VALUE_2 \
354 << \
355 UART_IIR_IT_TYPE_SHIFT)
356 #define UART_INTID_RX_LINE_STAT_ERROR (UART_IIR_IT_TYPE_IT_TYPE_VALUE_3 \
357 << \
358 UART_IIR_IT_TYPE_SHIFT)
359 #define UART_INTID_CHAR_TIMEOUT (UART_IIR_IT_TYPE_IT_TYPE_VALUE_6 \
360 << \
361 UART_IIR_IT_TYPE_SHIFT)
362 #define UART_INTID_XOFF_SPEC_CHAR_DETECT (UART_IIR_IT_TYPE_IT_TYPE_VALUE_8 \
363 << \
364 UART_IIR_IT_TYPE_SHIFT)
365 #define UART_INTID_MODEM_SIG_STATE_CHANGE (UART_IIR_IT_TYPE_IT_TYPE_VALUE_10 \
366 << \
367 UART_IIR_IT_TYPE_SHIFT)
368
370 #define UART_INTR_PENDING (0U)
371 #define UART_N0_INTR_PENDING (1U)
372
381 #define UART_INTR_CTS (UART_IER_CTS_IT_MASK)
382 #define UART_INTR_RTS (UART_IER_RTS_IT_MASK)
383 #define UART_INTR_XOFF (UART_IER_XOFF_IT_MASK)
384 #define UART_INTR_SLEEPMODE (UART_IER_SLEEP_MODE_MASK)
385 #define UART_INTR_MODEM_STAT (UART_IER_MODEM_STS_IT_MASK)
386 #define UART_INTR_LINE_STAT (UART_IER_LINE_STS_IT_MASK)
387 #define UART_INTR_THR (UART_IER_THR_IT_MASK)
388 #define UART_INTR_RHR_CTI (UART_IER_RHR_IT_MASK)
389
390 #define UART_INTR2_RX_EMPTY (UART_IER2_EN_RXFIFO_EMPTY_MASK)
391 #define UART_INTR2_TX_EMPTY (UART_IER2_EN_TXFIFO_EMPTY_MASK)
392
401 #define UART_FIFO_PE_FE_BI_DETECTED (UART_LSR_RX_FIFO_STS_MASK)
402 #define UART_BREAK_DETECTED_ERROR (UART_LSR_RX_BI_MASK)
403 #define UART_FRAMING_ERROR (UART_LSR_RX_FE_MASK)
404 #define UART_PARITY_ERROR (UART_LSR_RX_PE_MASK)
405 #define UART_OVERRUN_ERROR (UART_LSR_RX_OE_MASK)
406
415 #define UART_REG_CONFIG_MODE_A ((uint32_t) 0x0080)
416 #define UART_REG_CONFIG_MODE_B ((uint32_t) 0x00BF)
417 #define UART_REG_OPERATIONAL_MODE ((uint32_t) 0x007F)
418
429 #define UART_CONFIG_MODE_POLLED (0x00U)
430 #define UART_CONFIG_MODE_INTERRUPT (0x01U)
431 #define UART_CONFIG_MODE_USER_INTR (0x02U)
432 #define UART_CONFIG_MODE_DMA (0x03U)
433 #define UART_CONFIG_MODE_POLLED_WITH_COUNTER (0x04U)
434
436 #define UART_STATE_RX_DISABLED (0x0U)
437 #define UART_STATE_RX_ENABLED (0x1U)
438
439 /* ========================================================================== */
440 /* Structures and Enums */
441 /* ========================================================================== */
442
443 struct UARTLLD_Object_s;
444 struct UART_Config_s;
445
446 typedef struct UART_ExtendedParams_s
447 {
448 uint32_t *args;
450 } UART_ExtendedParams;
451
456 typedef struct
457 {
458 void *buf;
461 uint32_t count;
465 uint32_t timeout;
467 int32_t status;
469 uint32_t *args;
471 } UART_Transaction;
472
473 typedef uint32_t (*UART_clockGet) (void);
474 typedef uint32_t (*UART_clockUsecToTick) (uint64_t usecs);
475
482 typedef void (*UART_readCompCallbackFxn) (struct UARTLLD_Object_s *args);
483
490 typedef void (*UART_writeCompCallbackFxn) (struct UARTLLD_Object_s *args);
491
492
493 /* ========================================================================== */
494 /* Internal/Private Structure Declarations */
495 /* ========================================================================== */
499 typedef struct
500 {
501 /*
502 * SOC configuration
503 */
504 uint32_t inputClkFreq;
506 uint32_t baudRate;
508 uint32_t dataLength;
510 uint32_t stopBits;
512 uint32_t parityType;
514 uint32_t readReturnMode;
516 uint32_t hwFlowControl;
518 uint32_t hwFlowControlThr;
521 /*
522 * Driver configuration
523 */
524 uint32_t transferMode;
526 uint32_t intrNum;
528 uint8_t intrPriority;
531 /*
532 * UART configuration
533 */
534 uint32_t operMode;
536 uint32_t readMode;
538 uint32_t writeMode;
540 uint32_t rxTrigLvl;
542 uint32_t txTrigLvl;
544 uint32_t rxEvtNum;
546 uint32_t txEvtNum;
548 UART_DmaHandle uartDmaHandle;
550 UART_DmaChConfig dmaChCfg;
552 uint32_t timeGuardVal;
553 /* timeguard feature by UART*/
554 UART_clockGet clockP_get;
555 /* ClockP_get API */
556 UART_clockUsecToTick clockP_usecToTick;
557 /* clock usec to tick */
558 UART_readCompCallbackFxn readCompleteCallbackFxn;
560 UART_writeCompCallbackFxn writeCompleteCallbackFxn;
562 } UARTLLD_InitObject, *UARTLLD_InitHandle;
563
567 typedef struct UARTLLD_Object_s
568 {
569 uint32_t baseAddr;
571 UARTLLD_InitHandle hUartInit;
574 /*
575 * UART write variables
576 */
577 const uint8_t *writeBuf;
579 uint32_t writeCount;
581 uint32_t writeSizeRemaining;
584 /*
585 * UART receive variables
586 */
587 uint8_t *readBuf;
589 uint32_t readCount;
591 uint32_t readSizeRemaining;
593 uint32_t rxTimeoutCnt;
595 uint32_t readErrorCnt;
598 /*
599 * UART ransaction status variables
600 */
601 UART_Transaction readTrans;
603 UART_Transaction writeTrans;
605 uint32_t currIntMask;
606
607 /*
608 * State variables
609 */
610 uint32_t state;
612 void *readTransferMutex;
614 void *writeTransferMutex;
617 struct UART_Config_s *args;
619 uint64_t lineStatusTimeout;
621 } UARTLLD_Object, *UARTLLD_Handle;
622
623 /* ========================================================================== */
624 /* Internal/Private Structure Declarations */
625 /* ========================================================================== */
626
627 /* ========================================================================== */
628 /* Global Variables Declarations */
629 /* ========================================================================== */
630
631 /* None */
632
633 /* ========================================================================== */
634 /* Function Declarations */
635 /* ========================================================================== */
636
637 uint32_t UART_operatingModeSelect(uint32_t baseAddr, uint32_t modeFlag);
638 uint32_t UART_spaceAvail(uint32_t baseAddr);
639 uint32_t UART_IsTxRxFifoEmpty(uint32_t baseAddr);
640 int32_t UART_writeCancelNoCB(UARTLLD_Handle hUart);
641 int32_t UART_readCancelNoCB(UARTLLD_Handle hUart);
642
643 /* ========================================================================== */
644 /* Advanced Function Declarations */
645 /* ========================================================================== */
646
655 uint32_t UART_getBaseAddr_lld(UARTLLD_Handle handle);
656
665 void UART_enableLoopbackMode(uint32_t baseAddr);
666
675 void UART_disableLoopbackMode(uint32_t baseAddr);
676
685 int32_t UART_lld_init(UARTLLD_Handle hUart);
686
695 int32_t UART_lld_initDma(UARTLLD_Handle hUart);
696
705 int32_t UART_lld_deInit(UARTLLD_Handle hUart);
706
715 int32_t UART_lld_deInitDma(UARTLLD_Handle hUart);
716
729 int32_t UART_lld_write(UARTLLD_Handle hUart, void * txBuf, uint32_t size, uint32_t timeout,
730 const UART_ExtendedParams *extendedParams);
731
743 int32_t UART_lld_writeIntr(UARTLLD_Handle hUart, void * txBuf, uint32_t size,
744 const UART_ExtendedParams *extendedParams);
745
757 int32_t UART_lld_writeDma(UARTLLD_Handle hUart, void * txBuf, uint32_t size,
758 const UART_ExtendedParams *extendedParams);
759
772 int32_t UART_lld_read(UARTLLD_Handle hUart, void * rxBuf, uint32_t size, uint32_t timeout,
773 const UART_ExtendedParams *extendedParams);
774
787 int32_t UART_lld_readWithCounter(UARTLLD_Handle hUart, void * rxBuf, uint32_t size, uint32_t timeout,
788 const UART_ExtendedParams *extendedParams);
789
801 int32_t UART_lld_readIntr(UARTLLD_Handle hUart, void * rxBuf, uint32_t size,
802 const UART_ExtendedParams *extendedParams);
803
815 int32_t UART_lld_readDma(UARTLLD_Handle hUart, void * rxBuf, uint32_t size,
816 const UART_ExtendedParams *extendedParams);
817
827 int32_t UART_lld_writeCancel(UARTLLD_Handle hUart, UART_Transaction *trans);
828
838 int32_t UART_lld_readCancel(UARTLLD_Handle hUart, UART_Transaction *trans);
839
847 int32_t UART_lld_flushTxFifo(UARTLLD_Handle hUart);
848
856 int32_t UART_procLineStatusErr(UARTLLD_Handle hUart);
857
866 int32_t UART_lld_setRxState(UARTLLD_Handle hUart, uint32_t state);
867
874 void UART_lld_controllerIsr(void* args);
875
900 void UART_intrDisable(uint32_t baseAddr, uint32_t intrFlag);
901
919 void UART_intr2Disable(uint32_t baseAddr, uint32_t intrFlag);
920
935 uint32_t UART_checkCharsAvailInFifo(uint32_t baseAddr);
936
947 uint32_t UART_readLineStatus(uint32_t baseAddr);
948
962 uint8_t UART_getCharFifo(uint32_t baseAddr, uint8_t *readBuf);
963
981 void UART_putChar(uint32_t baseAddr, uint8_t byteTx);
982
1011 void UART_intrEnable(uint32_t baseAddr, uint32_t intrFlag);
1012
1027 uint32_t UART_getChar(uint32_t baseAddr, uint8_t *pChar);
1028
1041 uint32_t UART_getIntr2Status(uint32_t baseAddr);
1042
1068 uint32_t UART_getIntrIdentityStatus(uint32_t baseAddr);
1069
1088 void UART_intr2Enable(uint32_t baseAddr, uint32_t intrFlag);
1089
1096 void UART_lld_Transaction_init(UART_Transaction *trans);
1097
1104 void UART_lld_Transaction_deInit(UART_Transaction *trans);
1105
1125 int32_t UART_lld_dmaInit(UARTLLD_Handle hUart, UART_DmaChConfig dmaChCfg);
1126
1134 int32_t UART_lld_dmaDeInit(UARTLLD_Handle hUart);
1135
1144 int32_t UART_lld_dmaWrite(UARTLLD_Handle hUart, const UART_Transaction *transaction);
1145
1154 int32_t UART_lld_dmaRead(UARTLLD_Handle hUart, const UART_Transaction *transaction);
1155
1164 int32_t UART_lld_dmaDisableChannel(UARTLLD_Handle hUart,
1165 uint32_t isChannelTx);
1168 #ifdef __cplusplus
1169 }
1170 #endif
1171
1172 #endif /* #ifndef UART_LLD_H_ */
1173
UART_lld_readIntr
int32_t UART_lld_readIntr(UARTLLD_Handle hUart, void *rxBuf, uint32_t size, const UART_ExtendedParams *extendedParams)
This API reads data from the UART instance in Interrupt mode.
UART_writeCancelNoCB
int32_t UART_writeCancelNoCB(UARTLLD_Handle hUart)
EDMA_Config
EDMA Instance Configuration. Pointer to this object is returned as handle by driver open.
Definition: edma/v0/edma.h:675
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 reads data from the UART instance in Polling mode.
UARTLLD_InitObject::operMode
uint32_t operMode
Definition: uart_lld.h:534
args
void * args
Definition: hsmclient_msg.h:4
UART_ExtendedParams
Definition: uart_lld.h:447
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.
UART_readCancelNoCB
int32_t UART_readCancelNoCB(UARTLLD_Handle hUart)
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:546
UARTLLD_Object::hUartInit
UARTLLD_InitHandle hUartInit
Definition: uart_lld.h:571
UARTLLD_InitObject::transferMode
uint32_t transferMode
Definition: uart_lld.h:524
UART_readLineStatus
uint32_t UART_readLineStatus(uint32_t baseAddr)
This API reads the line status register value.
UART_lld_dmaDisableChannel
int32_t UART_lld_dmaDisableChannel(UARTLLD_Handle hUart, uint32_t isChannelTx)
API to disable DMA channel.
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:560
UART_Transaction::timeout
uint32_t timeout
Definition: uart_lld.h:465
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:508
UARTLLD_Object::writeBuf
const uint8_t * writeBuf
Definition: uart_lld.h:577
UARTLLD_InitObject::rxEvtNum
uint32_t rxEvtNum
Definition: uart_lld.h:544
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:506
UARTLLD_InitObject::uartDmaHandle
UART_DmaHandle uartDmaHandle
Definition: uart_lld.h:548
UARTLLD_InitObject::readCompleteCallbackFxn
UART_readCompCallbackFxn readCompleteCallbackFxn
Definition: uart_lld.h:558
UARTLLD_InitObject::hwFlowControl
uint32_t hwFlowControl
Definition: uart_lld.h:516
UART_lld_dmaWrite
int32_t UART_lld_dmaWrite(UARTLLD_Handle hUart, const UART_Transaction *transaction)
API to write data using an UART DMA channel.
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:554
UARTLLD_InitObject::clockP_usecToTick
UART_clockUsecToTick clockP_usecToTick
Definition: uart_lld.h:556
UARTLLD_Object::writeSizeRemaining
uint32_t writeSizeRemaining
Definition: uart_lld.h:581
UARTLLD_InitObject
UART driver initialization object.
Definition: uart_lld.h:500
UARTLLD_Object::readSizeRemaining
uint32_t readSizeRemaining
Definition: uart_lld.h:591
UART_DmaChConfig
struct UART_EdmaChConfig_s * UART_DmaChConfig
Definition: uart_dma_edma.h:90
UART_intrEnable
void UART_intrEnable(uint32_t baseAddr, uint32_t intrFlag)
This API enables the specified interrupts in the UART mode of operation.
UARTLLD_Object::lineStatusTimeout
uint64_t lineStatusTimeout
Definition: uart_lld.h:619
UART_Transaction::status
int32_t status
Definition: uart_lld.h:467
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::state
uint32_t state
Definition: uart_lld.h:610
UARTLLD_InitObject::parityType
uint32_t parityType
Definition: uart_lld.h:512
UARTLLD_Object::currIntMask
uint32_t currIntMask
Definition: uart_lld.h:605
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:568
UARTLLD_InitObject::readMode
uint32_t readMode
Definition: uart_lld.h:536
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:518
UARTLLD_InitObject::stopBits
uint32_t stopBits
Definition: uart_lld.h:510
UART_disableLoopbackMode
void UART_disableLoopbackMode(uint32_t baseAddr)
Function to disable loopback mode. This function is for internal use. Not recommended for customers t...
UART_lld_dmaDeInit
int32_t UART_lld_dmaDeInit(UARTLLD_Handle hUart)
API to close an UART DMA channel.
UARTLLD_InitObject::timeGuardVal
uint32_t timeGuardVal
Definition: uart_lld.h:552
UARTLLD_InitObject::intrPriority
uint8_t intrPriority
Definition: uart_lld.h:528
UART_getBaseAddr_lld
uint32_t UART_getBaseAddr_lld(UARTLLD_Handle handle)
Function to get base address of UART instance of a particular handle.
UART_lld_setRxState
int32_t UART_lld_setRxState(UARTLLD_Handle hUart, uint32_t state)
Function to enable/disable UART RX State.
UARTLLD_Object::readBuf
uint8_t * readBuf
Definition: uart_lld.h:587
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:538
UARTLLD_InitObject::dmaChCfg
UART_DmaChConfig dmaChCfg
Definition: uart_lld.h:550
UART_Transaction
Data structure used with UART_read() and UART_write()
Definition: uart_lld.h:457
UARTLLD_Object::writeCount
uint32_t writeCount
Definition: uart_lld.h:579
UARTLLD_Object::readCount
uint32_t readCount
Definition: uart_lld.h:589
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.
UARTLLD_Object::writeTrans
UART_Transaction writeTrans
Definition: uart_lld.h:603
UARTLLD_Object::rxTimeoutCnt
uint32_t rxTimeoutCnt
Definition: uart_lld.h:593
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.
UART_IsTxRxFifoEmpty
uint32_t UART_IsTxRxFifoEmpty(uint32_t baseAddr)
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...
UART_ExtendedParams::args
uint32_t * args
Definition: uart_lld.h:448
UARTLLD_Object::baseAddr
uint32_t baseAddr
Definition: uart_lld.h:569
UARTLLD_InitObject::inputClkFreq
uint32_t inputClkFreq
Definition: uart_lld.h:504
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:526
UARTLLD_Object::writeTransferMutex
void * writeTransferMutex
Definition: uart_lld.h:614
UARTLLD_Object::args
struct UART_Config_s * args
Definition: uart_lld.h:617
UART_lld_readDma
int32_t UART_lld_readDma(UARTLLD_Handle hUart, void *rxBuf, uint32_t size, const UART_ExtendedParams *extendedParams)
This API reads data from 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:542
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.
UARTLLD_Object::readErrorCnt
uint32_t readErrorCnt
Definition: uart_lld.h:595
UARTLLD_Object::readTransferMutex
void * readTransferMutex
Definition: uart_lld.h:612
UART_Transaction::args
uint32_t * args
Definition: uart_lld.h:469
UART_readCompCallbackFxn
void(* UART_readCompCallbackFxn)(struct UARTLLD_Object_s *args)
The definition of a read complete callback function used by the UART driver when used in UART_TRANSFE...
Definition: uart_lld.h:482
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 reads data with counter.
UARTLLD_Object::readTrans
UART_Transaction readTrans
Definition: uart_lld.h:601
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:514
UART_Transaction::buf
void * buf
Definition: uart_lld.h:458
UART_clockGet
uint32_t(* UART_clockGet)(void)
Definition: uart_lld.h:473
UART_lld_dmaInit
int32_t UART_lld_dmaInit(UARTLLD_Handle hUart, UART_DmaChConfig dmaChCfg)
API to open an UART DMA channel.
UART_clockUsecToTick
uint32_t(* UART_clockUsecToTick)(uint64_t usecs)
Definition: uart_lld.h:474
UART_writeCompCallbackFxn
void(* UART_writeCompCallbackFxn)(struct UARTLLD_Object_s *args)
The definition of a write complete callback function used by the UART driver when used in UART_TRANSF...
Definition: uart_lld.h:490
UARTLLD_InitObject::rxTrigLvl
uint32_t rxTrigLvl
Definition: uart_lld.h:540
UART_Transaction::count
uint32_t count
Definition: uart_lld.h:461
UART_lld_dmaRead
int32_t UART_lld_dmaRead(UARTLLD_Handle hUart, const UART_Transaction *transaction)
API to read data using an UART DMA channel.
UART_procLineStatusErr
int32_t UART_procLineStatusErr(UARTLLD_Handle hUart)
Function to check various error conditions in uart.