µOS++ IIIe Reference  v6.3.15
“Perfekt ist nicht gut genug”
The third edition of µOS++, a POSIX inspired open source system, written in C++.
os::driver::serial Namespace Reference

Classes

class  Capabilities
 Serial device driver capabilities. More...
 
class  Modem_status
 Serial modem status More...
 
class  Status
 Serial port status More...
 

Types

using bit_number_t = uint32_t
 
using config_arg_t = uint32_t
 
using config_t = uint32_t
 
using control_arg_t = uint32_t
 
using control_t = uint32_t
 
using modem_config_t = uint32_t
 

Enumerations

enum  Control : control_t {
  enable_tx = (0x15UL << CONFIG_Pos),
  enable_rx = (0x16UL << CONFIG_Pos),
  enable_break = (0x17UL << CONFIG_Pos),
  abort_send = (0x18UL << CONFIG_Pos),
  abort_receive = (0x19UL << CONFIG_Pos),
  abort_transfer = (0x1AUL << CONFIG_Pos),
  disable_tx = (0x25UL << CONFIG_Pos),
  disable_rx = (0x26UL << CONFIG_Pos),
  disable_break = (0x27UL << CONFIG_Pos)
}
 
enum  Event : event_t {
  send_complete = (1UL << 0),
  receive_complete = (1UL << 1),
  transfer_complete = (1UL << 2),
  tx_complete = (1UL << 3),
  tx_underflow = (1UL << 4),
  rx_overflow = (1UL << 5),
  rx_timeout = (1UL << 6),
  rx_break = (1UL << 7),
  rx_framing_error = (1UL << 8),
  rx_parity_error = (1UL << 9),
  cts = (1UL << 10),
  dsr = (1UL << 11),
  dcd = (1UL << 12),
  ri = (1UL << 13)
}
 Serial Events. More...
 
enum  Modem_control : modem_config_t {
  Modem_control::clear_rts,
  Modem_control::set_rts,
  Modem_control::clear_dtr,
  Modem_control::set_dtr
}
 Configuration to change the serial modem lines. More...
 

Functions

constexpr config_t CONFIG_Msk (0xFFUL<< CONFIG_Pos)
 

Variables

constexpr bit_number_t CONFIG_Pos = 0
 
constexpr config_t CPHA0 = (0UL << CPHA_Pos)
 CPHA = 1. More...
 
constexpr config_t CPHA1 = (1UL << CPHA_Pos)
 
constexpr config_t CPHA_Msk = (1UL << CPHA_Pos)
 CPHA = 0 = (default);. More...
 
constexpr bit_number_t CPHA_Pos = 19
 
constexpr config_t CPOL0 = (0UL << CPOL_Pos)
 CPOL = 1. More...
 
constexpr config_t CPOL1 = (1UL << CPOL_Pos)
 
constexpr config_t CPOL_Msk = (1UL << CPOL_Pos)
 CPOL = 0 = (default);. More...
 
constexpr bit_number_t CPOL_Pos = 18
 
constexpr config_t DATA_BITS_5 = (5UL << DATA_BITS_Pos)
 6 Data bit More...
 
constexpr config_t DATA_BITS_6 = (6UL << DATA_BITS_Pos)
 7 Data bits More...
 
constexpr config_t DATA_BITS_7 = (7UL << DATA_BITS_Pos)
 8 Data bits = (default); More...
 
constexpr config_t DATA_BITS_8 = (0UL << DATA_BITS_Pos)
 9 Data bits More...
 
constexpr config_t DATA_BITS_9 = (1UL << DATA_BITS_Pos)
 
constexpr config_t DATA_BITS_Msk = (7UL << DATA_BITS_Pos)
 5 Data bits More...
 
constexpr bit_number_t DATA_BITS_Pos = 8
 
constexpr config_t DEFAULT_TX_VALUE = (0x10UL << CONFIG_Pos)
 < Set default Transmit value = (Synchronous Receive only); arg = value More...
 
constexpr return_t ERROR_BAUDRATE = ERROR_SPECIFIC - 2
 Specified number of Data bits not supported. More...
 
constexpr return_t ERROR_CPHA = ERROR_SPECIFIC - 8
 
constexpr return_t ERROR_CPOL = ERROR_SPECIFIC - 7
 Specified Clock Phase not supported. More...
 
constexpr return_t ERROR_DATA_BITS = ERROR_SPECIFIC - 3
 Specified Parity not supported. More...
 
