Treehopper C# API
SerialShim Class Reference

Provides Serial-like functionality that can be directed both to the Debug output, or also to the board's UART. More...

Public Member Functions

 SerialShim (TreehopperUsb board)
 Construct a new instance of SerialShim. More...
 
void begin (int baud, bool redirectToDebugStream=true)
 Enable the UART module (or Debug logging) on the board with the given parameters More...
 
void write (dynamic value)
 Write a value to the given stream. More...
 

Events

SerialShimWriter WriteRequested
 An event that fires when data was written More...
 

Detailed Description

Provides Serial-like functionality that can be directed both to the Debug output, or also to the board's UART.

Constructor & Destructor Documentation

◆ SerialShim()

Construct a new instance of SerialShim.

Parameters
boardthe board to reference for hardware UART transactions

Member Function Documentation

◆ begin()

void begin ( int  baud,
bool  redirectToDebugStream = true 
)

Enable the UART module (or Debug logging) on the board with the given parameters

Parameters
baudThe baud rate to use
redirectToDebugStreamWhether to direct Serial.write() to Debug, or to send over the physical UART.

◆ write()

void write ( dynamic  value)

Write a value to the given stream.

Parameters
valueThe value to write

Event Documentation

◆ WriteRequested

SerialShimWriter WriteRequested

An event that fires when data was written


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