µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
serial.h File Reference
#include <cmsis-plus/driver/common.h>
#include <cstdint>
#include <cstddef>

Go to the source code of this file.

Classes

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

Namespaces

namespace  os
 System namespace.
 
namespace  os::driver
 
namespace  os::driver::serial
 

Typedefs

using os::driver::serial::bit_number_t = uint32_t
 
using os::driver::serial::config_arg_t = uint32_t
 
using os::driver::serial::config_t = uint32_t
 
using os::driver::serial::control_arg_t = uint32_t
 
using os::driver::serial::control_t = uint32_t
 
using os::driver::serial::modem_config_t = uint32_t
 

Enumerations

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

Functions

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

Variables

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