283 #ifndef ti_drivers_UART2__include 284 #define ti_drivers_UART2__include 304 #define UART2_FLOWCTRL_NONE 0 309 #define UART2_FLOWCTRL_HARDWARE 1 317 #define UART2_STATUS_SUCCESS (0) 322 #define UART2_STATUS_SREADTIMEOUT (1) 327 #define UART2_STATUS_EFRAMING (-1) 332 #define UART2_STATUS_EPARITY (-2) 337 #define UART2_STATUS_EBREAK (-4) 342 #define UART2_STATUS_EOVERRUN (-8) 347 #define UART2_STATUS_EINUSE (-9) 352 #define UART2_STATUS_EINVALID (-10) 357 #define UART2_STATUS_EFAIL (-11) 362 #define UART2_STATUS_EMEMORY (-12) 367 #define UART2_STATUS_ETIMEOUT (-13) 372 #define UART2_STATUS_ECANCELLED (-14) 377 #define UART2_STATUS_ENOTOPEN (-15) 383 #define UART2_STATUS_EAGAIN (-16) 394 #define UART2_EVENT_OVERRUN (0x08) 399 #define UART2_EVENT_BREAK (0x04) 404 #define UART2_EVENT_PARITY (0x02) 409 #define UART2_EVENT_FRAMING (0x01) 416 #define UART2_EVENT_TX_BEGIN (0x10) 423 #define UART2_EVENT_TX_FINISHED (0x20) 430 #define UART2_WAIT_FOREVER (~(0U)) 454 typedef void (*
UART2_Callback)(UART2_Handle handle,
void *buf,
size_t count,
void *userArg, int_fast16_t status);
605 #define UART2_BASE_OBJECT \ 609 uint32_t overrunCount; \ 610 UART2_Mode readMode; \ 611 UART2_Mode writeMode; \ 612 UART2_ReadReturnMode readReturnMode; \ 619 bool writeTimedOut; \ 620 bool overrunActive; \ 621 bool inReadCallback; \ 622 bool readCallbackPending; \ 623 bool inWriteCallback; \ 624 bool writeCallbackPending; \ 625 bool readToRingbuf; \ 630 UART2_DataLen dataLength; \ 631 UART2_StopBits stopBits; \ 632 UART2_Parity parityType; \ 635 UART2_EventCallback eventCallback; \ 636 uint32_t eventMask; \ 640 RingBuf_Object rxBuffer; \ 642 unsigned char *readBuf; \ 647 SemaphoreP_Struct readSem; \ 648 UART2_Callback readCallback; \ 651 RingBuf_Object txBuffer; \ 652 volatile bool writeInUse; \ 653 const unsigned char *writeBuf; \ 657 size_t bytesWritten; \ 658 SemaphoreP_Struct writeSem; \ 659 UART2_Callback writeCallback; \ 662 Power_Resource powerMgrId; \ 677 #define UART2_BASE_HWATTRS \ 683 uint8_t intPriority; \ 685 unsigned char *rxBufPtr; \ 689 unsigned char *txBufPtr; \ 693 uint32_t flowControl; \ 887 extern int_fast16_t
UART2_read(UART2_Handle handle,
void *buffer,
size_t size,
size_t *bytesRead);
890 extern int_fast16_t __attribute__((weak))
891 UART2_readFull(UART2_Handle handle,
void *buffer,
size_t size,
size_t *bytesRead);
1069 extern int_fast16_t
UART2_write(UART2_Handle handle, const
void *buffer,
size_t size,
size_t *bytesWritten);
1175 size_t *bytesWritten,
UART2 Global configuration.
Definition: UART2.h:721
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:533
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:596
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:571
const UART2_Config UART2_config[]
Clock interface for the RTOS Porting Interface.
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:592
void * userArg
Definition: UART2.h:601
struct UART2_Config_ * UART2_Handle
A handle that is returned from a UART2_open() call.
Definition: UART2.h:435
void const * hwAttrs
Definition: UART2.h:727
uint32_t eventMask
Definition: UART2.h:595
UART2_StopBits stopBits
Definition: UART2.h:599
void * object
Definition: UART2.h:724
UART2_Mode writeMode
Definition: UART2.h:591
Semaphore module for the RTOS Porting Interface.
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:477
UART2_Parity parityType
Definition: UART2.h:600
void UART2_flushRx(UART2_Handle handle)
Function to flush data in the UART RX FIFO.
UART2_Mode
UART2 mode settings.
Definition: UART2.h:484
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:593
UART2 Parameters.
Definition: UART2.h:588
struct UART2_Config_ UART2_Config
UART2 Global configuration.
UART2_StopBits
UART2 stop bit settings.
Definition: UART2.h:560
void UART2_Params_init(UART2_Params *params)
Function to initialize the UART2_Params struct to its defaults.
UART2_DataLen dataLength
Definition: UART2.h:598
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:594
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.
Hardware Interrupt module for the RTOS Porting Interface.
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:454
UART2_Mode readMode
Definition: UART2.h:590
UART2_DataLen
UART2 data length settings.
Definition: UART2.h:547
void UART2_writeCancel(UART2_Handle handle)
Function that cancels a UART2_write() function call.
uint32_t baudRate
Definition: UART2.h:597