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

#include <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 ()=0
 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()

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

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.

◆ 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.

◆ 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.

◆ 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.

◆ 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 transfered - 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.


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