PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
An easy-to-use, thread-safe class for simplex (transmit only) UART communication. More...
#include <PropWare/serial/uart/shareduarttx.h>
Public Types | |
enum | Parity { Parity::NO_PARITY, Parity::EVEN_PARITY, Parity::ODD_PARITY } |
enum | ErrorCode { NO_ERROR = 0, BEG_ERROR = UART_ERRORS_BASE, BAUD_TOO_HIGH = BEG_ERROR, PARITY_ERROR, INVALID_DATA_WIDTH, INVALID_STOP_BIT_WIDTH, NULL_POINTER, TIMEOUT_ERROR, END_ERROR = UART::TIMEOUT_ERROR } |
Public Member Functions | |
SharedUARTTX () | |
No-arg constructors are helpful when avoiding dynamic allocation. | |
SharedUARTTX (const Port::Mask tx) | |
Construct a UART instance capable of simplex serial communications. More... | |
virtual void | set_tx_mask (const Port::Mask tx) |
virtual void | send (uint16_t originalData) const |
virtual void | send_array (char const array[], uint32_t words) const |
Port::Mask | get_tx_mask () const |
virtual void | put_char (const char c) |
Print a single character. More... | |
virtual void | puts (const char string[]) |
Send a null-terminated character array. Though this method could be created using put_char, some objects (such as PropWare::UART), have optimized methods for sending a string and PrintCapable::puts can utilize them. More... | |
virtual ErrorCode | set_data_width (const uint8_t dataWidth) |
uint8_t | get_data_width () const |
virtual void | set_parity (const UART::Parity parity) |
UART::Parity | get_parity () const |
ErrorCode | set_stop_bit_width (const uint8_t stopBitWidth) |
uint8_t | get_stop_bit_width () const |
void | set_baud_rate (const int32_t baudRate) |
int32_t | get_baud_rate () const |
Static Public Attributes | |
static const uint8_t | DEFAULT_DATA_WIDTH = 8 |
static const Parity | DEFAULT_PARITY = Parity::NO_PARITY |
static const uint8_t | DEFAULT_STOP_BIT_WIDTH = 1 |
static const int | MAX_BAUD = 4413793 |
An easy-to-use, thread-safe class for simplex (transmit only) UART communication.
Definition at line 36 of file shareduarttx.h.
|
inherited |
Error codes - Proceeded by SD, SPI, and HD44780
Enumerator | |
---|---|
NO_ERROR | No errors; Successful completion of the function |
BEG_ERROR | First error code for PropWare::UART |
BAUD_TOO_HIGH | The requested baud rate is too high |
PARITY_ERROR | A parity error has occurred during read |
INVALID_DATA_WIDTH | The requested data width is not between 1 and 16 (inclusive) |
INVALID_STOP_BIT_WIDTH | The requested stop bit width is not between 1 and 14 (inclusive) |
NULL_POINTER | Null pointer was passed as an argument |
TIMEOUT_ERROR | Reading from the serial connection timed out |
END_ERROR | Last error code used by PropWare::UART |
|
stronginherited |
PropWare::SharedUARTTX::SharedUARTTX | ( | const Port::Mask | tx | ) |
Construct a UART instance capable of simplex serial communications.
[in] | tx | Bit mask used for the TX (transmit) pin |
Definition at line 52 of file shareduarttx.h.
|
virtualinherited |
Print a single character.
[in] | c | Individual char to be printed |
Implements PropWare::PrintCapable.
|
virtualinherited |
Send a null-terminated character array. Though this method could be created using put_char, some objects (such as PropWare::UART), have optimized methods for sending a string and PrintCapable::puts can utilize them.
string[]
must be terminated with a null terminator[in] | string[] | Array of data words with the final word being 0 - the null terminator |
Implements PropWare::PrintCapable.