distortos
v0.7.0
object-oriented C++ RTOS for microcontrollers
|
#include "distortos/devices/communication/UartLowLevel.hpp"
Public Member Functions | |
virtual | ~UartLowLevel ()=default |
UartLowLevel's destructor. More... | |
virtual std::pair< int, uint32_t > | start (UartBase &uartBase, uint32_t baudRate, uint8_t characterLength, UartParity parity, bool _2StopBits)=0 |
Starts low-level UART driver. More... | |
virtual int | startRead (void *buffer, size_t size)=0 |
Starts asynchronous read operation. More... | |
virtual int | startWrite (const void *buffer, size_t size)=0 |
Starts asynchronous write operation. More... | |
virtual int | stop ()=0 |
Stops low-level UART driver. More... | |
virtual size_t | stopRead ()=0 |
Stops asynchronous read operation. More... | |
virtual size_t | stopWrite ()=0 |
Stops asynchronous write operation. More... | |
UartLowLevel class is an interface for low-level UART driver
|
virtualdefault |
UartLowLevel's destructor.
|
pure virtual |
Starts low-level UART driver.
[in] | uartBase | is a reference to UartBase object that will be associated with this one |
[in] | baudRate | is the desired baud rate, bps |
[in] | characterLength | selects character length, bits |
[in] | parity | selects parity |
[in] | _2StopBits | selects whether 1 (false) or 2 (true) stop bits are used |
Implemented in distortos::chip::ChipUartLowLevel.
|
pure virtual |
Starts asynchronous read operation.
This function returns immediately. When the operation is finished (expected number of bytes were read), UartBase::readCompleteEvent() will be executed. For any detected error during reception, UartBase::receiveErrorEvent() will be executed. Note that overrun error may be reported even if it happened when no read operation was in progress.
[out] | buffer | is the buffer to which the data will be written |
[in] | size | is the size of buffer, bytes, must be even if selected character length is greater than 8 bits |
Implemented in distortos::chip::ChipUartLowLevel.
|
pure virtual |
Starts asynchronous write operation.
This function returns immediately. If no transmission is active, UartBase::transmitStartEvent() will be executed. When the operation is finished (expected number of bytes were written), UartBase::writeCompleteEvent() will be executed. When the transmission physically ends, UartBase::transmitCompleteEvent() will be executed.
[in] | buffer | is the buffer with data that will be transmitted |
[in] | size | is the size of buffer, bytes, must be even if selected character length is greater than 8 bits |
Implemented in distortos::chip::ChipUartLowLevel.
|
pure virtual |
Stops low-level UART driver.
Implemented in distortos::chip::ChipUartLowLevel.
|
pure virtual |
Stops asynchronous read operation.
This function returns immediately. After this call UartBase::readCompleteEvent() will not be executed.
Implemented in distortos::chip::ChipUartLowLevel.
|
pure virtual |
Stops asynchronous write operation.
This function returns immediately. After this call UartBase::writeCompleteEvent() will not be executed. UartBase::transmitCompleteEvent() will not be suppressed.
Implemented in distortos::chip::ChipUartLowLevel.