Hardware serial UARTs.
More...
Hardware serial UARTs.
◆ DEFAULT_RX_BUFFER_SIZE
#define DEFAULT_RX_BUFFER_SIZE 256 |
◆ DEFAULT_TX_BUFFER_SIZE
#define DEFAULT_TX_BUFFER_SIZE 0 |
◆ NUMBER_UARTS
Quantity of UARTs available.
◆ SERIAL_CONFIG_MAP
#define SERIAL_CONFIG_MAP |
( |
|
XX | ) |
|
Value:
#define XX(x)
Definition: HardwareSerial.h:101
◆ SERIAL_PIN_DEFAULT
#define SERIAL_PIN_DEFAULT UART_PIN_DEFAULT |
◆ SERIAL_STATUS_MAP
#define SERIAL_STATUS_MAP |
( |
|
XX | ) |
|
Value: XX(BreakDetected,
"Break condition detected on receive line") \
XX(Overflow, "Receive buffer overflowed") \
XX(FramingError, "Receive framing error") \
XX(ParityError, "Parity check failed on received data")
◆ UART_ID_0
◆ UART_ID_1
◆ XX [1/4]
#define XX |
( |
|
tag, |
|
|
|
comment |
|
) |
| tag, |
◆ XX [2/4]
#define XX |
( |
|
tag, |
|
|
|
comment |
|
) |
| static constexpr SerialStatus eSERS_##tag{SerialStatus::tag}; |
◆ XX [3/4]
#define XX |
( |
|
x | ) |
Fmt##x = UART_##x, |
◆ XX [4/4]
#define XX |
( |
|
x | ) |
static constexpr SerialFormat SERIAL_##x{SerialFormat::Fmt##x}; |
◆ StreamDataReceivedDelegate
Delegate callback type for serial data reception.
- Parameters
-
source | Reference to serial stream |
arrivedChar | Char received |
availableCharsCount | Quantity of chars available stream in receive buffer |
- Note
- Delegate constructor usage: (&YourClass::method, this)
This delegate is invoked when the serial receive buffer is full, or it times out. The arrivedChar indicates the last character received, which might be a '
' line ending character, for example.
If no receive buffer has been allocated, or it's not big enough to contain the full message, then this value will be incorrect as data is stored in the hardware FIFO until read out.
◆ TransmitCompleteDelegate
Delegate callback type for serial data transmit completion.
- Note
- Invoked when the last byte has left the hardware FIFO
◆ SerialFormat
◆ SerialMode
values equivalent to uart_mode_t
Enumerator |
---|
Full | |
RxOnly | |
TxOnly | |
◆ SerialStatus
Notification and error status bits.
◆ Serial
Global instance of serial port UART0.
- Note
- Use Serial.function to access serial functions
-
Example:
bool begin(uint32_t baud=9600)
Initialise the serial port.
Definition: HardwareSerial.h:132
HardwareSerial Serial
Global instance of serial port UART0.
-
Serial uses UART0, which is mapped to pins GPIO1 (TX) and GPIO3 (RX).
-
Serial may be swapped to GPIO15 (TX) and GPIO13 (RX) by calling Serial.swap() after Serial.begin.
-
Calling swap again maps UART0 back to GPIO1 and GPIO3.
◆ SERIAL_FULL
◆ SERIAL_RX_ONLY
◆ SERIAL_TX_ONLY