Host/Core/SPI.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * SPI.h
8  */
9 
14 #pragma once
15 
16 #include "SPIBase.h"
17 #include "SPISettings.h"
18 
19 //#define SPI_DEBUG 1
20 
21 // for compatibility when porting from Arduino
22 #define SPI_HAS_TRANSACTION 0
23 
30 class SPIClass : public SPIBase
31 {
32 public:
33  bool begin() override
34  {
35  return false;
36  }
37 
38  void end() override
39  {
40  }
41 
42  using SPIBase::transfer;
43  void transfer(uint8_t* buffer, size_t numberBytes) override
44  {
45  }
46 
47 protected:
48  void prepare(SPISettings& settings) override
49  {
50  }
51 };
52 
54 extern SPIClass SPI;
Definition: SPISettings.h:66
SPIClass SPI
Global instance of SPI class.
void transfer(uint8_t *buffer, size_t numberBytes) override
Send/receive a variable-length block of data.
Definition: Host/Core/SPI.h:43
bool begin() override
Initialize the SPI bus by setting SCK, MOSI, and SS to outputs, pulling SCK and MOSI low...
Definition: Host/Core/SPI.h:33
void prepare(SPISettings &settings) override
Prepare/configure with settings.
Definition: Host/Core/SPI.h:48
Definition: Esp8266/Core/SPI.h:36
Definition: SPIBase.h:28
void end() override
Disable the SPI bus (leaving pin modes unchanged).
Definition: Host/Core/SPI.h:38
uint8_t transfer(uint8_t val)
Send/receive one bytes of data.
Definition: SPIBase.h:101