270 #ifndef ti_drivers_UART2__include 271 #define ti_drivers_UART2__include 277 #include <ti/drivers/dpl/ClockP.h> 278 #include <ti/drivers/dpl/HwiP.h> 279 #include <ti/drivers/dpl/SemaphoreP.h> 289 #define UART2_FLOWCTRL_NONE 0 294 #define UART2_FLOWCTRL_HARDWARE 1 302 #define UART2_STATUS_SUCCESS (0) 307 #define UART2_STATUS_SREADTIMEOUT (1) 312 #define UART2_STATUS_EFRAMING (-1) 317 #define UART2_STATUS_EPARITY (-2) 322 #define UART2_STATUS_EBREAK (-4) 327 #define UART2_STATUS_EOVERRUN (-8) 332 #define UART2_STATUS_EINUSE (-9) 337 #define UART2_STATUS_EINVALID (-10) 342 #define UART2_STATUS_EFAIL (-11) 347 #define UART2_STATUS_EMEMORY (-12) 352 #define UART2_STATUS_ETIMEOUT (-13) 357 #define UART2_STATUS_ECANCELLED (-14) 362 #define UART2_STATUS_ENOTOPEN (-15) 368 #define UART2_STATUS_EAGAIN (-16) 379 #define UART2_EVENT_OVERRUN (0x08) 384 #define UART2_EVENT_BREAK (0x04) 389 #define UART2_EVENT_PARITY (0x02) 394 #define UART2_EVENT_FRAMING (0x01) 401 #define UART2_EVENT_TX_BEGIN (0x10) 408 #define UART2_EVENT_TX_FINISHED (0x20) 415 #define UART2_WAIT_FOREVER (~(0U)) 440 void *userArg, int_fast16_t status);
464 uint32_t data,
void *userArg);
581 #define UART2_BASE_OBJECT \ 584 uint32_t overrunCount; \ 586 UART2_Mode readMode; \ 587 UART2_Mode writeMode; \ 588 UART2_ReadReturnMode readReturnMode:1; \ 591 bool rxCancelled:1; \ 592 bool txCancelled:1; \ 593 bool readTimedOut:1; \ 594 bool writeTimedOut:1; \ 595 bool overrunActive:1; \ 596 bool inReadCallback:1; \ 597 bool readCallbackPending:1; \ 598 bool inWriteCallback:1; \ 599 bool writeCallbackPending:1; \ 604 UART2_DataLen dataLength; \ 605 UART2_StopBits stopBits; \ 606 UART2_Parity parityType; \ 609 UART2_EventCallback eventCallback; \ 610 uint32_t eventMask; \ 614 RingBuf_Object rxBuffer; \ 616 unsigned char *readBuf; \ 618 uint32_t nReadTransfers; \ 622 SemaphoreP_Struct readSem; \ 623 ClockP_Struct readTimeoutClk; \ 624 UART2_Callback readCallback; \ 627 RingBuf_Object txBuffer; \ 628 volatile bool writeInUse; \ 629 const unsigned char *writeBuf; \ 631 uint32_t nWriteTransfers; \ 634 size_t bytesWritten; \ 635 SemaphoreP_Struct writeSem; \ 636 ClockP_Struct writeTimeoutClk; \ 637 UART2_Callback writeCallback; \ 640 unsigned int powerMgrId; \ 654 #define UART2_BASE_HWATTRS \ 660 uint8_t intPriority; \ 662 unsigned char *rxBufPtr; \ 666 unsigned char *txBufPtr; \ 670 uint32_t flowControl; \ 860 extern int_fast16_t __attribute__((weak)) UART2_readFull(
UART2_Handle handle,
861 void *buffer,
size_t size,
size_t *bytesRead);
944 size_t size,
size_t *bytesRead, uint32_t timeout);
1025 size_t size,
size_t *bytesWritten);
1124 size_t size,
size_t *bytesWritten, uint32_t timeout);
UART2 Global configuration.
Definition: UART2.h:697
int_fast16_t UART2_readTimeout(UART2_Handle handle, void *buffer, size_t size, size_t *bytesRead, uint32_t timeout)
Function that reads data from a UART, with a specified timeout for blocking mode. ...
ADC_Params params
Definition: Driver_Init.h:11
UART2_ReadReturnMode
UART2 return mode settings.
Definition: UART2.h:514
const uint_least8_t UART2_count
void UART2_readCancel(UART2_Handle handle)
Function that cancels a UART2_read() function call.
UART2_ReadReturnMode readReturnMode
Definition: UART2.h:572
size_t UART2_getRxCount(UART2_Handle handle)
Get the number of bytes available in the circular buffer.
UART2_Parity
UART2 parity type settings.
Definition: UART2.h:549
const UART2_Config UART2_config[]
int_fast16_t UART2_write(UART2_Handle handle, const void *buffer, size_t size, size_t *bytesWritten)
Function that writes data to a UART.
UART2_Callback readCallback
Definition: UART2.h:568
void * userArg
Definition: UART2.h:577
struct UART2_Config_ * UART2_Handle
A handle that is returned from a UART2_open() call.
Definition: UART2.h:420
void const * hwAttrs
Definition: UART2.h:702
uint32_t eventMask
Definition: UART2.h:571
UART2_StopBits stopBits
Definition: UART2.h:575
void * object
Definition: UART2.h:699
UART2_Mode writeMode
Definition: UART2.h:567
void(* UART2_EventCallback)(UART2_Handle handle, uint32_t event, uint32_t data, void *userArg)
The definition of a callback function used by the UART driver. The callback can occur in task or inte...
Definition: UART2.h:463
UART2_Parity parityType
Definition: UART2.h:576
void UART2_flushRx(UART2_Handle handle)
Function to flush data in the UART RX FIFO.
UART2_Mode
UART2 mode settings.
Definition: UART2.h:471
UART2_Handle UART2_open(uint_least8_t index, UART2_Params *params)
Function to initialize a given UART peripheral.
void UART2_close(UART2_Handle handle)
Function to close a UART peripheral specified by the UART2 handle.
void UART2_rxDisable(UART2_Handle handle)
Function that disables collecting of RX data into the circular buffer.
UART2_Callback writeCallback
Definition: UART2.h:569
UART2 Parameters.
Definition: UART2.h:565
struct UART2_Config_ UART2_Config
UART2 Global configuration.
UART2_StopBits
UART2 stop bit settings.
Definition: UART2.h:539
void UART2_Params_init(UART2_Params *params)
Function to initialize the UART2_Params struct to its defaults.
UART2_DataLen dataLength
Definition: UART2.h:574
int_fast16_t UART2_read(UART2_Handle handle, void *buffer, size_t size, size_t *bytesRead)
Function that reads data from a UART.
void UART2_rxEnable(UART2_Handle handle)
Function that enables collecting of RX data into the circular buffer.
UART2_EventCallback eventCallback
Definition: UART2.h:570
int_fast16_t UART2_writeTimeout(UART2_Handle handle, const void *buffer, size_t size, size_t *bytesWritten, uint32_t timeout)
Function that writes data to a UART, with a specified timeout.
void(* UART2_Callback)(UART2_Handle handle, void *buf, size_t count, void *userArg, int_fast16_t status)
The definition of a callback function used by the UART2 driver when used in UART2_Mode_CALLBACK The c...
Definition: UART2.h:439
UART2_Mode readMode
Definition: UART2.h:566
UART2_DataLen
UART2 data length settings.
Definition: UART2.h:527
void UART2_writeCancel(UART2_Handle handle)
Function that cancels a UART2_write() function call.
uint32_t baudRate
Definition: UART2.h:573