Task responsible for UART initialization and data retrieval.
More...
#include <TUART.h>
|
| typedef void(* | ReceiveHandler) (const char *, size_t) |
| | Initialize the serial port.
|
| |
|
|
| CTUART () |
| | Construct a CTUART task object.
|
| |
|
| ~CTUART () |
| | Destructor for CUART.
|
| |
|
bool | Initialize (CInterruptSystem *pInterruptSystem, ReceiveHandler recvFunc) |
| |
|
bool | EnsureStarted () |
| | Ensure the UART task is running; safe to call multiple times.
|
| |
|
void | SuspendTask () |
| | Suspend the UART task so host input is buffered only.
|
| |
| void | Send (const char *buf, size_t len) |
| | Send a message through the serial interface.
|
| |
|
void | Run () override |
| | Main task loop for UART (currently idle, extend for polling/interrupt).
|
| |
| int | DrainSerialInput (char *dest, size_t maxLen) |
| | Drain available serial input from the ring buffer into a destination buffer.
|
| |
|
|
static CTUART * | Get (void) |
| | Access the singleton UART task instance.
|
| |
Task responsible for UART initialization and data retrieval.
The singleton wraps the serial device. It exposes a hook so higher layers can drain received data directly from the hardware FIFO using interrupt-safe mechanisms in the kernel.
◆ ReceiveHandler
| typedef void(* CTUART::ReceiveHandler) (const char *, size_t) |
Initialize the serial port.
- Parameters
-
| pInterruptSystem | Pointer to the system interrupt controller. |
| recvFunc | Deprecated/Unused callback pointer. Pass nullptr. |
- Returns
- true if initialization succeeded, false otherwise.
◆ DrainSerialInput()
| int CTUART::DrainSerialInput |
( |
char * |
dest, |
|
|
size_t |
maxLen |
|
) |
| |
Drain available serial input from the ring buffer into a destination buffer.
- Parameters
-
| dest | Destination buffer. |
| maxLen | Maximum number of bytes to drain. |
- Returns
- Number of bytes drained, or negative error code.
◆ Send()
| void CTUART::Send |
( |
const char * |
buf, |
|
|
size_t |
len |
|
) |
| |
Send a message through the serial interface.
- Parameters
-
| buf | Pointer to data buffer. |
| len | Number of bytes to send. |
The documentation for this class was generated from the following files: