µ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::usart_wrapper Class Reference

#include <usart-wrapper.h>

Inherits os::driver::Serial.

Public Member Functions

 usart_wrapper (ARM_DRIVER_USART *driver, ARM_USART_SignalEvent_t c_cb_func) noexcept
 
 usart_wrapper (const usart_wrapper &)=delete
 
 usart_wrapper (usart_wrapper &&)=delete
 
virtual ~usart_wrapper () noexcept
 
void clean (void) noexcept
 
return_t configure (serial::config_t cfg, serial::config_arg_t arg) noexcept
 Configure the serial interface. More...
 
return_t control (serial::control_t ctrl) noexcept
 Control the serial interface. More...
 
return_t control_modem_line (serial::Modem_control ctrl) noexcept
 Configure serial modem lines. More...
 
const serial::Capabilitiesget_capabilities (void) noexcept
 Get driver capabilities. More...
 
serial::Modem_statusget_modem_status (void) noexcept
 Get serial modem lines state. More...
 
std::size_t get_rx_count (void) noexcept
 Get received bytes count. More...
 
serial::Statusget_status (void) noexcept
 Get serial port status. More...
 
std::size_t get_tx_count (void) noexcept
 Get transmitted bytes count. More...
 
const Versionget_version (void) noexcept
 Get driver version. More...
 
usart_wrapperoperator= (const usart_wrapper &)=delete
 
usart_wrapperoperator= (usart_wrapper &&)=delete
 
return_t power (Power state) noexcept
 Power up/down device. More...
 
return_t receive (void *data, std::size_t num) noexcept
 Start the serial receiver. More...
 
void register_callback (signal_event_t cb_func, const void *cb_object=nullptr) noexcept
 Register event callback. More...
 
return_t send (const void *data, std::size_t num) noexcept
 Start the serial transmitter. More...
 
void signal_event (event_t event) noexcept
 Signal serial events. More...
 
return_t transfer (const void *data_out, void *data_in, std::size_t num) noexcept
 Start sending/receiving data to/from the serial transmitter/receiver. More...
 

Protected Member Functions

virtual return_t do_configure (serial::config_t ctrl, serial::config_arg_t arg) noexcept override
 
virtual return_t do_control (serial::control_t ctrl) noexcept override
 
virtual return_t do_control_modem_line (serial::Modem_control ctrl) noexcept override
 
virtual const serial::Capabilitiesdo_get_capabilities (void) noexcept override
 
virtual serial::Modem_statusdo_get_modem_status (void) noexcept override
 
virtual std::size_t do_get_rx_count (void) noexcept override
 
virtual serial::Statusdo_get_status (void) noexcept override
 
virtual std::size_t do_get_tx_count (void) noexcept override
 
virtual const Versiondo_get_version (void) noexcept override
 
virtual return_t do_power (Power state) noexcept override
 
virtual return_t do_receive (void *data, std::size_t num) noexcept override
 
virtual return_t do_send (const void *data, std::size_t num) noexcept override
 
virtual return_t do_transfer (const void *data_out, void *data_in, std::size_t num) noexcept override
 

Protected Attributes

signal_event_t cb_func_
 Pointer to static function that implements the callback. More...
 
const void * cb_object_
 Pointer to object instance associated with this driver. More...
 

Private Attributes

ARM_USART_SignalEvent_t c_cb_func_
 
serial::Capabilities capa_
 
ARM_DRIVER_USARTdriver_
 Pointer to CMSIS USART Keil driver. More...
 
serial::Modem_status modem_status_
 
serial::Status status_
 
Version version_ { 0, 0 }
 

Detailed Description

Definition at line 56 of file usart-wrapper.h.

Constructor & Destructor Documentation

◆ usart_wrapper() [1/3]

os::driver::usart_wrapper::usart_wrapper ( ARM_DRIVER_USART driver,
ARM_USART_SignalEvent_t  c_cb_func 
)
noexcept

Definition at line 43 of file usart-wrapper.cpp.

◆ usart_wrapper() [2/3]

os::driver::usart_wrapper::usart_wrapper ( const usart_wrapper )
delete

◆ usart_wrapper() [3/3]

os::driver::usart_wrapper::usart_wrapper ( usart_wrapper &&  )
delete

◆ ~usart_wrapper()

os::driver::usart_wrapper::~usart_wrapper ( )
virtualnoexcept

Definition at line 51 of file usart-wrapper.cpp.

Member Function Documentation

◆ clean()

void os::driver::Serial::clean ( void  )
noexceptinherited

