Enable second HW SPI for ESP32

This commit is contained in:
Stephan Hadinger 2021-04-17 19:49:26 +02:00
parent bbd490f27e
commit 663f29d4e3
2 changed files with 7 additions and 5 deletions

View File

@ -87,8 +87,10 @@ const uint16_t VL53L0X_MAX_SENSORS = 8; // Max number of VL53L0X sensors
#ifdef ESP32 #ifdef ESP32
const uint8_t MAX_I2C = 2; // Max number of I2C controllers (ESP32 = 2) const uint8_t MAX_I2C = 2; // Max number of I2C controllers (ESP32 = 2)
const uint8_t MAX_SPI = 2; // Max number of Hardware SPI controllers (ESP32 = 2)
#else #else
const uint8_t MAX_I2C = 0; // Max number of I2C controllers (ESP8266 = 0, no choice) const uint8_t MAX_I2C = 0; // Max number of I2C controllers (ESP8266 = 0, no choice)
const uint8_t MAX_SPI = 0; // Max number of Hardware SPI controllers (ESP8266 = 0, no choice)
#endif #endif
// Changes to the following MAX_ defines need to be in line with enum SettingsTextIndex // Changes to the following MAX_ defines need to be in line with enum SettingsTextIndex

View File

@ -407,11 +407,11 @@ const uint16_t kGpioNiceList[] PROGMEM = {
#endif #endif
#ifdef USE_SPI #ifdef USE_SPI
AGPIO(GPIO_SPI_MISO), // SPI MISO AGPIO(GPIO_SPI_MISO) + MAX_SPI, // SPI MISO
AGPIO(GPIO_SPI_MOSI), // SPI MOSI AGPIO(GPIO_SPI_MOSI) + MAX_SPI, // SPI MOSI
AGPIO(GPIO_SPI_CLK), // SPI Clk AGPIO(GPIO_SPI_CLK) + MAX_SPI, // SPI Clk
AGPIO(GPIO_SPI_CS), // SPI Chip Select AGPIO(GPIO_SPI_CS) + MAX_SPI, // SPI Chip Select
AGPIO(GPIO_SPI_DC), // SPI Data Direction AGPIO(GPIO_SPI_DC) + MAX_SPI, // SPI Data Direction
#ifdef USE_NRF24 #ifdef USE_NRF24
AGPIO(GPIO_NRF24_CS), AGPIO(GPIO_NRF24_CS),
AGPIO(GPIO_NRF24_DC), AGPIO(GPIO_NRF24_DC),