distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
UartLowLevel.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_DEVICES_COMMUNICATION_UARTLOWLEVEL_HPP_
13 #define INCLUDE_DISTORTOS_DEVICES_COMMUNICATION_UARTLOWLEVEL_HPP_
14 
16 
17 #include <utility>
18 
19 #include <cstddef>
20 
21 namespace distortos
22 {
23 
24 namespace devices
25 {
26 
27 class UartBase;
28 
36 {
37 public:
38 
43  virtual ~UartLowLevel() = default;
44 
59  virtual std::pair<int, uint32_t> start(UartBase& uartBase, uint32_t baudRate, uint8_t characterLength,
60  UartParity parity, bool _2StopBits) = 0;
61 
80  virtual int startRead(void* buffer, size_t size) = 0;
81 
99  virtual int startWrite(const void* buffer, size_t size) = 0;
100 
109  virtual int stop() = 0;
110 
119  virtual size_t stopRead() = 0;
120 
130  virtual size_t stopWrite() = 0;
131 };
132 
133 } // namespace devices
134 
135 } // namespace distortos
136 
137 #endif // INCLUDE_DISTORTOS_DEVICES_COMMUNICATION_UARTLOWLEVEL_HPP_
virtual int startRead(void *buffer, size_t size)=0
Starts asynchronous read operation.
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.
virtual size_t stopRead()=0
Stops asynchronous read operation.
Definition: UartBase.hpp:30
Top-level namespace of distortos project.
Definition: buttons.hpp:33
UartParity
Definition: UartParity.hpp:29
Definition: UartLowLevel.hpp:35
virtual int startWrite(const void *buffer, size_t size)=0
Starts asynchronous write operation.
UartParity enum class header.
virtual int stop()=0
Stops low-level UART driver.
virtual size_t stopWrite()=0
Stops asynchronous write operation.
virtual ~UartLowLevel()=default
UartLowLevel's destructor.