distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
distortos::devices::UartBase Class Referenceabstract

#include "distortos/devices/communication/UartBase.hpp"

Inheritance diagram for distortos::devices::UartBase:
[legend]

Public Types

enum  ErrorBits {
  framingError, noiseError, overrunError, parityError,
  errorBitsMax
}
 indexes of error bits in ErrorSet More...
 
using ErrorSet = std::bitset< errorBitsMax >
 set of error bits More...
 

Public Member Functions

virtual ~UartBase ()=default
 UartBase's destructor. More...
 
virtual void readCompleteEvent (size_t bytesRead)=0
 "Read complete" event More...
 
virtual void receiveErrorEvent (ErrorSet errorSet)=0
 "Receive error" event More...
 
virtual void transmitCompleteEvent ()=0
 "Transmit complete" event More...
 
virtual void transmitStartEvent ()=0
 "Transmit start" event More...
 
virtual void writeCompleteEvent (size_t bytesWritten)=0
 "Write complete" event More...
 

Detailed Description

UartBase class is an interface with callbacks for low-level UART driver, which can serve as a base for high-level UART drivers

Member Typedef Documentation

◆ ErrorSet

set of error bits

Member Enumeration Documentation

◆ ErrorBits

indexes of error bits in ErrorSet

Enumerator
framingError 

framing error

noiseError 

noise error

overrunError 

overrun error

parityError 

parity error

errorBitsMax 

number of supported error bits - must be last!

Constructor & Destructor Documentation

◆ ~UartBase()

virtual distortos::devices::UartBase::~UartBase ( )
virtualdefault

UartBase's destructor.

Member Function Documentation

◆ readCompleteEvent()

virtual void distortos::devices::UartBase::readCompleteEvent ( size_t  bytesRead)
pure virtual

"Read complete" event

Called by low-level UART driver when whole read buffer is filled.

Parameters
[in]bytesReadis the number of bytes read by low-level UART driver (and written to read buffer)

Implemented in distortos::devices::SerialPort.

Here is the caller graph for this function:

◆ receiveErrorEvent()

virtual void distortos::devices::UartBase::receiveErrorEvent ( ErrorSet  errorSet)
pure virtual

"Receive error" event

Called by low-level UART driver when the last character was received with an error. This character is written to the read buffer before this function is called.

Parameters
[in]errorSetis the set of error bits

Implemented in distortos::devices::SerialPort.

Here is the caller graph for this function:

◆ transmitCompleteEvent()

virtual void distortos::devices::UartBase::transmitCompleteEvent ( )
pure virtual

"Transmit complete" event

Called by low-level UART driver when the transmission is physically finished.

Implemented in distortos::devices::SerialPort, and distortos::devices::Rs485.

Here is the caller graph for this function:

◆ transmitStartEvent()

virtual void distortos::devices::UartBase::transmitStartEvent ( )
pure virtual

"Transmit start" event

Called by low-level UART driver when new transmission starts.

Implemented in distortos::devices::SerialPort, and distortos::devices::Rs485.

Here is the caller graph for this function:

◆ writeCompleteEvent()

virtual void distortos::devices::UartBase::writeCompleteEvent ( size_t  bytesWritten)
pure virtual

"Write complete" event

Called by low-level UART driver when whole write buffer was transferred - the transmission may still be in progress.

Parameters
[in]bytesWrittenis the number of bytes written by low-level UART driver (and read from write buffer)

Implemented in distortos::devices::SerialPort.

Here is the caller graph for this function:

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