distortos  v0.7.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 <cstddef>
18 
19 namespace distortos
20 {
21 
22 namespace devices
23 {
24 
25 class SpiMasterBase;
26 
34 {
35 public:
36 
43  virtual ~SpiMasterLowLevel() = default;
44 
59  virtual void configure(SpiMode mode, uint32_t clockFrequency, uint8_t wordLength, bool lsbFirst,
60  uint32_t dummyData) = 0;
61 
70  virtual int start() = 0;
71 
92  virtual void startTransfer(SpiMasterBase& spiMasterBase, const void* writeBuffer, void* readBuffer,
93  size_t size) = 0;
94 
104  virtual void stop() = 0;
105 };
106 
107 } // namespace devices
108 
109 } // namespace distortos
110 
111 #endif // INCLUDE_DISTORTOS_DEVICES_COMMUNICATION_SPIMASTERLOWLEVEL_HPP_
Definition: SpiMasterBase.hpp:28
SpiMode enum class header.
virtual void configure(SpiMode mode, uint32_t clockFrequency, uint8_t wordLength, bool lsbFirst, uint32_t dummyData)=0
Configures parameters of low-level SPI master driver.
virtual int start()=0
Starts low-level SPI master driver.
SpiMode
Definition: SpiMode.hpp:29
Definition: SpiMasterLowLevel.hpp:33
virtual ~SpiMasterLowLevel()=default
SpiMasterLowLevel's destructor.
virtual void stop()=0
Stops low-level SPI master driver.
Top-level namespace of distortos project.
Definition: buttons.hpp:33
virtual void startTransfer(SpiMasterBase &spiMasterBase, const void *writeBuffer, void *readBuffer, size_t size)=0
Starts asynchronous transfer.