Definition at line 65 of file serial.cpp.

◆ configure()

return_t os::driver::Serial::configure ( serial::config_t  cfg,
serial::config_arg_t  arg 
)
inlinenoexceptinherited

Configure the serial interface.

Parameters
[in]cfgOperation
[in]argArgument of operation (optional)
Returns
Common execution status and driver specific usart_execution_status

Definition at line 811 of file serial.h.

◆ control()

return_t os::driver::Serial::control ( serial::control_t  ctrl)
inlinenoexceptinherited

Control the serial interface.

Parameters
[in]ctrlOperation
Returns
Common execution status and driver specific usart_execution_status

Definition at line 817 of file serial.h.

◆ control_modem_line()

return_t os::driver::Serial::control_modem_line ( serial::Modem_control  ctrl)
inlinenoexceptinherited

Configure serial modem lines.

Parameters
[in]ctrlControl.
Returns
Execution status.

Definition at line 829 of file serial.h.

◆ do_configure()

return_t os::driver::usart_wrapper::do_configure ( serial::config_t  ctrl,
serial::config_arg_t  arg 
)
overrideprotectedvirtualnoexcept

Implements os::driver::Serial.

Definition at line 157 of file usart-wrapper.cpp.

◆ do_control()

return_t os::driver::usart_wrapper::do_control ( serial::control_t  ctrl)
overrideprotectedvirtualnoexcept

Implements os::driver::Serial.

Definition at line 163 of file usart-wrapper.cpp.

◆ do_control_modem_line()

return_t os::driver::usart_wrapper::do_control_modem_line ( serial::Modem_control  ctrl)
overrideprotectedvirtualnoexcept

Implements os::driver::Serial.

Definition at line 178 of file usart-wrapper.cpp.

◆ do_get_capabilities()

const serial::Capabilities & os::driver::usart_wrapper::do_get_capabilities ( void  )
overrideprotectedvirtualnoexcept

Implements os::driver::Serial.

Definition at line 74 of file usart-wrapper.cpp.

◆ do_get_modem_status()

serial::Modem_status & os::driver::usart_wrapper::do_get_modem_status ( void  )
overrideprotectedvirtualnoexcept

Implements os::driver::Serial.

Definition at line 91 of file usart-wrapper.cpp.

◆ do_get_rx_count()

std::size_t os::driver::usart_wrapper::do_get_rx_count ( void  )
overrideprotectedvirtualnoexcept

Implements os::driver::Serial.

Definition at line 151 of file usart-wrapper.cpp.

◆ do_get_status()

serial::Status & os::driver::usart_wrapper::do_get_status ( void  )
overrideprotectedvirtualnoexcept

Implements os::driver::Serial.

Definition at line 83 of file usart-wrapper.cpp.

◆ do_get_tx_count()

std::size_t os::driver::usart_wrapper::do_get_tx_count ( void  )
overrideprotectedvirtualnoexcept

Implements os::driver::Serial.

Definition at line 145 of file usart-wrapper.cpp.

◆ do_get_version()

const Version & os::driver::usart_wrapper::do_get_version ( void  )
overrideprotectedvirtualnoexcept

Implements os::driver::Base.

Definition at line 65 of file usart-wrapper.cpp.

◆ do_power()

return_t os::driver::usart_wrapper::do_power ( Power  state)
overrideprotectedvirtualnoexcept

Implements os::driver::Base.

Definition at line 102 of file usart-wrapper.cpp.

◆ do_receive()

return_t os::driver::usart_wrapper::do_receive ( void *  data,
std::size_t  num 
)
overrideprotectedvirtualnoexcept

Implements os::driver::Serial.

Definition at line 132 of file usart-wrapper.cpp.

◆ do_send()

return_t os::driver::usart_wrapper::do_send ( const void *  data,
std::size_t  num 
)
overrideprotectedvirtualnoexcept

Implements os::driver::Serial.

Definition at line 126 of file usart-wrapper.cpp.

◆ do_transfer()

return_t os::driver::usart_wrapper::do_transfer ( const void *  data_out,
void *  data_in,
std::size_t  num 
)
overrideprotectedvirtualnoexcept

Implements os::driver::Serial.

Definition at line 138 of file usart-wrapper.cpp.

◆ get_capabilities()

const serial::Capabilities & os::driver::Serial::get_capabilities ( void  )
inlinenoexceptinherited

Get driver capabilities.

Returns
Capabilities.

Definition at line 793 of file serial.h.

◆ get_modem_status()