constexpr return_t ERROR_FLOW_CONTROL = ERROR_SPECIFIC - 6
 Specified Clock Polarity not supported. More...
 
constexpr return_t ERROR_MODE = ERROR_SPECIFIC - 1
 < Specified Mode not supported More...
 
constexpr return_t ERROR_PARITY = ERROR_SPECIFIC - 4
 Specified number of Stop bits not supported. More...
 
constexpr return_t ERROR_STOP_BITS = ERROR_SPECIFIC - 5
 Specified Flow Control not supported. More...
 
constexpr bit_number_t FLOW_CONFIG_Pos = 16
 
constexpr config_t FLOW_CONTROL_CTS = (2UL << FLOW_CONFIG_Pos)
 RTS/CTS Flow Control. More...
 
constexpr config_t FLOW_CONTROL_Msk = (3UL << FLOW_CONFIG_Pos)
 No Flow Control = (default);. More...
 
constexpr config_t FLOW_CONTROL_NONE = (0UL << FLOW_CONFIG_Pos)
 RTS Flow Control. More...
 
constexpr config_t FLOW_CONTROL_RTS = (1UL << FLOW_CONFIG_Pos)
 CTS Flow Control. More...
 
constexpr config_t FLOW_CONTROL_RTS_CTS = (3UL << FLOW_CONFIG_Pos)
 
constexpr config_t IRDA_PULSE = (0x11UL << CONFIG_Pos)
 Set Smart Card Guard Time; arg = number of bit periods. More...
 
constexpr config_t MODE_ASYNCHRONOUS = (0x01UL << CONFIG_Pos)
 < UART = (Asynchronous);; arg = Baudrate More...
 
constexpr config_t MODE_IRDA = (0x05UL << CONFIG_Pos)
 UART Smart Card; arg = Baudrate. More...
 
constexpr config_t MODE_SINGLE_WIRE = (0x04UL << CONFIG_Pos)
 UART IrDA; arg = Baudrate. More...
 
constexpr config_t MODE_SMART_CARD = (0x06UL << CONFIG_Pos)
 
constexpr config_t MODE_SYNCHRONOUS_MASTER = (0x02UL << CONFIG_Pos)
 Synchronous Slave = (external clock signal);. More...
 
constexpr config_t MODE_SYNCHRONOUS_SLAVE = (0x03UL << CONFIG_Pos)
 UART Single-wire = (half-duplex);; arg = Baudrate. More...
 
constexpr config_t PARITY_EVEN = (1UL << PARITY_Pos)
 Odd Parity. More...
 
constexpr config_t PARITY_Msk = (3UL << PARITY_Pos)
 No Parity = (default);. More...
 
constexpr config_t PARITY_NONE = (0UL << PARITY_Pos)
 Even Parity. More...
 
constexpr config_t PARITY_ODD = (2UL << PARITY_Pos)
 
constexpr bit_number_t PARITY_Pos = 12
 
constexpr config_t SMART_CARD_CLOCK = (0x13UL << CONFIG_Pos)
 Smart Card NACK generation; arg: 0=disabled, 1=enabled. More...
 
constexpr config_t SMART_CARD_GUARD_TIME = (0x12UL << CONFIG_Pos)
 Set Smart Card Clock in Hz; arg: 0=Clock not generated. More...
 
constexpr config_t SMART_CARD_NACK = (0x14UL << CONFIG_Pos)
 
constexpr config_t STOP_BITS_0_5 = (3UL << STOP_BITS_Pos)
 
constexpr config_t STOP_BITS_1 = (0UL << STOP_BITS_Pos)
 2 Stop bits More...
 
constexpr config_t STOP_BITS_1_5 = (2UL << STOP_BITS_Pos)
 0.5 Stop bits More...
 
constexpr config_t STOP_BITS_2 = (1UL << STOP_BITS_Pos)
 1.5 Stop bits More...
 
constexpr config_t STOP_BITS_Msk = (3UL << STOP_BITS_Pos)
 1 Stop bit = (default); More...
 
constexpr bit_number_t STOP_BITS_Pos = 14
 

Types

◆ bit_number_t

using os::driver::serial::bit_number_t = typedef uint32_t

Definition at line 54 of file serial.h.

◆ config_arg_t

using os::driver::serial::config_arg_t = typedef uint32_t

Definition at line 56 of file serial.h.

