µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
os::driver::Serial Class Referenceabstract

#include <serial.h>

+ Inheritance diagram for os::driver::Serial:

Public Member Functions

 Serial () noexcept
 
 Serial (const Serial &)=delete
 
 Serial (Serial &&)=delete
 
virtual ~Serial () noexcept override
 
void clean (void) noexcept
 
return_t configure (serial::config_t cfg, serial::config_arg_t arg) noexcept
 Configure the serial interface.
 
return_t control (serial::control_t ctrl) noexcept
 Control the serial interface.
 
return_t control_modem_line (serial::Modem_control ctrl) noexcept
 Configure serial modem lines.
 
const serial::Capabilitiesget_capabilities (void) noexcept
 Get driver capabilities.
 
serial::Modem_statusget_modem_status (void) noexcept
 Get serial modem lines state.
 
std::size_t get_rx_count (void) noexcept
 Get received bytes count.
 
serial::Statusget_status (void) noexcept
 Get serial port status.
 
std::size_t get_tx_count (void) noexcept
 Get transmitted bytes count.
 
const Versionget_version (void) noexcept
 Get driver version.
 
Serialoperator= (const Serial &)=delete
 
Serialoperator= (Serial &&)=delete
 
return_t power (Power state) noexcept
 Power up/down device.
 
return_t receive (void *data, std::size_t num) noexcept
 Start the serial receiver.
 
void register_callback (signal_event_t cb_func, const void *cb_object=nullptr) noexcept
 Register event callback.
 
return_t send (const void *data, std::size_t num) noexcept
 Start the serial transmitter.
 
void signal_event (event_t event) noexcept
 Signal serial events.
 
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.
 

Protected Member Functions

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

Protected Attributes

signal_event_t cb_func_
 Pointer to static function that implements the callback.
 
const void * cb_object_
 Pointer to object instance associated with this driver.
 
serial::Modem_status modem_status_
 
serial::Status status_
 

Detailed Description

Definition at line 537 of file serial.h.

Constructor & Destructor Documentation

◆ Serial() [1/3]

os::driver::Serial::Serial ( )
noexcept

Definition at line 53 of file serial.cpp.

◆ Serial() [2/3]

os::driver::Serial::Serial ( const Serial )
delete

◆ Serial() [3/3]

os::driver::Serial::Serial ( Serial &&  )
delete

◆ ~Serial()

os::driver::Serial::~Serial ( )
overridevirtualnoexcept

Definition at line 63 of file serial.cpp.

Member Function Documentation

◆ clean()

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

Definition at line 71 of file serial.cpp.

◆ configure()

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

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 825 of file serial.h.

◆ control()

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

Control the serial interface.

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

Definition at line 831 of file serial.h.

◆ control_modem_line()

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

Configure serial modem lines.

Parameters
[in]ctrlControl.
Returns
Execution status.

Definition at line 843 of file serial.h.

◆ do_configure()

virtual return_t os::driver::Serial::do_configure ( serial::config_t  cfg,
serial::config_arg_t  arg 
)
protectedpure virtualnoexcept

Implemented in os::driver::usart_wrapper.

◆ do_control()

virtual return_t os::driver::Serial::do_control ( serial::control_t  ctrl)
protectedpure virtualnoexcept

Implemented in os::driver::usart_wrapper.

◆ do_control_modem_line()

virtual return_t os::driver::Serial::do_control_modem_line ( serial::Modem_control  ctrl)
protectedpure virtualnoexcept

Implemented in os::driver::usart_wrapper.

◆ do_get_capabilities()

virtual const serial::Capabilities & os::driver::Serial::do_get_capabilities ( void  )
protectedpure virtualnoexcept

Implemented in os::driver::usart_wrapper.

◆ do_get_modem_status()

virtual serial::Modem_status & os::driver::Serial::do_get_modem_status ( void  )
protectedpure virtualnoexcept

Implemented in os::driver::usart_wrapper.

◆ do_get_rx_count()

virtual std::size_t os::driver::Serial::do_get_rx_count ( void  )
protectedpure virtualnoexcept

Implemented in os::driver::usart_wrapper.

◆ do_get_status()

virtual serial::Status & os::driver::Serial::do_get_status ( void  )
protectedpure virtualnoexcept

Implemented in os::driver::usart_wrapper.

◆ do_get_tx_count()

virtual std::size_t os::driver::Serial::do_get_tx_count ( void  )
protectedpure virtualnoexcept

Implemented in os::driver::usart_wrapper.

◆ do_get_version()

virtual const Version & os::driver::Base::do_get_version ( void  )
protectedpure virtualnoexceptinherited

◆ do_power()

virtual return_t os::driver::Base::do_power ( Power  state)
protectedpure virtualnoexceptinherited

◆ do_receive()

virtual return_t os::driver::Serial::do_receive ( void *  data,
std::size_t  num 
)
protectedpure virtualnoexcept

Implemented in os::driver::usart_wrapper.

◆ do_send()

virtual return_t os::driver::Serial::do_send ( const void *  data,
std::size_t  num 
)
protectedpure virtualnoexcept

Implemented in os::driver::usart_wrapper.

◆ do_transfer()

virtual return_t os::driver::Serial::do_transfer ( const void *  data_out,
void *  data_in,
std::size_t  num 
)
protectedpure virtualnoexcept

Implemented in os::driver::usart_wrapper.

◆ get_capabilities()

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

Get driver capabilities.

Returns
Capabilities.

Definition at line 807 of file serial.h.

◆ get_modem_status()

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

Get serial modem lines state.

Returns
Modem status.

Definition at line 849 of file serial.h.

◆ get_rx_count()

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

Get received bytes count.

Returns
number of bytes received

Definition at line 819 of file serial.h.

◆ get_status()

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

Get serial port status.

Returns
Serial status.

Definition at line 837 of file serial.h.

◆ get_tx_count()

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

Get transmitted bytes count.

Returns
number of bytes transmitted

Definition at line 813 of file serial.h.

◆ get_version()

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

Get driver version.

Returns
Version.

Definition at line 213 of file common.h.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

Serial & os::driver::Serial::operator= ( Serial &&  )
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 219 of file common.h.

◆ receive()

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

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 108 of file serial.cpp.

◆ register_callback()

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

Register event callback.

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

Definition at line 90 of file serial.cpp.

◆ send()

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

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 97 of file serial.cpp.

◆ signal_event()

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

Signal serial events.

Parameters
[in]eventEvent notification mask.
Returns
Nothing.

Definition at line 855 of file serial.h.

◆ transfer()

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

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 119 of file serial.cpp.

Member Data Documentation

◆ cb_func_

signal_event_t os::driver::Serial::cb_func_
protected

Pointer to static function that implements the callback.

Definition at line 716 of file serial.h.

◆ cb_object_

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

Pointer to object instance associated with this driver.

Definition at line 719 of file serial.h.

◆ modem_status_

serial::Modem_status os::driver::Serial::modem_status_
protected

Definition at line 722 of file serial.h.

◆ status_

serial::Status os::driver::Serial::status_
protected

Definition at line 721 of file serial.h.


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