mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-06 04:48:27 +02:00
Add an option to force SPI into software mode, useful when (#4556)
reusing pins for different purposes.
This commit is contained in:
@@ -74,6 +74,7 @@ class SPIComponent : public Component {
|
||||
void set_clk(GPIOPin *clk) { clk_ = clk; }
|
||||
void set_miso(GPIOPin *miso) { miso_ = miso; }
|
||||
void set_mosi(GPIOPin *mosi) { mosi_ = mosi; }
|
||||
void set_force_sw(bool force_sw) { force_sw_ = force_sw; }
|
||||
|
||||
void setup() override;
|
||||
|
||||
@@ -260,6 +261,7 @@ class SPIComponent : public Component {
|
||||
GPIOPin *miso_{nullptr};
|
||||
GPIOPin *mosi_{nullptr};
|
||||
GPIOPin *active_cs_{nullptr};
|
||||
bool force_sw_{false};
|
||||
#ifdef USE_SPI_ARDUINO_BACKEND
|
||||
SPIClass *hw_spi_{nullptr};
|
||||
#endif // USE_SPI_ARDUINO_BACKEND
|
||||
|
||||
Reference in New Issue
Block a user