mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 09:17:46 +01:00
fix spi timing issues (#3763)
This commit is contained in:
parent
6236db1a27
commit
f1e8cc2cf0
1 changed files with 5 additions and 5 deletions
|
@ -195,6 +195,11 @@ class SPIComponent : public Component {
|
||||||
|
|
||||||
template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, uint32_t DATA_RATE>
|
template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, uint32_t DATA_RATE>
|
||||||
void enable(GPIOPin *cs) {
|
void enable(GPIOPin *cs) {
|
||||||
|
if (cs != nullptr) {
|
||||||
|
this->active_cs_ = cs;
|
||||||
|
this->active_cs_->digital_write(false);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef USE_SPI_ARDUINO_BACKEND
|
#ifdef USE_SPI_ARDUINO_BACKEND
|
||||||
if (this->hw_spi_ != nullptr) {
|
if (this->hw_spi_ != nullptr) {
|
||||||
uint8_t data_mode = SPI_MODE0;
|
uint8_t data_mode = SPI_MODE0;
|
||||||
|
@ -215,11 +220,6 @@ class SPIComponent : public Component {
|
||||||
#ifdef USE_SPI_ARDUINO_BACKEND
|
#ifdef USE_SPI_ARDUINO_BACKEND
|
||||||
}
|
}
|
||||||
#endif // USE_SPI_ARDUINO_BACKEND
|
#endif // USE_SPI_ARDUINO_BACKEND
|
||||||
|
|
||||||
if (cs != nullptr) {
|
|
||||||
this->active_cs_ = cs;
|
|
||||||
this->active_cs_->digital_write(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void disable();
|
void disable();
|
||||||
|
|
Loading…
Reference in a new issue