FastArduino  v1.7
C++ library to build fast but small Arduino/AVR projects
serial::soft::UATX< TX_ > Class Template Reference

Software-emulated serial transmitter API. More...

#include <fastarduino/soft_uart.h>

Inheritance diagram for serial::soft::UATX< TX_ >:
Collaboration diagram for serial::soft::UATX< TX_ >:

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.
 
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.
 

Detailed Description

template<board::DigitalPin TX_>
class serial::soft::UATX< TX_ >

Software-emulated serial transmitter API.

Template Parameters
TX_the board::DigitalPin to which transmitted signal is sent
See also
UARX
UART

Definition at line 218 of file soft_uart.h.

Constructor & Destructor Documentation

◆ UATX()

template<board::DigitalPin TX_>
template<uint8_t SIZE_TX>
serial::soft::UATX< TX_ >::UATX ( char(&)  output[SIZE_TX])
inlineexplicit

Construct a new software serial transmitter and provide it with a buffer for payload transmission.

Parameters
outputan array of characters used by this transmitter to buffer output during transmission

Definition at line 233 of file soft_uart.h.

Member Function Documentation

◆ begin()

template<board::DigitalPin TX_>
void serial::soft::UATX< TX_ >::begin ( uint32_t  rate,
Parity  parity = Parity::NONE,
StopBits  stop_bits = StopBits::ONE 
)
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.

Parameters
ratethe transmission rate in bits per second (bps)
paritythe kind of parity check used by transmission
stop_bitsthe number of stop bits used by transmission

Definition at line 246 of file soft_uart.h.

◆ end()

template<board::DigitalPin TX_>
void serial::soft::UATX< TX_ >::end ( UNUSED BufferHandling  buffer_handling = BufferHandling::KEEP)
inline

Stop all transmissions.

Once called, it is possible to re-enable transmission again by calling begin().

Parameters
buffer_handlingunused argument, present for symetry with serial::hard::UATX::end(); this is unused because useless, as software UATX is totally synchronous.

Definition at line 261 of file soft_uart.h.


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