diff --git a/boards.txt b/boards.txt index 09ff95d2..185b0a9a 100644 --- a/boards.txt +++ b/boards.txt @@ -583,6 +583,157 @@ nano32.menu.UploadSpeed.512000.upload.speed=512000 ############################################################## +d32.name=LOLIN D32 + +d32.upload.tool=esptool +d32.upload.maximum_size=1310720 +d32.upload.maximum_data_size=327680 +d32.upload.wait_for_upload_port=true + +d32.serial.disableDTR=true +d32.serial.disableRTS=true + +d32.build.mcu=esp32 +d32.build.core=esp32 +d32.build.variant=d32 +d32.build.board=LOLIN_D32 + +d32.build.f_cpu=240000000L +d32.build.flash_size=4MB +d32.build.flash_freq=40m +d32.build.flash_mode=dio +d32.build.boot=dio +d32.build.partitions=default +d32.build.defines= + +d32.menu.PartitionScheme.default=Default +d32.menu.PartitionScheme.default.build.partitions=default +d32.menu.PartitionScheme.minimal=Minimal (2MB FLASH) +d32.menu.PartitionScheme.minimal.build.partitions=minimal +d32.menu.PartitionScheme.no_ota=No OTA (Large APP) +d32.menu.PartitionScheme.no_ota.build.partitions=no_ota +d32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +d32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) +d32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +d32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 + + + +d32.menu.FlashFreq.80=80MHz +d32.menu.FlashFreq.80.build.flash_freq=80m +d32.menu.FlashFreq.40=40MHz +d32.menu.FlashFreq.40.build.flash_freq=40m + + + +d32.menu.UploadSpeed.921600=921600 +d32.menu.UploadSpeed.921600.upload.speed=921600 +d32.menu.UploadSpeed.115200=115200 +d32.menu.UploadSpeed.115200.upload.speed=115200 +d32.menu.UploadSpeed.256000.windows=256000 +d32.menu.UploadSpeed.256000.upload.speed=256000 +d32.menu.UploadSpeed.230400.windows.upload.speed=256000 +d32.menu.UploadSpeed.230400=230400 +d32.menu.UploadSpeed.230400.upload.speed=230400 +d32.menu.UploadSpeed.460800.linux=460800 +d32.menu.UploadSpeed.460800.macosx=460800 +d32.menu.UploadSpeed.460800.upload.speed=460800 +d32.menu.UploadSpeed.512000.windows=512000 +d32.menu.UploadSpeed.512000.upload.speed=512000 + +d32.menu.DebugLevel.none=None +d32.menu.DebugLevel.none.build.code_debug=0 +d32.menu.DebugLevel.error=Error +d32.menu.DebugLevel.error.build.code_debug=1 +d32.menu.DebugLevel.warn=Warn +d32.menu.DebugLevel.warn.build.code_debug=2 +d32.menu.DebugLevel.info=Info +d32.menu.DebugLevel.info.build.code_debug=3 +d32.menu.DebugLevel.debug=Debug +d32.menu.DebugLevel.debug.build.code_debug=4 +d32.menu.DebugLevel.verbose=Verbose +d32.menu.DebugLevel.verbose.build.code_debug=5 + +############################################################## + +d32_pro.name=LOLIN D32 PRO + +d32_pro.upload.tool=esptool +d32_pro.upload.maximum_size=1310720 +d32_pro.upload.maximum_data_size=327680 +d32_pro.upload.wait_for_upload_port=true + +d32_pro.serial.disableDTR=true +d32_pro.serial.disableRTS=true + +d32_pro.build.mcu=esp32 +d32_pro.build.core=esp32 +d32_pro.build.variant=d32_pro +d32_pro.build.board=LOLIN_D32_PRO + +d32_pro.build.f_cpu=240000000L +d32_pro.build.flash_size=4MB +d32_pro.build.flash_freq=40m +d32_pro.build.flash_mode=dio +d32_pro.build.boot=dio +d32_pro.build.partitions=default +d32_pro.build.defines= + +d32_pro.menu.PSRAM.disabled=Disabled +d32_pro.menu.PSRAM.disabled.build.defines= +d32_pro.menu.PSRAM.enabled=Enabled +d32_pro.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue + +d32_pro.menu.PartitionScheme.default=Default +d32_pro.menu.PartitionScheme.default.build.partitions=default +d32_pro.menu.PartitionScheme.minimal=Minimal (2MB FLASH) +d32_pro.menu.PartitionScheme.minimal.build.partitions=minimal +d32_pro.menu.PartitionScheme.no_ota=No OTA (Large APP) +d32_pro.menu.PartitionScheme.no_ota.build.partitions=no_ota +d32_pro.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +d32_pro.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) +d32_pro.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +d32_pro.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 + + + +d32_pro.menu.FlashFreq.80=80MHz +d32_pro.menu.FlashFreq.80.build.flash_freq=80m +d32_pro.menu.FlashFreq.40=40MHz +d32_pro.menu.FlashFreq.40.build.flash_freq=40m + + + +d32_pro.menu.UploadSpeed.921600=921600 +d32_pro.menu.UploadSpeed.921600.upload.speed=921600 +d32_pro.menu.UploadSpeed.115200=115200 +d32_pro.menu.UploadSpeed.115200.upload.speed=115200 +d32_pro.menu.UploadSpeed.256000.windows=256000 +d32_pro.menu.UploadSpeed.256000.upload.speed=256000 +d32_pro.menu.UploadSpeed.230400.windows.upload.speed=256000 +d32_pro.menu.UploadSpeed.230400=230400 +d32_pro.menu.UploadSpeed.230400.upload.speed=230400 +d32_pro.menu.UploadSpeed.460800.linux=460800 +d32_pro.menu.UploadSpeed.460800.macosx=460800 +d32_pro.menu.UploadSpeed.460800.upload.speed=460800 +d32_pro.menu.UploadSpeed.512000.windows=512000 +d32_pro.menu.UploadSpeed.512000.upload.speed=512000 + +d32_pro.menu.DebugLevel.none=None +d32_pro.menu.DebugLevel.none.build.code_debug=0 +d32_pro.menu.DebugLevel.error=Error +d32_pro.menu.DebugLevel.error.build.code_debug=1 +d32_pro.menu.DebugLevel.warn=Warn +d32_pro.menu.DebugLevel.warn.build.code_debug=2 +d32_pro.menu.DebugLevel.info=Info +d32_pro.menu.DebugLevel.info.build.code_debug=3 +d32_pro.menu.DebugLevel.debug=Debug +d32_pro.menu.DebugLevel.debug.build.code_debug=4 +d32_pro.menu.DebugLevel.verbose=Verbose +d32_pro.menu.DebugLevel.verbose.build.code_debug=5 + +############################################################## + lolin32.name=WEMOS LOLIN32 lolin32.upload.tool=esptool diff --git a/variants/d32/d32_core.h b/variants/d32/d32_core.h new file mode 100644 index 00000000..787d08c2 --- /dev/null +++ b/variants/d32/d32_core.h @@ -0,0 +1,54 @@ +#ifndef _D32_CORE_H_ +#define _D32_CORE_H_ + +#define EXTERNAL_NUM_INTERRUPTS 16 +#define NUM_DIGITAL_PINS 40 +#define NUM_ANALOG_INPUTS 16 + +#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) +#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) +#define digitalPinHasPWM(p) (p < 34) + +static const uint8_t TX = 1; +static const uint8_t RX = 3; + +static const uint8_t SDA = 21; +static const uint8_t SCL = 22; + +static const uint8_t SS = 5; +static const uint8_t MOSI = 23; +static const uint8_t MISO = 19; +static const uint8_t SCK = 18; + +static const uint8_t A0 = 36; +static const uint8_t A3 = 39; +static const uint8_t A4 = 32; +static const uint8_t A5 = 33; +static const uint8_t A6 = 34; +static const uint8_t A7 = 35; +static const uint8_t A10 = 4; +static const uint8_t A11 = 0; +static const uint8_t A12 = 2; +static const uint8_t A13 = 15; +static const uint8_t A14 = 13; +static const uint8_t A15 = 12; +static const uint8_t A16 = 14; +static const uint8_t A17 = 27; +static const uint8_t A18 = 25; +static const uint8_t A19 = 26; + +static const uint8_t T0 = 4; +static const uint8_t T1 = 0; +static const uint8_t T2 = 2; +static const uint8_t T3 = 15; +static const uint8_t T4 = 13; +static const uint8_t T5 = 12; +static const uint8_t T6 = 14; +static const uint8_t T7 = 27; +static const uint8_t T8 = 33; +static const uint8_t T9 = 32; + +static const uint8_t DAC1 = 25; +static const uint8_t DAC2 = 26; + +#endif \ No newline at end of file diff --git a/variants/d32/pins_arduino.h b/variants/d32/pins_arduino.h new file mode 100644 index 00000000..065cef91 --- /dev/null +++ b/variants/d32/pins_arduino.h @@ -0,0 +1,11 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include +#include + +static const uint8_t LED_BUILTIN = 5; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +static const uint8_t _VBAT = 35; // battery voltage + +#endif /* Pins_Arduino_h */ diff --git a/variants/d32_pro/pins_arduino.h b/variants/d32_pro/pins_arduino.h new file mode 100644 index 00000000..5fd7c3e9 --- /dev/null +++ b/variants/d32_pro/pins_arduino.h @@ -0,0 +1,19 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include +#include <../d32/d32_core.h> + +static const uint8_t LED_BUILTIN = 5; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +static const uint8_t _VBAT = 35; // battery voltage + + +static const uint8_t TF_CS = 4; // TF (Micro SD Card) CS pin +static const uint8_t TS_CS = 12; // Touch Screen CS pin +static const uint8_t TFT_CS = 14; // TFT CS pin +static const uint8_t TFT_LED = 32; // TFT backlight control pin +static const uint8_t TFT_RST = 33; // TFT reset pin +static const uint8_t TFT_DC = 27; // TFT DC pin + +#endif /* Pins_Arduino_h */