SerialPort Class
Package: GHIElectronics.Endpoint.Core
Namespace: GHIElectronics.Endpoint.Core
The serial ports (UARTs) bundled with EPM815, for .NET's System.IO.Ports. SerialPort.Initialize connects the port's pins; then use SerialPort as usual.
class SerialPort {};
Methods
Initialize(string portName, bool enableHardwareFlowControl)
static void Initialize(const std::string& portName, bool enableHardwareFlowControl);
Connects the port's TX and RX pins, and RTS and CTS for hardware flow control
| Parameter | Type | Description |
|---|---|---|
portName | string | Uart1 ... Uart8 |
enableHardwareFlowControl | bool | Also connect RTS and CTS (UART1, 2, 3 and 7) |
UnInitialize(string portName)
static void UnInitialize(const std::string& portName);
Gives the port's pins back, as they were before Initialize
UnInitialize(string portName, bool enabledHardwareFlowControl)
⚠️ Obsolete. The flow control setting is remembered from Initialize: use UnInitialize(portName)
static void UnInitialize(const std::string& portName, bool enabledHardwareFlowControl);
Gives the port's pins back, as they were before Initialize
Fields
Uart1
static constexpr std::string Uart1 = "/dev/ttySTM0";
UART1: PZ7 (TX), PZ6 (RX), PA12 (RTS), PZ3 (CTS)
Uart2
static constexpr std::string Uart2 = "/dev/ttySTM1";
UART2: PF5 (TX), PD6 (RX), PD4 (RTS), PD3 (CTS)
Uart3
static constexpr std::string Uart3 = "/dev/ttySTM2";
UART3: PD8 (TX), PD9 (RX), PD12 (RTS), PD11 (CTS)
Uart4
static constexpr std::string Uart4 = "/dev/ttySTM3";
UART4: PD1 (TX), PD0 (RX)
Uart5
static constexpr std::string Uart5 = "/dev/ttySTM4";
UART5: PB13 (TX), PB12 (RX)
Uart7
static constexpr std::string Uart7 = "/dev/ttySTM6";
UART7: PE8 (TX), PF6 (RX), PE9 (RTS), PE10 (CTS)
Uart8
static constexpr std::string Uart8 = "/dev/ttySTM7";
UART8: PE1 (TX), PE0 (RX)