FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
Software-emulated serial transmitter API. More...
#include <fastarduino/soft_uart.h>
Public Member Functions | |
template<uint8_t SIZE_TX> | |
UATX (char(&output)[SIZE_TX]) | |
Construct a new software serial transmitter and provide it with a buffer for payload transmission. More... | |
void | begin (uint32_t rate, Parity parity=Parity::NONE, StopBits stop_bits=StopBits::ONE) |
Enable the transmitter. More... | |
void | end (UNUSED BufferHandling buffer_handling=BufferHandling::KEEP) |
Stop all transmissions. More... | |
Public Member Functions inherited from serial::UARTErrors | |
void | clear_errors () |
Reset UART errors to no error. More... | |
uint8_t | has_errors () const |
Indicate if there are UART errors pending. More... | |
bool | frame_error () const |
Indicate if a frame error has occurred. More... | |
bool | data_overrun () const |
Indicate if a data overrun has occurred. More... | |
bool | queue_overflow () const |
Indicate if a queue overflow has occurred. More... | |
bool | parity_error () const |
Indicate if a parity error has occurred. More... | |
Static Public Attributes | |
static constexpr const board::DigitalPin | TX = TX_ |
The board::DigitalPin to which transmitted signal is sent. More... | |
Software-emulated serial transmitter API.
For this API to be fully functional, you must register this class as a streams::ostreambuf
callback listener through REGISTER_OSTREAMBUF_LISTENERS()
.
TX_ | the board::DigitalPin to which transmitted signal is sent |
Definition at line 238 of file soft_uart.h.
|
inlineexplicit |
Construct a new software serial transmitter and provide it with a buffer for payload transmission.
output | an array of characters used by this transmitter to buffer output during transmission |
Definition at line 250 of file soft_uart.h.
|
inline |
Enable the transmitter.
This is needed before any transmission can take place. Once called, it is possible to push content to out()
, which will be then transmitted through the serial connection.
rate | the transmission rate in bits per second (bps) |
parity | the kind of parity check used by transmission |
stop_bits | the number of stop bits used by transmission |
Definition at line 265 of file soft_uart.h.
|
inline |
Stop all transmissions.
Once called, it is possible to re-enable transmission again by calling begin()
.
buffer_handling | unused argument, present for symetry with serial::hard::UATX::end() ; this is unused because useless, as software UATX is totally synchronous. |
Definition at line 280 of file soft_uart.h.
|
staticconstexpr |
The board::DigitalPin
to which transmitted signal is sent.
Definition at line 242 of file soft_uart.h.