Skip to main content

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.

public static class SerialPort

Methods​

Initialize(string portName, bool enableHardwareFlowControl)​

public static void Initialize(string portName, bool enableHardwareFlowControl)

Connects the port's TX and RX pins, and RTS and CTS for hardware flow control

ParameterTypeDescription
portNamestringUart1 ... Uart8
enableHardwareFlowControlboolAlso connect RTS and CTS (UART1, 2, 3 and 7)

UnInitialize(string portName)​

public static void UnInitialize(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)

public static void UnInitialize(string portName, bool enabledHardwareFlowControl)

Gives the port's pins back, as they were before Initialize

Fields​

Uart1​

public const string Uart1 = "/dev/ttySTM0"

UART1: PZ7 (TX), PZ6 (RX), PA12 (RTS), PZ3 (CTS)

Uart2​

public const string Uart2 = "/dev/ttySTM1"

UART2: PF5 (TX), PD6 (RX), PD4 (RTS), PD3 (CTS)

Uart3​

public const string Uart3 = "/dev/ttySTM2"

UART3: PD8 (TX), PD9 (RX), PD12 (RTS), PD11 (CTS)

Uart4​

public const string Uart4 = "/dev/ttySTM3"

UART4: PD1 (TX), PD0 (RX)

Uart5​

public const string Uart5 = "/dev/ttySTM4"

UART5: PB13 (TX), PB12 (RX)

Uart7​

public const string Uart7 = "/dev/ttySTM6"

UART7: PE8 (TX), PF6 (RX), PE9 (RTS), PE10 (CTS)

Uart8​

public const string Uart8 = "/dev/ttySTM7"

UART8: PE1 (TX), PE0 (RX)