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)) 439 typedef void (*
UART2_Callback)(UART2_Handle handle,
void *buf,
size_t count,
void *userArg, int_fast16_t status);
585 #define UART2_BASE_OBJECT \ 589 uint32_t overrunCount; \ 590 UART2_Mode readMode; \ 591 UART2_Mode writeMode; \ 592 UART2_ReadReturnMode readReturnMode; \ 599 bool writeTimedOut; \ 600 bool overrunActive; \ 601 bool inReadCallback; \ 602 bool readCallbackPending; \ 603 bool inWriteCallback; \ 604 bool writeCallbackPending; \ 610 UART2_DataLen dataLength; \ 611 UART2_StopBits stopBits; \ 612 UART2_Parity parityType; \ 615 UART2_EventCallback eventCallback; \ 616 uint32_t eventMask; \ 620 RingBuf_Object rxBuffer; \ 622 unsigned char *readBuf; \ 627 SemaphoreP_Struct readSem; \ 628 ClockP_Struct readTimeoutClk; \ 629 UART2_Callback readCallback; \ 632 RingBuf_Object txBuffer; \ 633 volatile bool writeInUse; \ 634 const unsigned char *writeBuf; \ 638 size_t bytesWritten; \ 639 SemaphoreP_Struct writeSem; \ 640 ClockP_Struct writeTimeoutClk; \ 641 UART2_Callback writeCallback; \ 644 unsigned int powerMgrId; \ 659 #define UART2_BASE_HWATTRS \ 665 uint8_t intPriority; \ 667 unsigned char *rxBufPtr; \ 671 unsigned char *txBufPtr; \ 675 uint32_t flowControl; \ 863 extern int_fast16_t
UART2_read(UART2_Handle handle,
void *buffer,
size_t size,
size_t *bytesRead);
866 extern int_fast16_t __attribute__((weak))
867 UART2_readFull(UART2_Handle handle,
void *buffer,
size_t size,
size_t *bytesRead);
1033 extern int_fast16_t
UART2_write(UART2_Handle handle, const
void *buffer,
size_t size,
size_t *bytesWritten);
1134 size_t *bytesWritten,
UART2 Global configuration.
Definition: UART2.h:703
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:513
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:576
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:551
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:572
void * userArg
Definition: UART2.h:581
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:709
uint32_t eventMask
Definition: UART2.h:575
UART2_StopBits stopBits
Definition: UART2.h:579
void * object
Definition: UART2.h:706
UART2_Mode writeMode
Definition: UART2.h:571
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:462
UART2_Parity parityType
Definition: UART2.h:580
void UART2_flushRx(UART2_Handle handle)
Function to flush data in the UART RX FIFO.
UART2_Mode
UART2 mode settings.
Definition: UART2.h:469
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:573
UART2 Parameters.
Definition: UART2.h:568
struct UART2_Config_ UART2_Config
UART2 Global configuration.
UART2_StopBits
UART2 stop bit settings.
Definition: UART2.h:540
void UART2_Params_init(UART2_Params *params)
Function to initialize the UART2_Params struct to its defaults.
UART2_DataLen dataLength
Definition: UART2.h:578
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:574
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:570
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:577