From 33d0b48e4fdd32e874c3b909d112085a75458470 Mon Sep 17 00:00:00 2001 From: Torsten Stauder Date: Sat, 20 Mar 2021 22:49:08 +0100 Subject: [PATCH] Some tweaks for platformio.ini, esp32-a1s, settings.h --- platformio.ini | 15 +++++++-------- src/settings-espa1s.h | 25 +++++++++++++++---------- src/settings.h | 10 ++++++++-- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/platformio.ini b/platformio.ini index fd39bd5..f3a3bac 100644 --- a/platformio.ini +++ b/platformio.ini @@ -38,7 +38,6 @@ framework = arduino monitor_speed = 115200 board_build.partitions = huge_app.csv build_flags = -DHAL=2 - -DRFID_READER_TYPE_MFRC522_I2C -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue lib_deps = @@ -47,7 +46,7 @@ lib_deps = ${common.lib_deps_builtin} ${common.lib_deps_external} platform_packages = - platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.5-rc6 + platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.5 [env:lolin32] ;https://docs.platformio.org/en/latest/boards/espressif32/lolin32.html @@ -66,7 +65,7 @@ extra_scripts = ${env:common.extra_scripts} upload_port = /dev/cu.SLAB_USBtoUART monitor_port = /dev/cu.SLAB_USBtoUART platform_packages = - platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.5-rc6 + platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.5 [env:lolin_d32] ;https://docs.platformio.org/en/latest/boards/espressif32/lolin_d32.html @@ -85,7 +84,7 @@ extra_scripts = ${env:common.extra_scripts} upload_port = /dev/cu.wchusbserial1410 monitor_port = /dev/cu.wchusbserial1410 platform_packages = - platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.5-rc6 + platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.5 [env:lolin_d32_pro] ;https://docs.platformio.org/en/latest/boards/espressif32/lolin_d32_pro.html @@ -106,7 +105,7 @@ build_flags = -DHAL=4 -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue platform_packages = - platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.5-rc6 + platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.5 board_upload.maximum_size = 16777216 board_upload.flash_size = 16MB @@ -126,7 +125,7 @@ extra_scripts = ${env:common.extra_scripts} upload_port = /dev/cu.SLAB_USBtoUART monitor_port = /dev/cu.SLAB_USBtoUART platform_packages = - platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.5-rc6 + platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.5 [env:az-delivery-devkit-v4] ;https://docs.platformio.org/en/latest/boards/espressif32/az-delivery-devkit-v4.html @@ -144,7 +143,7 @@ extra_scripts = ${env:common.extra_scripts} upload_port = /dev/cu.SLAB_USBtoUART monitor_port = /dev/cu.SLAB_USBtoUART platform_packages = - platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.5-rc6 + platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.5 [env:ttgo_t8] ;https://docs.platformio.org/en/latest/boards/espressif32/esp-wrover-kit.html @@ -165,7 +164,7 @@ build_flags = -DHAL=5 -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue platform_packages = - platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.5-rc6 + platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.5 ;;; Change upload/monitor-port of your board regarding your operating-system and develboard! ;MAC: /dev/cu.SLAB_USBtoUART / /dev/cu.wchusbserial1420 / /dev/cu.wchusbserial1410 diff --git a/src/settings-espa1s.h b/src/settings-espa1s.h index b06b8ff..cc119d3 100644 --- a/src/settings-espa1s.h +++ b/src/settings-espa1s.h @@ -13,7 +13,7 @@ //################## GPIO-configuration ############################## - // uSD-card-reader (via SPI) + // uSD-card-reader (via SPI - better use SD_MMC instead!) #define SPISD_CS 13 // GPIO for chip select (SD) #ifndef SINGLE_SPI_ENABLE #define SPISD_MOSI 15 // GPIO for master out slave in (SD) => not necessary for single-SPI @@ -21,10 +21,21 @@ #define SPISD_SCK 14 // GPIO for clock-signal (SD) => not necessary for single-SPI #endif + // RFID (via SPI; currently not supported) + #define RST_PIN 99 // Not necessary but has to be set anyway; so let's use a dummy-number + #define RFID_CS 21 // GPIO for chip select (RFID) + #define RFID_MOSI 23 // GPIO for master out slave in (RFID) + #define RFID_MISO 19 // GPIO for master in slave out (RFID) + #define RFID_SCK 18 // GPIO for clock-signal (RFID) + + // RFID (via I2C) #define MFRC522_RST_PIN 12 // needed for i2c-comm MTDI on JTAG - #define MFRC522_ADDR 0x28 // default Address of MFRC522 - #define ext_IIC_CLK 23 // 14-pin-header - #define ext_IIC_DATA 18 // 14-pin-header + + // I2C-configuration (necessary for RC522 [only via i2c - not spi!] or port-expander) + #if defined(RFID_READER_TYPE_MFRC522_I2C) || defined(PORT_EXPANDER_ENABLE) + #define ext_IIC_CLK 23 // i2c-SCL (clock) [14 pin-header] + #define ext_IIC_DATA 18 // i2c-SDA (data) [14 pin-header] + #endif // I2S (DAC) #define I2S_DOUT 25 // Digital out (I2S) @@ -53,12 +64,6 @@ #define BUTTON_4 99 // Button 4: unnamed optional button #define BUTTON_5 99 // Button 5: unnamed optional button - // I2C-configuration (necessary for RC522 [only via i2c - not spi!] or port-expander) - #if defined(RFID_READER_TYPE_MFRC522_I2C) || defined(PORT_EXPANDER_ENABLE) - #define ext_IIC_CLK 5 // i2c-SCL (clock) - #define ext_IIC_DATA 2 // i2c-SDA (data) - #endif - // Wake-up button => this also is the interrupt-pin if port-expander is enabled! // Please note: only RTC-GPIOs (0, 4, 12, 13, 14, 15, 25, 26, 27, 32, 33, 34, 35, 36, 39, 99) can be used! Set to 99 to DISABLE. // Please note #2: this button can be used as interrupt-pin for port-expander. If so, all pins connected to port-expander can wake up ESPuino. diff --git a/src/settings.h b/src/settings.h index e3b41fe..26744d8 100644 --- a/src/settings.h +++ b/src/settings.h @@ -17,7 +17,9 @@ 99: custom => settings-custom.h more to come... */ - #define HAL 1 // HAL 1 = LoLin32, 2 = ESP32-A1S-AudioKit, 3 = Lolin D32, 4 = Lolin D32 pro; 99 = custom + #ifndef HAL // Will be set by platformio.ini. If using Arduini-IDE you have to set HAL according your needs! + #define HAL 1 // HAL 1 = LoLin32, 2 = ESP32-A1S-AudioKit, 3 = Lolin D32, 4 = Lolin D32 pro; 99 = custom + #endif //########################## MODULES ################################# @@ -49,8 +51,12 @@ //#define RFID_READER_TYPE_MFRC522_I2C // use MFRC522 via I2C //#define RFID_READER_TYPE_PN5180 // use PN5180 + #ifdef RFID_READER_TYPE_MFRC522_I2C + #define MFRC522_ADDR 0x28 // default I2C-address of MFRC522 + #endif + #ifdef RFID_READER_TYPE_PN5180 - //#define PN5180_ENABLE_LPCD // enable PN5180 low power card detection. Wakes up ESPuino if RFID-tag was applied while deepsleep is active. + //#define PN5180_ENABLE_LPCD // Wakes up ESPuino if RFID-tag was applied while deepsleep is active. #endif #ifdef RFID_READER_TYPE_MFRC522_SPI