FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
#include <fastarduino/soft_uart.h>
Public Types | |
using | INT_TYPE = typename interrupt::INTSignal< RX_ > |
The interrupt::INTSignal type for RX_ pin, if it is a External Interrupt pin. More... | |
Public Member Functions | |
template<uint8_t SIZE_RX, uint8_t SIZE_TX> | |
UART (char(&input)[SIZE_RX], char(&output)[SIZE_TX], INT_TYPE &enabler) | |
Construct a new software serial receiver/transceiver and provide it with 2 buffers, one for interrupt-based reception, one for transmission. More... | |
void | begin (uint32_t rate, Parity parity=Parity::NONE, StopBits stop_bits=StopBits::ONE) |
Enable the receiver/transceiver. More... | |
void | end (BufferHandling buffer_handling=BufferHandling::KEEP) |
Stop all transmissions and receptions. 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... | |
static constexpr const board::DigitalPin | RX = board::EXT_PIN<RX_>() |
The board::DigitalPin which shall receive serial signal. More... | |
Friends | |
struct | isr_handler |
Definition at line 509 of file soft_uart.h.
using serial::soft::UART< board::ExternalInterruptPin, RX_, TX_ >::INT_TYPE = typename interrupt::INTSignal<RX_> |
The interrupt::INTSignal type for RX_
pin, if it is a External Interrupt pin.
This type is used in begin()
call.
Definition at line 524 of file soft_uart.h.
|
inlineexplicit |
Construct a new software serial receiver/transceiver and provide it with 2 buffers, one for interrupt-based reception, one for transmission.
input | an array of characters used by this receiver to store content received through serial line, buffered until read through in() . |
output | an array of characters used by this transmitter to buffer output during transmission. |
enabler | the interrupt::INTSignal for the RX pin; it is used to enable interrupts on that pin. |
Definition at line 539 of file soft_uart.h.
|
inline |
Enable the receiver/transceiver.
This is needed before any transmission or reception can take place. Once called, it is possible to send and receive content through serial connection, by using in()
for reading and out()
for writing.
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 555 of file soft_uart.h.
|
inline |
Stop all transmissions and receptions.
Once called, it is possible to re-enable transmission and reception again by calling begin()
.
buffer_handling | how to handle output buffer before ending transmissions |
Definition at line 571 of file soft_uart.h.
|
friend |
Definition at line 601 of file soft_uart.h.
|
staticconstexpr |
The board::DigitalPin
to which transmitted signal is sent.
Definition at line 513 of file soft_uart.h.
|
staticconstexpr |
The board::DigitalPin
which shall receive serial signal.
Definition at line 517 of file soft_uart.h.