FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
#include <fastarduino/soft_uart.h>
Public Types | |
using | PCI_TYPE = interrupt::PCI_SIGNAL< RX_ > |
The interrupt::PCISignal type for RX_ pin, if it is a PinChangeInterrupt pin. More... | |
Public Member Functions | |
template<uint8_t SIZE_RX> | |
UARX (char(&input)[SIZE_RX], PCI_TYPE &enabler) | |
Construct a new software serial receiver and provide it with a buffer for interrupt-based reception. More... | |
void | begin (uint32_t rate, Parity parity=Parity::NONE, StopBits stop_bits=StopBits::ONE) |
Enable the receiver. More... | |
void | end (BufferHandling buffer_handling=BufferHandling::KEEP) |
Stop reception. 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 | RX = board::PCI_PIN<RX_>() |
The board::DigitalPin which shall receive serial signal; this must be either an External INT pin (board::ExternalInterruptPin ) or a PinChangeInterrupt pin (board::InterruptPin ). More... | |
Friends | |
struct | isr_handler |
Definition at line 606 of file soft_uart.h.
using serial::soft::UARX< board::InterruptPin, RX_ >::PCI_TYPE = interrupt::PCI_SIGNAL<RX_> |
The interrupt::PCISignal type for RX_
pin, if it is a PinChangeInterrupt pin.
This type is used in begin()
call.
Definition at line 621 of file soft_uart.h.
|
inlineexplicit |
Construct a new software serial receiver and provide it with a buffer for interrupt-based reception.
Reception is asynchronous.
input | an array of characters used by this receiver to store content received through serial line, buffered until read through in() . |
enabler | the interrupt::PCISignal for the RX pin; it is used to enable interrupts on that pin. |
Definition at line 635 of file soft_uart.h.
|
inline |
Enable the receiver.
This is needed before any reception can take place. Once called, it is possible to read content, received through serial connection, by using in()
.
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 651 of file soft_uart.h.
|
inline |
Stop reception.
Once called, it is possible to re-enable reception again by calling begin()
.
buffer_handling | how to handle output buffer before ending transmissions |
Definition at line 665 of file soft_uart.h.
|
friend |
Definition at line 683 of file soft_uart.h.
|
staticconstexpr |
The board::DigitalPin
which shall receive serial signal; this must be either an External INT pin (board::ExternalInterruptPin
) or a PinChangeInterrupt pin (board::InterruptPin
).
Definition at line 614 of file soft_uart.h.