◆ config_t

using os::driver::serial::config_t = typedef uint32_t

Definition at line 55 of file serial.h.

◆ control_arg_t

using os::driver::serial::control_arg_t = typedef uint32_t

Definition at line 58 of file serial.h.

◆ control_t

using os::driver::serial::control_t = typedef uint32_t

Definition at line 57 of file serial.h.

◆ modem_config_t

using os::driver::serial::modem_config_t = typedef uint32_t

Definition at line 315 of file serial.h.

Enumeration Type Documentation

◆ Control

Enumerator
enable_tx 

Enable Transmitter.

Enable Receiver

enable_rx 

Enable Continuous Break transmission.

enable_break 

Abort Serial::send()

abort_send 

Abort Serial::receive()

abort_receive 

Abort Serial::transfer()

abort_transfer 

Disable Transmitter.

disable_tx 

Disable Receiver.

disable_rx 

Disable Continuous Break transmission;.

disable_break 

Definition at line 188 of file serial.h.

◆ Event

Serial Events.

Enumerator
send_complete 

Send completed; however USART may still transmit data.

Receive completed

receive_complete 

Transfer completed.

transfer_complete 

Transmit completed (optional)

tx_complete 

Transmit data not available (Synchronous Slave)

tx_underflow 

Receive data overflow.

rx_overflow 

Receive character timeout (optional)

rx_timeout 

Break detected on receive.

rx_break 

Framing error detected on receive.

rx_framing_error 

Parity error detected on receive.

rx_parity_error 

CTS state changed (optional)

cts 

DSR state changed (optional)

dsr 

DCD state changed (optional)

dcd 

RI state changed (optional)

ri 

Definition at line 389 of file serial.h.

◆ Modem_control

Configuration to change the serial modem lines.

Enumerator
clear_rts 

Deactivate RTS.

Activate RTS

set_rts 

Deactivate DTR.

clear_dtr 

Activate DTR.

set_dtr 

Definition at line 320 of file serial.h.

Function Documentation

◆ CONFIG_Msk()

constexpr config_t os::driver::serial::CONFIG_Msk ( 0xFFUL<<  CONFIG_Pos)

Variable Documentation

◆ CONFIG_Pos

constexpr bit_number_t os::driver::serial::CONFIG_Pos = 0

Definition at line 62 of file serial.h.

◆ CPHA0

constexpr config_t os::driver::serial::CPHA0 = (0UL << CPHA_Pos)

CPHA = 1.

Definition at line 163 of file serial.h.

◆ CPHA1

constexpr config_t os::driver::serial::CPHA1 = (1UL << CPHA_Pos)

Definition at line 166 of file serial.h.

◆ CPHA_Msk

constexpr config_t os::driver::serial::CPHA_Msk = (1UL << CPHA_Pos)

CPHA = 0 = (default);.

Definition at line 160 of file serial.h.

◆ CPHA_Pos

constexpr bit_number_t os::driver::serial::CPHA_Pos = 19

Definition at line 159 of file serial.h.

◆ CPOL0

constexpr config_t os::driver::serial::CPOL0 = (0UL << CPOL_Pos)

CPOL = 1.

Definition at line 153 of file serial.h.

◆ CPOL1

constexpr config_t os::driver::serial::CPOL1 = (1UL << CPOL_Pos)

Definition at line 156 of file serial.h.

◆ CPOL_Msk

constexpr config_t os::driver::serial::CPOL_Msk = (1UL << CPOL_Pos)

CPOL = 0 = (default);.

Definition at line 150 of file serial.h.

◆ CPOL_Pos

constexpr bit_number_t os::driver::serial::CPOL_Pos = 18

Definition at line 149 of file serial.h.

◆ DATA_BITS_5

constexpr config_t os::driver::serial::DATA_BITS_5 = (5UL << DATA_BITS_Pos)

6 Data bit

Definition at line 89 of file serial.h.

◆ DATA_BITS_6

constexpr config_t os::driver::serial::DATA_BITS_6 = (6UL << DATA_BITS_Pos)

7 Data bits

Definition at line 92 of file serial.h.

◆ DATA_BITS_7

constexpr config_t os::driver::serial::DATA_BITS_7 = (7UL << DATA_BITS_Pos)

8 Data bits = (default);

Definition at line 95 of file serial.h.

◆ DATA_BITS_8

constexpr config_t os::driver::serial::DATA_BITS_8 = (0UL << DATA_BITS_Pos)

