distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
SpiMasterLowLevel.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_DEVICES_COMMUNICATION_SPIMASTERLOWLEVEL_HPP_
13 #define INCLUDE_DISTORTOS_DEVICES_COMMUNICATION_SPIMASTERLOWLEVEL_HPP_
14 
16 
17 #include <utility>
18 
19 #include <cstddef>
20 
21 namespace distortos
22 {
23 
24 namespace devices
25 {
26 
27 class SpiMasterBase;
28 
36 {
37 public:
38 
43  virtual ~SpiMasterLowLevel() = 0;
44 
59  virtual std::pair<int, uint32_t> configure(SpiMode mode, uint32_t clockFrequency, uint8_t wordLength,
60  bool lsbFirst) = 0;
61 
71  virtual int start(SpiMasterBase& spiMasterBase) = 0;
72 
91  virtual int startTransfer(const void* writeBuffer, void* readBuffer, size_t size) = 0;
92 
101  virtual int stop() = 0;
102 };
103 
104 } // namespace devices
105 
106 } // namespace distortos
107 
108 #endif // INCLUDE_DISTORTOS_DEVICES_COMMUNICATION_SPIMASTERLOWLEVEL_HPP_
Definition: SpiMasterBase.hpp:32
SpiMode enum class header.
virtual int startTransfer(const void *writeBuffer, void *readBuffer, size_t size)=0
Starts asynchronous transfer.
SpiMode
Definition: SpiMode.hpp:29
Definition: SpiMasterLowLevel.hpp:35
virtual int start(SpiMasterBase &spiMasterBase)=0
Starts low-level SPI master driver.
Top-level namespace of distortos project.
virtual int stop()=0
Stops low-level SPI master driver.
virtual ~SpiMasterLowLevel()=0
SpiMasterLowLevel&#39;s destructor.
Definition: SpiMasterLowLevel.cpp:24
virtual std::pair< int, uint32_t > configure(SpiMode mode, uint32_t clockFrequency, uint8_t wordLength, bool lsbFirst)=0
Configures parameters of low-level SPI master driver.