VT100 Terminal App
Circle VT100 module documentation
Loading...
Searching...
No Matches
CTUART Class Reference

Task responsible for UART initialization and data retrieval. More...

#include <TUART.h>

Inheritance diagram for CTUART:

Public Types

typedef void(* ReceiveHandler) (const char *, size_t)
 Initialize the serial port.
 

Public Member Functions

 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 Public Member Functions

static CTUARTGet (void)
 Access the singleton UART task instance.
 

Detailed Description

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.

Member Typedef Documentation

◆ ReceiveHandler

typedef void(* CTUART::ReceiveHandler) (const char *, size_t)

Initialize the serial port.

Parameters
pInterruptSystemPointer to the system interrupt controller.
recvFuncDeprecated/Unused callback pointer. Pass nullptr.
Returns
true if initialization succeeded, false otherwise.

Member Function Documentation

◆ DrainSerialInput()

int CTUART::DrainSerialInput ( char *  dest,
size_t  maxLen 
)

Drain available serial input from the ring buffer into a destination buffer.

Parameters
destDestination buffer.
maxLenMaximum 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
bufPointer to data buffer.
lenNumber of bytes to send.

The documentation for this class was generated from the following files: