Hardware serial UARTs.
More...
|
enum | SerialConfig {
SERIAL_5N1 = UART_5N1,
SERIAL_6N1 = UART_6N1,
SERIAL_7N1 = UART_7N1,
SERIAL_8N1 = UART_8N1,
SERIAL_5N2 = UART_5N2,
SERIAL_6N2 = UART_6N2,
SERIAL_7N2 = UART_7N2,
SERIAL_8N2 = UART_8N2,
SERIAL_5E1 = UART_5E1,
SERIAL_6E1 = UART_6E1,
SERIAL_7E1 = UART_7E1,
SERIAL_8E1 = UART_8E1,
SERIAL_5E2 = UART_5E2,
SERIAL_6E2 = UART_6E2,
SERIAL_7E2 = UART_7E2,
SERIAL_8E2 = UART_8E2,
SERIAL_5O1 = UART_5O1,
SERIAL_6O1 = UART_6O1,
SERIAL_7O1 = UART_7O1,
SERIAL_8O1 = UART_8O1,
SERIAL_5O2 = UART_5O2,
SERIAL_6O2 = UART_6O2,
SERIAL_7O2 = UART_7O2,
SERIAL_8O2 = UART_8O2
} |
|
enum | SerialMode { SERIAL_FULL = UART_FULL,
SERIAL_RX_ONLY = UART_RX_ONLY,
SERIAL_TX_ONLY = UART_TX_ONLY
} |
| values equivalent to uart_mode_t More...
|
|
enum | SerialStatus { eSERS_BreakDetected,
eSERS_Overflow,
eSERS_FramingError,
eSERS_ParityError
} |
| Notification and error status bits. More...
|
|
Hardware serial UARTs.
◆ AT_REPLY_OK
Asynchronous AT command client.
◆ AT_TIMEOUT
◆ 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.
◆ UART_ID_0
◆ UART_ID_1
◆ AtCompleteCallback
◆ AtReceiveCallback
◆ 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
◆ AtState
Enumerator |
---|
eAtOK | |
eAtRunning | |
eAtError | |
◆ SerialConfig
Enumerator |
---|
SERIAL_5N1 | |
SERIAL_6N1 | |
SERIAL_7N1 | |
SERIAL_8N1 | |
SERIAL_5N2 | |
SERIAL_6N2 | |
SERIAL_7N2 | |
SERIAL_8N2 | |
SERIAL_5E1 | |
SERIAL_6E1 | |
SERIAL_7E1 | |
SERIAL_8E1 | |
SERIAL_5E2 | |
SERIAL_6E2 | |
SERIAL_7E2 | |
SERIAL_8E2 | |
SERIAL_5O1 | |
SERIAL_6O1 | |
SERIAL_7O1 | |
SERIAL_8O1 | |
SERIAL_5O2 | |
SERIAL_6O2 | |
SERIAL_7O2 | |
SERIAL_8O2 | |
◆ SerialMode
values equivalent to uart_mode_t
Enumerator |
---|
SERIAL_FULL | |
SERIAL_RX_ONLY | |
SERIAL_TX_ONLY | |
◆ SerialStatus
Notification and error status bits.
Enumerator |
---|
eSERS_BreakDetected | Break condition detected on receive line.
|
eSERS_Overflow | Receive buffer overflowed.
|
eSERS_FramingError | Receive framing error.
|
eSERS_ParityError | Parity check failed on received data.
|
◆ Serial
Global instance of serial port UART0.
- Note
- Use Serial.function to access serial functions
-
Example:
-
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.