serial::Modem_status & os::driver::Serial::get_modem_status ( void  )
inlinenoexceptinherited

Get serial modem lines state.

Returns
Modem status.

Definition at line 835 of file serial.h.

◆ get_rx_count()

std::size_t os::driver::Serial::get_rx_count ( void  )
inlinenoexceptinherited

Get received bytes count.

Returns
number of bytes received

Definition at line 805 of file serial.h.

◆ get_status()

serial::Status & os::driver::Serial::get_status ( void  )
inlinenoexceptinherited

Get serial port status.

Returns
Serial status.

Definition at line 823 of file serial.h.

◆ get_tx_count()

std::size_t os::driver::Serial::get_tx_count ( void  )
inlinenoexceptinherited

Get transmitted bytes count.

Returns
number of bytes transmitted

Definition at line 799 of file serial.h.

◆ get_version()

const Version & os::driver::Base::get_version ( void  )
inlinenoexceptinherited

Get driver version.

Returns
Version.

Definition at line 201 of file common.h.

◆ operator=() [1/2]

usart_wrapper& os::driver::usart_wrapper::operator= ( const usart_wrapper )
delete

◆ operator=() [2/2]

usart_wrapper& os::driver::usart_wrapper::operator= ( usart_wrapper &&  )
delete

◆ power()

return_t os::driver::Base::power ( Power  state)
inlinenoexceptinherited

Power up/down device.

Parameters
[in]statePower state
Returns
Execution status

Definition at line 207 of file common.h.

◆ receive()

return_t os::driver::Serial::receive ( void *  data,
std::size_t  num 
)
noexceptinherited

Start the serial receiver.

Parameters
[out]dataPointer to buffer for data to receive from USART receiver
[in]numNumber of data items to receive
Returns
Execution status

Definition at line 102 of file serial.cpp.

◆ register_callback()

void os::driver::Serial::register_callback ( signal_event_t  cb_func,
const void *  cb_object = nullptr 
)
noexceptinherited

Register event callback.

Parameters
[in]cb_funcPointer to function.
[in]cb_objectPointer to object passed to function.
Returns
Execution status

Definition at line 84 of file serial.cpp.

◆ send()

return_t os::driver::Serial::send ( const void *  data,
std::size_t  num 
)
noexceptinherited

Start the serial transmitter.

Parameters
[in]dataPointer to buffer with data to send to USART transmitter.
[in]numNumber of data items to send.
Returns
Execution status

Definition at line 91 of file serial.cpp.

◆ signal_event()

void os::driver::Serial::signal_event ( event_t  event)
inlinenoexceptinherited

Signal serial events.

Parameters
[in]eventEvent notification mask.
Returns
none

Definition at line 841 of file serial.h.

◆ transfer()

return_t os::driver::Serial::transfer ( const void *  data_out,
void *  data_in,
std::size_t  num 
)
noexceptinherited

Start sending/receiving data to/from the serial transmitter/receiver.

Parameters
[in]data_outPointer to buffer with data to send
[out]data_inPointer to buffer for data to receive
[in]numNumber of bytes to transfer
Returns
Execution status

Definition at line 113 of file serial.cpp.

Member Data Documentation

◆ c_cb_func_

ARM_USART_SignalEvent_t os::driver::usart_wrapper::c_cb_func_
private

Pointer to non-reentrant callback. Must be stored because Initialize() is now delayed just before PowerControl(FULL).

Definition at line 132 of file usart-wrapper.h.

◆ capa_

serial::Capabilities os::driver::usart_wrapper::capa_
private

Definition at line 143 of file usart-wrapper.h.

◆ cb_func_

signal_event_t os::driver::Serial::cb_func_
protectedinherited

Pointer to static function that implements the callback.

Definition at line 702 of file serial.h.

◆ cb_object_

const void* os::driver::Serial::cb_object_
protectedinherited

Pointer to object instance associated with this driver.

Definition at line 705 of file serial.h.

◆ driver_

ARM_DRIVER_USART* os::driver::usart_wrapper::driver_
private

Pointer to CMSIS USART Keil driver.

Definition at line 128 of file usart-wrapper.h.

◆ modem_status_

serial::Modem_status os::driver::usart_wrapper::modem_status_
private

Definition at line 145 of file usart-wrapper.h.

◆ status_

serial::Status os::driver::usart_wrapper::status_
private

Definition at line 144 of file usart-wrapper.h.

◆ version_

Version os::driver::usart_wrapper::version_ { 0, 0 }
private

Definition at line 142 of file usart-wrapper.h.


The documentation for this class was generated from the following files: