Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
Hardware serial

Hardware serial UARTs. More...

Classes

struct  HWSerialMemberData
 Hardware serial member data. More...
 
class  HardwareSerial
 Hardware serial class. More...
 

Macros

#define UART_ID_0   0
 ID of UART 0. More...
 
#define UART_ID_1   1
 ID of UART 1. More...
 
#define NUMBER_UARTS   2
 Quantity of UARTs available. More...
 
#define SERIAL_SIGNAL_DELEGATE   0
 ID for serial delegate signals. More...
 
#define SERIAL_SIGNAL_COMMAND   1
 ID for serial command signals. More...
 
#define SERIAL_QUEUE_LEN   10
 Size of serial queue. More...
 

Typedefs

typedef Delegate< void(Stream &source, char arrivedChar, uint16_t availableCharsCount)> StreamDataReceivedDelegate
 Delegate callback type for serial data reception. More...
 

Enumerations

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
}
 

Variables

HardwareSerial Serial
 Global instance of serial port UART0. More...
 

Detailed Description

Hardware serial UARTs.

Macro Definition Documentation

#define NUMBER_UARTS   2

Quantity of UARTs available.

#define SERIAL_QUEUE_LEN   10

Size of serial queue.

#define SERIAL_SIGNAL_COMMAND   1

ID for serial command signals.

#define SERIAL_SIGNAL_DELEGATE   0

ID for serial delegate signals.

#define UART_ID_0   0

ID of UART 0.

#define UART_ID_1   1

ID of UART 1.

Typedef Documentation

typedef Delegate<void(Stream &source, char arrivedChar, uint16_t availableCharsCount)> StreamDataReceivedDelegate

Delegate callback type for serial data reception.

Parameters
sourceReference to serial stream
arrivedCharChar recieved
availableCharsCountQuantity of chars available stream in receive buffer

Variable Documentation

Global instance of serial port UART0.

Note
Use Serial.function to access serial functions
Example:
1 Serial.begin(115200);
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.