283 #ifndef ti_drivers_UART2__include 284 #define ti_drivers_UART2__include 290 #include <ti/drivers/dpl/ClockP.h> 291 #include <ti/drivers/dpl/HwiP.h> 292 #include <ti/drivers/dpl/SemaphoreP.h> 302 #define UART2_FLOWCTRL_NONE 0 307 #define UART2_FLOWCTRL_HARDWARE 1 315 #define UART2_STATUS_SUCCESS (0) 320 #define UART2_STATUS_SREADTIMEOUT (1) 325 #define UART2_STATUS_EFRAMING (-1) 330 #define UART2_STATUS_EPARITY (-2) 335 #define UART2_STATUS_EBREAK (-4) 340 #define UART2_STATUS_EOVERRUN (-8) 345 #define UART2_STATUS_EINUSE (-9) 350 #define UART2_STATUS_EINVALID (-10) 355 #define UART2_STATUS_EFAIL (-11) 360 #define UART2_STATUS_EMEMORY (-12) 365 #define UART2_STATUS_ETIMEOUT (-13) 370 #define UART2_STATUS_ECANCELLED (-14) 375 #define UART2_STATUS_ENOTOPEN (-15) 381 #define UART2_STATUS_EAGAIN (-16) 392 #define UART2_EVENT_OVERRUN (0x08) 397 #define UART2_EVENT_BREAK (0x04) 402 #define UART2_EVENT_PARITY (0x02) 407 #define UART2_EVENT_FRAMING (0x01) 414 #define UART2_EVENT_TX_BEGIN (0x10) 421 #define UART2_EVENT_TX_FINISHED (0x20) 428 #define UART2_WAIT_FOREVER (~(0U)) 452 typedef void (*
UART2_Callback)(UART2_Handle handle,
void *buf,
size_t count,
void *userArg, int_fast16_t status);
603 #define UART2_BASE_OBJECT \ 607 uint32_t overrunCount; \ 608 UART2_Mode readMode; \ 609 UART2_Mode writeMode; \ 610 UART2_ReadReturnMode readReturnMode; \ 617 bool writeTimedOut; \ 618 bool overrunActive; \ 619 bool inReadCallback; \ 620 bool readCallbackPending; \ 621 bool inWriteCallback; \ 622 bool writeCallbackPending; \ 623 bool readToRingbuf; \ 628 UART2_DataLen dataLength; \ 629 UART2_StopBits stopBits; \ 630 UART2_Parity parityType; \ 633 UART2_EventCallback eventCallback; \ 634 uint32_t eventMask; \ 638 RingBuf_Object rxBuffer; \ 640 unsigned char *readBuf; \ 645 SemaphoreP_Struct readSem; \ 646 UART2_Callback readCallback; \ 649 RingBuf_Object txBuffer; \ 650 volatile bool writeInUse; \ 651 const unsigned char *writeBuf; \ 655 size_t bytesWritten; \ 656 SemaphoreP_Struct writeSem; \ 657 UART2_Callback writeCallback; \ 660 unsigned int powerMgrId; \ 675 #define UART2_BASE_HWATTRS \ 681 uint8_t intPriority; \ 683 unsigned char *rxBufPtr; \ 687 unsigned char *txBufPtr; \ 691 uint32_t flowControl; \ 879 extern int_fast16_t
UART2_read(UART2_Handle handle,
void *buffer,
size_t size,
size_t *bytesRead);
882 extern int_fast16_t __attribute__((weak))
883 UART2_readFull(UART2_Handle handle,
void *buffer,
size_t size,
size_t *bytesRead);
1055 extern int_fast16_t
UART2_write(UART2_Handle handle, const
void *buffer,
size_t size,
size_t *bytesWritten);
1161 size_t *bytesWritten,
UART2 Global configuration.
Definition: UART2.h:719
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:531
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:594
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:569
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:590
void * userArg
Definition: UART2.h:599
struct UART2_Config_ * UART2_Handle
A handle that is returned from a UART2_open() call.
Definition: UART2.h:433
void const * hwAttrs
Definition: UART2.h:725
uint32_t eventMask
Definition: UART2.h:593
UART2_StopBits stopBits
Definition: UART2.h:597
void * object
Definition: UART2.h:722
UART2_Mode writeMode
Definition: UART2.h:589
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:475
UART2_Parity parityType
Definition: UART2.h:598
void UART2_flushRx(UART2_Handle handle)
Function to flush data in the UART RX FIFO.
UART2_Mode
UART2 mode settings.
Definition: UART2.h:482
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:591
UART2 Parameters.
Definition: UART2.h:586
struct UART2_Config_ UART2_Config
UART2 Global configuration.
UART2_StopBits
UART2 stop bit settings.
Definition: UART2.h:558
void UART2_Params_init(UART2_Params *params)
Function to initialize the UART2_Params struct to its defaults.
UART2_DataLen dataLength
Definition: UART2.h:596
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:592
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:452
UART2_Mode readMode
Definition: UART2.h:588
UART2_DataLen
UART2 data length settings.
Definition: UART2.h:545
void UART2_writeCancel(UART2_Handle handle)
Function that cancels a UART2_write() function call.
uint32_t baudRate
Definition: UART2.h:595