9 Data bits

Definition at line 98 of file serial.h.

◆ DATA_BITS_9

constexpr config_t os::driver::serial::DATA_BITS_9 = (1UL << DATA_BITS_Pos)

Definition at line 101 of file serial.h.

◆ DATA_BITS_Msk

constexpr config_t os::driver::serial::DATA_BITS_Msk = (7UL << DATA_BITS_Pos)

5 Data bits

Definition at line 86 of file serial.h.

◆ DATA_BITS_Pos

constexpr bit_number_t os::driver::serial::DATA_BITS_Pos = 8

Definition at line 85 of file serial.h.

◆ DEFAULT_TX_VALUE

constexpr config_t os::driver::serial::DEFAULT_TX_VALUE = (0x10UL << CONFIG_Pos)

< Set default Transmit value = (Synchronous Receive only); arg = value

Set IrDA Pulse in ns; arg: 0=3/16 of bit period

Definition at line 171 of file serial.h.

◆ ERROR_BAUDRATE

constexpr return_t os::driver::serial::ERROR_BAUDRATE = ERROR_SPECIFIC - 2

Specified number of Data bits not supported.

Definition at line 227 of file serial.h.

◆ ERROR_CPHA

constexpr return_t os::driver::serial::ERROR_CPHA = ERROR_SPECIFIC - 8

Definition at line 245 of file serial.h.

◆ ERROR_CPOL

constexpr return_t os::driver::serial::ERROR_CPOL = ERROR_SPECIFIC - 7

Specified Clock Phase not supported.

Definition at line 242 of file serial.h.

◆ ERROR_DATA_BITS

constexpr return_t os::driver::serial::ERROR_DATA_BITS = ERROR_SPECIFIC - 3

Specified Parity not supported.

Definition at line 230 of file serial.h.

◆ ERROR_FLOW_CONTROL

constexpr return_t os::driver::serial::ERROR_FLOW_CONTROL = ERROR_SPECIFIC - 6

Specified Clock Polarity not supported.

Definition at line 239 of file serial.h.

◆ ERROR_MODE

constexpr return_t os::driver::serial::ERROR_MODE = ERROR_SPECIFIC - 1

< Specified Mode not supported

Specified baudrate not supported

Definition at line 224 of file serial.h.

◆ ERROR_PARITY

constexpr return_t os::driver::serial::ERROR_PARITY = ERROR_SPECIFIC - 4

Specified number of Stop bits not supported.

Definition at line 233 of file serial.h.

◆ ERROR_STOP_BITS

constexpr return_t os::driver::serial::ERROR_STOP_BITS = ERROR_SPECIFIC - 5

Specified Flow Control not supported.

Definition at line 236 of file serial.h.

◆ FLOW_CONFIG_Pos

constexpr bit_number_t os::driver::serial::FLOW_CONFIG_Pos = 16

Definition at line 133 of file serial.h.

◆ FLOW_CONTROL_CTS

constexpr config_t os::driver::serial::FLOW_CONTROL_CTS = (2UL << FLOW_CONFIG_Pos)

RTS/CTS Flow Control.

Definition at line 143 of file serial.h.

◆ FLOW_CONTROL_Msk

constexpr config_t os::driver::serial::FLOW_CONTROL_Msk = (3UL << FLOW_CONFIG_Pos)

No Flow Control = (default);.

Definition at line 134 of file serial.h.

◆ FLOW_CONTROL_NONE

constexpr config_t os::driver::serial::FLOW_CONTROL_NONE = (0UL << FLOW_CONFIG_Pos)

RTS Flow Control.

Definition at line 137 of file serial.h.

◆ FLOW_CONTROL_RTS

constexpr config_t os::driver::serial::FLOW_CONTROL_RTS = (1UL << FLOW_CONFIG_Pos)

CTS Flow Control.

Definition at line 140 of file serial.h.

◆ FLOW_CONTROL_RTS_CTS

constexpr config_t os::driver::serial::FLOW_CONTROL_RTS_CTS = (3UL << FLOW_CONFIG_Pos)

Definition at line 146 of file serial.h.

◆ IRDA_PULSE

constexpr config_t os::driver::serial::IRDA_PULSE = (0x11UL << CONFIG_Pos)

Set Smart Card Guard Time; arg = number of bit periods.

Definition at line 174 of file serial.h.

◆ MODE_ASYNCHRONOUS

constexpr config_t os::driver::serial::MODE_ASYNCHRONOUS = (0x01UL << CONFIG_Pos)

< UART = (Asynchronous);; arg = Baudrate

Synchronous Master = (generates clock signal); arg = Baudrate

Definition at line 67 of file serial.h.

◆ MODE_IRDA

constexpr config_t os::driver::serial::MODE_IRDA = (0x05UL << CONFIG_Pos)

UART Smart Card; arg = Baudrate.

Definition at line 79 of file serial.h.

◆ MODE_SINGLE_WIRE

constexpr config_t os::driver::serial::MODE_SINGLE_WIRE = (0x04UL << CONFIG_Pos)

UART IrDA; arg = Baudrate.

Definition at line 76 of file serial.h.

◆ MODE_SMART_CARD

constexpr config_t os::driver::serial::MODE_SMART_CARD = (0x06UL << CONFIG_Pos)

Definition at line 82 of file serial.h.

◆ MODE_SYNCHRONOUS_MASTER

constexpr config_t os::driver::serial::MODE_SYNCHRONOUS_MASTER = (0x02UL << CONFIG_Pos)

Synchronous Slave = (external clock signal);.

Definition at line 70 of file serial.h.

◆ MODE_SYNCHRONOUS_SLAVE

constexpr config_t os::driver::serial::MODE_SYNCHRONOUS_SLAVE = (0x03UL << CONFIG_Pos)

UART Single-wire = (half-duplex);; arg = Baudrate.

Definition at line 73 of file serial.h.

◆ PARITY_EVEN

constexpr config_t os::driver::serial::PARITY_EVEN = (1UL << PARITY_Pos)

Odd Parity.

Definition at line 111 of file serial.h.

◆ PARITY_Msk

constexpr config_t os::driver::serial::PARITY_Msk = (3UL << PARITY_Pos)

No Parity = (default);.

Definition at line 105 of file serial.h.

◆ PARITY_NONE

constexpr config_t os::driver::serial::PARITY_NONE = (0UL << PARITY_Pos)

Even Parity.

Definition at line 108 of file serial.h.

◆ PARITY_ODD

constexpr config_t os::driver::serial::PARITY_ODD = (2UL << PARITY_Pos)

Definition at line 114 of file serial.h.

◆ PARITY_Pos

constexpr bit_number_t os::driver::serial::PARITY_Pos = 12

Definition at line 104 of file serial.h.

◆ SMART_CARD_CLOCK

constexpr config_t os::driver::serial::SMART_CARD_CLOCK = (0x13UL << CONFIG_Pos)

Smart Card NACK generation; arg: 0=disabled, 1=enabled.

Definition at line 180 of file serial.h.

◆ SMART_CARD_GUARD_TIME

constexpr config_t os::driver::serial::SMART_CARD_GUARD_TIME = (0x12UL << CONFIG_Pos)

Set Smart Card Clock in Hz; arg: 0=Clock not generated.

Definition at line 177 of file serial.h.

◆ SMART_CARD_NACK

constexpr config_t os::driver::serial::SMART_CARD_NACK = (0x14UL << CONFIG_Pos)

Definition at line 183 of file serial.h.

◆ STOP_BITS_0_5

constexpr config_t os::driver::serial::STOP_BITS_0_5 = (3UL << STOP_BITS_Pos)

Definition at line 130 of file serial.h.

◆ STOP_BITS_1

constexpr config_t os::driver::serial::STOP_BITS_1 = (0UL << STOP_BITS_Pos)

2 Stop bits

Definition at line 121 of file serial.h.

◆ STOP_BITS_1_5

constexpr config_t os::driver::serial::STOP_BITS_1_5 = (2UL << STOP_BITS_Pos)

0.5 Stop bits

Definition at line 127 of file serial.h.

◆ STOP_BITS_2

constexpr config_t os::driver::serial::STOP_BITS_2 = (1UL << STOP_BITS_Pos)

1.5 Stop bits

Definition at line 124 of file serial.h.

◆ STOP_BITS_Msk

constexpr config_t os::driver::serial::STOP_BITS_Msk = (3UL << STOP_BITS_Pos)

1 Stop bit = (default);

Definition at line 118 of file serial.h.

◆ STOP_BITS_Pos

constexpr bit_number_t os::driver::serial::STOP_BITS_Pos = 14

Definition at line 117 of file serial.h.