From aab449a480441a669663bcf0f88e21c0fdc9d75b Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Wed, 4 Oct 2023 21:08:51 -0300 Subject: [PATCH 1/3] boards fix + S3 GIO48 issue --- boards.txt | 2 +- cores/esp32/Arduino.h | 12 ++++++++++ cores/esp32/esp32-hal-gpio.c | 3 +++ variants/AirM2M_CORE_ESP32C3/pins_arduino.h | 8 ------- variants/Aventen_S3_Sync/pins_arduino.h | 9 -------- variants/Bee_Data_Logger/pins_arduino.h | 16 +++++++------- variants/Bee_Motion/pins_arduino.h | 8 ------- variants/Bee_Motion_Mini/pins_arduino.h | 22 +++++++++++-------- variants/Bee_Motion_S3/pins_arduino.h | 16 +++++++------- variants/Bee_S3/pins_arduino.h | 17 +++++++------- variants/ET-Board/pins_arduino.h | 11 ---------- variants/Edgebox-ESP-100/pins_arduino.h | 8 ------- variants/Microduino-esp32/pins_arduino.h | 9 -------- variants/Nebula_S3/pins_arduino.h | 10 --------- variants/S_ODI_Ultra_v1/pins_arduino.h | 9 -------- .../VALTRACK_V4_MFW_ESP32_C3/pins_arduino.h | 8 ------- .../VALTRACK_V4_VTS_ESP32_C3/pins_arduino.h | 8 ------- variants/XIAO_ESP32C3/pins_arduino.h | 8 ------- variants/XIAO_ESP32S3/pins_arduino.h | 9 -------- .../adafruit_feather_esp32_v2/pins_arduino.h | 18 +++++++-------- .../adafruit_feather_esp32s2/pins_arduino.h | 21 ++++++++---------- .../pins_arduino.h | 21 ++++++++---------- .../pins_arduino.h | 21 ++++++++---------- .../adafruit_feather_esp32s3/pins_arduino.h | 18 +++++++-------- .../pins_arduino.h | 18 +++++++-------- .../pins_arduino.h | 20 +++++++---------- .../pins_arduino.h | 20 +++++++---------- .../adafruit_funhouse_esp32s2/pins_arduino.h | 9 -------- .../adafruit_itsybitsy_esp32/pins_arduino.h | 20 +++++++---------- .../adafruit_magtag29_esp32s2/pins_arduino.h | 21 ++++++++---------- .../pins_arduino.h | 18 +++++++-------- .../adafruit_metro_esp32s2/pins_arduino.h | 14 +++++------- .../adafruit_metro_esp32s3/pins_arduino.h | 18 +++++++-------- variants/adafruit_qtpy_esp32/pins_arduino.h | 15 ++++++------- variants/adafruit_qtpy_esp32c3/pins_arduino.h | 15 ++++++------- variants/adafruit_qtpy_esp32s2/pins_arduino.h | 19 +++++++--------- .../adafruit_qtpy_esp32s3_n4r2/pins_arduino.h | 10 +-------- .../pins_arduino.h | 11 ++-------- variants/alksesp32/pins_arduino.h | 9 -------- variants/atmegazero_esp32s2/pins_arduino.h | 16 +++++++------- variants/bpi-bit/pins_arduino.h | 16 +++++++------- variants/bpi_leaf_s3/pins_arduino.h | 14 ++++-------- variants/ch_denky/pins_arduino.h | 8 ------- variants/cnrs_aw2eth/pins_arduino.h | 8 ------- variants/connaxio_espoir/pins_arduino.h | 8 ------- variants/crabik_slot_esp32_s3/pins_arduino.h | 9 -------- .../pins_arduino.h | 12 ---------- variants/d-duino-32/pins_arduino.h | 8 ------- variants/d1_mini32/pins_arduino.h | 1 - variants/d1_uno32/pins_arduino.h | 10 --------- variants/d32/d32_core.h | 8 ------- variants/d32/pins_arduino.h | 1 - variants/d32_pro/pins_arduino.h | 1 - variants/deneyapkart/pins_arduino.h | 9 -------- variants/deneyapkart1A/pins_arduino.h | 9 -------- variants/deneyapkart1Av2/pins_arduino.h | 9 -------- variants/deneyapkartg/pins_arduino.h | 9 -------- variants/deneyapmini/pins_arduino.h | 9 -------- variants/deneyapminiv2/pins_arduino.h | 9 -------- .../pins_arduino.h | 20 +++++++---------- .../dfrobot_beetle_esp32c3/pins_arduino.h | 10 +-------- .../dfrobot_firebeetle2_esp32e/pins_arduino.h | 11 ---------- .../pins_arduino.h | 9 -------- variants/dfrobot_romeo_esp32s3/pins_arduino.h | 11 ---------- variants/doitESP32devkitV1/pins_arduino.h | 9 -------- variants/doitESPduino32/pins_arduino.h | 8 ------- variants/dpu_esp32/pins_arduino.h | 8 ------- variants/esp32-devkit-lipo/pins_arduino.h | 8 ------- variants/esp32-evb/pins_arduino.h | 9 -------- variants/esp32-gateway/pins_arduino.h | 9 -------- variants/esp32-poe-iso/pins_arduino.h | 8 ------- variants/esp32-poe/pins_arduino.h | 8 ------- .../pins_arduino.h | 8 ------- .../pins_arduino.h | 8 ------- .../esp32-trueverit-iot-driver/pins_arduino.h | 8 ------- variants/esp32/pins_arduino.h | 8 ------- variants/esp320/pins_arduino.h | 9 -------- variants/esp32_s3r8n16/pins_arduino.h | 8 ------- variants/esp32c3/pins_arduino.h | 14 ++++-------- variants/esp32c6/pins_arduino.h | 14 ++++-------- variants/esp32da/pins_arduino.h | 8 ------- variants/esp32h2/pins_arduino.h | 14 ++++-------- variants/esp32micromod/pins_arduino.h | 9 +------- variants/esp32s2/pins_arduino.h | 18 ++++++--------- variants/esp32s2thing_plus/pins_arduino.h | 8 ------- variants/esp32s2usb/pins_arduino.h | 9 -------- variants/esp32s3/pins_arduino.h | 13 ++++------- variants/esp32s3box/pins_arduino.h | 8 ------- variants/esp32s3camlcd/pins_arduino.h | 8 ------- variants/esp32s3usbotg/pins_arduino.h | 8 ------- variants/esp32thing/pins_arduino.h | 9 -------- variants/esp32thing_plus/pins_arduino.h | 9 -------- variants/esp32thing_plus_c/pins_arduino.h | 11 +--------- variants/esp32vn-iot-uno/pins_arduino.h | 8 ------- variants/esp_c3_m1_i_kit/pins_arduino.h | 8 ------- variants/espea32/pins_arduino.h | 9 -------- variants/espectro32/pins_arduino.h | 9 -------- variants/espino32/pins_arduino.h | 9 -------- variants/feather_esp32/pins_arduino.h | 9 -------- variants/firebeetle32/pins_arduino.h | 11 ---------- variants/fm-devkit/pins_arduino.h | 8 ------- .../franzininho_wifi_esp32s2/pins_arduino.h | 15 ++++++------- .../pins_arduino.h | 15 ++++++------- variants/frog32/pins_arduino.h | 8 ------- variants/gpy/pins_arduino.h | 17 ++++++-------- variants/healthypi4/pins_arduino.h | 9 -------- variants/heltec_wifi_kit_32/pins_arduino.h | 9 -------- .../pins_arduino.h | 18 ++++++--------- variants/heltec_wifi_lora_32/pins_arduino.h | 9 -------- .../heltec_wifi_lora_32_V2/pins_arduino.h | 9 -------- .../heltec_wifi_lora_32_V3/pins_arduino.h | 16 +------------- variants/heltec_wireless_stick/pins_arduino.h | 9 -------- .../heltec_wireless_stick_lite/pins_arduino.h | 9 -------- .../pins_arduino.h | 9 -------- variants/honeylemon/pins_arduino.h | 9 -------- variants/hornbill32dev/pins_arduino.h | 9 -------- variants/hornbill32minima/pins_arduino.h | 8 ------- variants/imbrios-logsens-v1p1/pins_arduino.h | 9 -------- variants/intorobot-fig/pins_arduino.h | 9 -------- .../{pins_arduino.h.txt => pins_arduino.h} | 8 ------- variants/lilygo_t_display_s3/pins_arduino.h | 8 ------- variants/lionbit/pins_arduino.h | 10 ++------- variants/lionbits3/pins_arduino.h | 10 ++------- variants/lolin32-lite/pins_arduino.h | 8 ------- variants/lolin32/pins_arduino.h | 11 ---------- variants/lolin_c3_mini/pins_arduino.h | 8 ------- variants/lolin_s2_mini/pins_arduino.h | 8 ------- variants/lolin_s2_pico/pins_arduino.h | 8 ------- variants/lolin_s3/pins_arduino.h | 10 --------- variants/lolin_s3_mini/pins_arduino.h | 10 --------- variants/lolin_s3_pro/pins_arduino.h | 10 --------- variants/lopy/pins_arduino.h | 17 ++++++-------- variants/lopy4/pins_arduino.h | 17 ++++++-------- variants/m5stack_atom/pins_arduino.h | 8 ------- variants/m5stack_atoms3/pins_arduino.h | 15 +------------ variants/m5stack_core2/pins_arduino.h | 8 ------- variants/m5stack_core_esp32/pins_arduino.h | 8 ------- variants/m5stack_coreink/pins_arduino.h | 8 ------- variants/m5stack_cores3/pins_arduino.h | 10 --------- variants/m5stack_fire/pins_arduino.h | 8 ------- variants/m5stack_stamp_pico/pins_arduino.h | 9 -------- variants/m5stack_stamp_s3/pins_arduino.h | 9 -------- variants/m5stack_station/pins_arduino.h | 8 ------- variants/m5stack_timer_cam/pins_arduino.h | 8 ------- variants/m5stick_c/pins_arduino.h | 8 ------- variants/magicbit/pins_arduino.h | 10 ++------- variants/metro_esp-32/pins_arduino.h | 9 -------- variants/mgbot-iotik32a/pins_arduino.h | 9 -------- variants/mgbot-iotik32b/pins_arduino.h | 9 -------- variants/mhetesp32devkit/pins_arduino.h | 9 -------- variants/mhetesp32minikit/pins_arduino.h | 9 -------- variants/micro_s2/pins_arduino.h | 13 +++++------ variants/mpython/pins_arduino.h | 8 ------- variants/namino_arancio/pins_arduino.h | 8 ------- variants/namino_rosso/pins_arduino.h | 8 ------- variants/nano32/pins_arduino.h | 9 -------- variants/nina_w10/pins_arduino.h | 8 ------- variants/node32s/pins_arduino.h | 9 -------- variants/nodemcu-32s/pins_arduino.h | 9 -------- variants/nora_w10/pins_arduino.h | 9 -------- variants/odroid_esp32/pins_arduino.h | 9 -------- variants/onehorse32dev/pins_arduino.h | 9 -------- variants/openkb/pins_arduino.h | 9 -------- variants/oroca_edubot/pins_arduino.h | 9 -------- variants/pico32/pins_arduino.h | 8 ------- variants/piranha_esp-32/pins_arduino.h | 9 -------- variants/pocket_32/pins_arduino.h | 11 ---------- variants/quantum/pins_arduino.h | 8 ------- variants/redpill_esp32s3/pins_arduino.h | 9 -------- variants/roboheart_hercules/pins_arduino.h | 9 -------- variants/sonoff_dualr3/pins_arduino.h | 8 ------- .../pins_arduino.h | 13 ++--------- .../pins_arduino.h | 9 +------- variants/tamc_termod_s3/pins_arduino.h | 9 -------- variants/tbeam/pins_arduino.h | 9 -------- variants/ttgo-lora32-v1/pins_arduino.h | 9 -------- variants/ttgo-lora32-v2/pins_arduino.h | 9 -------- variants/ttgo-lora32-v21new/pins_arduino.h | 11 +--------- variants/ttgo-t-oi-plus/pins_arduino.h | 9 +------- variants/ttgo-t1/pins_arduino.h | 9 -------- variants/ttgo-t7-v13-mini32/pins_arduino.h | 8 ------- variants/ttgo-t7-v14-mini32/pins_arduino.h | 8 ------- variants/turta_iot_node/pins_arduino.h | 9 -------- variants/twatch/pins_arduino.h | 8 ------- .../uPesy_esp32_wroom_devkit/pins_arduino.h | 9 -------- .../uPesy_esp32_wrover_devkit/pins_arduino.h | 9 -------- variants/um_feathers2/pins_arduino.h | 8 ------- variants/um_feathers2neo/pins_arduino.h | 16 +++++++------- variants/um_feathers3/pins_arduino.h | 16 +++++++------- variants/um_nanos3/pins_arduino.h | 16 +++++++------- variants/um_pros3/pins_arduino.h | 16 +++++++------- variants/um_rmp/pins_arduino.h | 16 +++++++------- variants/um_tinypico/pins_arduino.h | 8 ------- variants/um_tinys2/pins_arduino.h | 16 +++++++------- variants/um_tinys3/pins_arduino.h | 16 +++++++------- variants/unphone8/pins_arduino.h | 8 ------- variants/unphone9/pins_arduino.h | 8 ------- variants/vintlabsdevkitv1/pins_arduino.h | 9 -------- variants/watchy/pins_arduino.h | 8 ------- variants/wesp32/pins_arduino.h | 8 ------- variants/widora-air/pins_arduino.h | 10 --------- variants/wifiduino32/pins_arduino.h | 9 -------- variants/wifiduino32s3/pins_arduino.h | 9 -------- variants/wifiduinov2/pins_arduino.h | 9 -------- variants/wipy3/pins_arduino.h | 18 +++++++-------- variants/wt32-eth01/pins_arduino.h | 8 ------- variants/xinabox/pins_arduino.h | 9 -------- 207 files changed, 362 insertions(+), 1808 deletions(-) rename variants/{heltec_wifi_kit_32_v3 => heltec_wifi_kit_32_V3}/pins_arduino.h (82%) rename variants/lilygo_t_display/{pins_arduino.h.txt => pins_arduino.h} (83%) diff --git a/boards.txt b/boards.txt index c0685b25e29..8dcd12cec5d 100644 --- a/boards.txt +++ b/boards.txt @@ -23429,7 +23429,7 @@ unphone8.build.partitions=default_8MB unphone8.build.defines=-DBOARD_HAS_PSRAM -DUNPHONE_SPIN=8 unphone8.build.loop_core=-DARDUINO_RUNNING_CORE=1 unphone8.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1 -unphone8.build.flash_type=qspi +unphone8.build.flash_type=qio unphone8.build.psram_type=qspi unphone8.build.memory_type={build.flash_type}_{build.psram_type} diff --git a/cores/esp32/Arduino.h b/cores/esp32/Arduino.h index cd87a914517..2756f6f3cb4 100644 --- a/cores/esp32/Arduino.h +++ b/cores/esp32/Arduino.h @@ -129,6 +129,18 @@ #define NOT_AN_INTERRUPT -1 #define NOT_ON_TIMER 0 +// some defines generic for all SoC moved from variants/board_name/pins_arduino.h +#define NUM_DIGITAL_PINS SOC_GPIO_PIN_COUNT // All GPIOs +#if SOC_ADC_PERIPH_NUM == 1 +#define NUM_ANALOG_INPUTS (SOC_ADC_CHANNEL_NUM(0)) // Depends on the SoC (ESP32C6, ESP32H2, ESP32C2, ESP32P4) +#elif SOC_ADC_PERIPH_NUM == 2 +#define NUM_ANALOG_INPUTS (SOC_ADC_CHANNEL_NUM(0)+SOC_ADC_CHANNEL_NUM(1)) // Depends on the SoC (ESP32, ESP32S2, ESP32S3, ESP32C3) +#endif +#define EXTERNAL_NUM_INTERRUPTS NUM_DIGITAL_PINS // All GPIOs +#define analogInputToDigitalPin(p) (((p)= SOC_GPIO_PIN_COUNT) return; + if(!interrupt_initialized) { esp_err_t err = gpio_install_isr_service((int)ARDUINO_ISR_FLAG); interrupt_initialized = (err == ESP_OK) || (err == ESP_ERR_INVALID_STATE); diff --git a/variants/AirM2M_CORE_ESP32C3/pins_arduino.h b/variants/AirM2M_CORE_ESP32C3/pins_arduino.h index 4af6c1d87cd..b06acf0a85e 100644 --- a/variants/AirM2M_CORE_ESP32C3/pins_arduino.h +++ b/variants/AirM2M_CORE_ESP32C3/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 22 -#define NUM_DIGITAL_PINS 22 -#define NUM_ANALOG_INPUTS 6 - -#define analogInputToDigitalPin(p) (((p) -#include "soc/soc_caps.h" #define USB_VID 0x303a #define USB_PID 0x1001 @@ -10,14 +9,6 @@ #define USB_PRODUCT "Aventen S3 Sync" #define USB_SERIAL "" -#define NUM_DIGITAL_PINS SOC_GPIO_PIN_COUNT // GPIO 0..48 -#define NUM_ANALOG_INPUTS 20 // GPIO 1..20 -#define EXTERNAL_NUM_INTERRUPTS NUM_DIGITAL_PINS // All GPIOs - -#define analogInputToDigitalPin(p) (((p) +#include "soc/soc_caps.h" #define USB_VID 0x303A #define USB_PID 0x815C @@ -9,14 +10,6 @@ #define USB_PRODUCT "Bee Data Logger" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 13 -#define NUM_ANALOG_INPUTS 7 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; @@ -74,5 +67,12 @@ static const uint8_t LDO2 = 34; static const uint8_t RGB_DATA = 40; static const uint8_t RGB_PWR = 34; +#define PIN_NEOPIXEL RGB_DATA +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 #endif /* Pins_Arduino_h */ diff --git a/variants/Bee_Motion/pins_arduino.h b/variants/Bee_Motion/pins_arduino.h index 18cc71f24f5..d11f332cef9 100644 --- a/variants/Bee_Motion/pins_arduino.h +++ b/variants/Bee_Motion/pins_arduino.h @@ -9,14 +9,6 @@ #define USB_PRODUCT "Bee Motion S3" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 21 -#define NUM_ANALOG_INPUTS 12 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/Bee_Motion_Mini/pins_arduino.h b/variants/Bee_Motion_Mini/pins_arduino.h index e3f43decb4a..3e308be5de6 100644 --- a/variants/Bee_Motion_Mini/pins_arduino.h +++ b/variants/Bee_Motion_Mini/pins_arduino.h @@ -3,22 +3,26 @@ #include - -#define EXTERNAL_NUM_INTERRUPTS 4 -#define NUM_DIGITAL_PINS 4 -#define NUM_ANALOG_INPUTS 2 - -#define analogInputToDigitalPin(p) (((p)<6)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<22)?(p):-1) -#define digitalPinHasPWM(p) (p < 22) - static const uint8_t TX = 21; static const uint8_t RX = 20; static const uint8_t BOOT_BTN = 9; static const uint8_t PIR = 5; +static const uint8_t SDA = 8; +static const uint8_t SCL = 9; + +static const uint8_t SS = 7; +static const uint8_t MOSI = 6; +static const uint8_t MISO = 5; +static const uint8_t SCK = 4; +static const uint8_t A0 = 0; +static const uint8_t A1 = 1; +static const uint8_t A2 = 2; +static const uint8_t A3 = 3; +static const uint8_t A4 = 4; +static const uint8_t A5 = 5; #endif /* Pins_Arduino_h */ diff --git a/variants/Bee_Motion_S3/pins_arduino.h b/variants/Bee_Motion_S3/pins_arduino.h index 19025426c65..2c5759fc3ae 100644 --- a/variants/Bee_Motion_S3/pins_arduino.h +++ b/variants/Bee_Motion_S3/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x303A #define USB_PID 0x8113 @@ -9,14 +10,6 @@ #define USB_PRODUCT "Bee Motion S3" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 27 -#define NUM_ANALOG_INPUTS 11 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; @@ -81,5 +74,12 @@ static const uint8_t LDO2 = 34; static const uint8_t RGB_DATA = 40; static const uint8_t RGB_PWR = 34; +#define PIN_NEOPIXEL RGB_DATA +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 #endif /* Pins_Arduino_h */ diff --git a/variants/Bee_S3/pins_arduino.h b/variants/Bee_S3/pins_arduino.h index b095fb8fd7f..7defb6232a4 100644 --- a/variants/Bee_S3/pins_arduino.h +++ b/variants/Bee_S3/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x303A #define USB_PID 0x8110 @@ -9,14 +10,6 @@ #define USB_PRODUCT "BeeS3" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 45 -#define NUM_DIGITAL_PINS 15 -#define NUM_ANALOG_INPUTS 8 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; @@ -73,4 +66,12 @@ static const uint8_t VBAT_VOLTAGE = 1; static const uint8_t RGB_DATA = 48; static const uint8_t RGB_PWR = 34; +#define PIN_NEOPIXEL RGB_DATA +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 + #endif /* Pins_Arduino_h */ diff --git a/variants/ET-Board/pins_arduino.h b/variants/ET-Board/pins_arduino.h index 9dada4cb50d..4c198032128 100644 --- a/variants/ET-Board/pins_arduino.h +++ b/variants/ET-Board/pins_arduino.h @@ -3,19 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 7 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 5; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN - - static const uint8_t TX = 34; static const uint8_t RX = 35; diff --git a/variants/Edgebox-ESP-100/pins_arduino.h b/variants/Edgebox-ESP-100/pins_arduino.h index ae212f44dea..0c14982ec9b 100644 --- a/variants/Edgebox-ESP-100/pins_arduino.h +++ b/variants/Edgebox-ESP-100/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 34 -#define NUM_DIGITAL_PINS 34 -#define NUM_ANALOG_INPUTS 2 - -#define analogInputToDigitalPin(p) (((p)<2)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<34)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - //Programming and Debugging Port static const uint8_t TXD = 43; static const uint8_t RXD = 44; diff --git a/variants/Microduino-esp32/pins_arduino.h b/variants/Microduino-esp32/pins_arduino.h index 034bd6173b3..862a439ec46 100644 --- a/variants/Microduino-esp32/pins_arduino.h +++ b/variants/Microduino-esp32/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 22 -#define NUM_ANALOG_INPUTS 12 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = -1; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN #define MTDO 15 #define MTDI 12 diff --git a/variants/Nebula_S3/pins_arduino.h b/variants/Nebula_S3/pins_arduino.h index 513aef8409e..bb88e0c51e0 100644 --- a/variants/Nebula_S3/pins_arduino.h +++ b/variants/Nebula_S3/pins_arduino.h @@ -6,18 +6,8 @@ #define USB_VID 0x303a #define USB_PID 0x1001 -#define EXTERNAL_NUM_INTERRUPTS 20 -#define NUM_DIGITAL_PINS 20 -#define NUM_ANALOG_INPUTS 6 - -#define analogInputToDigitalPin(p) (((p)<6)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<20)?(p):-1) -#define digitalPinHasPWM(p) (p < 20) - - static const uint8_t LED_BUILTIN = 45; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 diff --git a/variants/S_ODI_Ultra_v1/pins_arduino.h b/variants/S_ODI_Ultra_v1/pins_arduino.h index 51278ce94be..064cf580bb2 100644 --- a/variants/S_ODI_Ultra_v1/pins_arduino.h +++ b/variants/S_ODI_Ultra_v1/pins_arduino.h @@ -3,18 +3,9 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 2; static const uint8_t LED_BUILTINB = 4; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN #define BUILTIN_LED2 LED_BUILTINB static const uint8_t TX = 1; diff --git a/variants/VALTRACK_V4_MFW_ESP32_C3/pins_arduino.h b/variants/VALTRACK_V4_MFW_ESP32_C3/pins_arduino.h index 4e3c771578b..b473c8afff1 100644 --- a/variants/VALTRACK_V4_MFW_ESP32_C3/pins_arduino.h +++ b/variants/VALTRACK_V4_MFW_ESP32_C3/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 22 -#define NUM_DIGITAL_PINS 22 -#define NUM_ANALOG_INPUTS 6 - -#define analogInputToDigitalPin(p) (((p) -#define EXTERNAL_NUM_INTERRUPTS 22 -#define NUM_DIGITAL_PINS 22 -#define NUM_ANALOG_INPUTS 6 - -#define analogInputToDigitalPin(p) (((p) -#define EXTERNAL_NUM_INTERRUPTS 22 -#define NUM_DIGITAL_PINS 22 -#define NUM_ANALOG_INPUTS 6 - -#define analogInputToDigitalPin(p) (((p) +#include "soc/soc_caps.h" -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - -static const uint8_t LED_BUILTIN = 13; +// Neopixel +#define PIN_NEOPIXEL 0 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 static const uint8_t TX = 8; static const uint8_t RX = 7; diff --git a/variants/adafruit_feather_esp32s2/pins_arduino.h b/variants/adafruit_feather_esp32s2/pins_arduino.h index 261377de89c..399f0b601f7 100644 --- a/variants/adafruit_feather_esp32s2/pins_arduino.h +++ b/variants/adafruit_feather_esp32s2/pins_arduino.h @@ -2,7 +2,7 @@ #define Pins_Arduino_h #include - +#include "soc/soc_caps.h" #define USB_VID 0x239A #define USB_PID 0x80EB @@ -10,18 +10,15 @@ #define USB_PRODUCT "Feather ESP32-S2" #define USB_SERIAL "" // Empty string for MAC adddress +// Neopixel +#define PIN_NEOPIXEL 33 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - -#define LED_BUILTIN 13 - -#define PIN_NEOPIXEL 33 #define NEOPIXEL_NUM 1 // number of neopixels #define NEOPIXEL_POWER 21 // power pin #define NEOPIXEL_POWER_ON HIGH // power pin state when on diff --git a/variants/adafruit_feather_esp32s2_reversetft/pins_arduino.h b/variants/adafruit_feather_esp32s2_reversetft/pins_arduino.h index 6758b16a898..317299d60b8 100644 --- a/variants/adafruit_feather_esp32s2_reversetft/pins_arduino.h +++ b/variants/adafruit_feather_esp32s2_reversetft/pins_arduino.h @@ -2,7 +2,7 @@ #define Pins_Arduino_h #include - +#include "soc/soc_caps.h" #define USB_VID 0x239A #define USB_PID 0x80ED @@ -10,18 +10,15 @@ #define USB_PRODUCT "Feather ESP32-S2 Reverse TFT" #define USB_SERIAL "" // Empty string for MAC adddress +// Neopixel +#define PIN_NEOPIXEL 33 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - -#define LED_BUILTIN 13 - -#define PIN_NEOPIXEL 33 #define NEOPIXEL_NUM 1 // number of neopixels #define NEOPIXEL_POWER 21 // power pin #define NEOPIXEL_POWER_ON HIGH // power pin state when on diff --git a/variants/adafruit_feather_esp32s2_tft/pins_arduino.h b/variants/adafruit_feather_esp32s2_tft/pins_arduino.h index 8eaef02334d..0c6a68c0c2b 100644 --- a/variants/adafruit_feather_esp32s2_tft/pins_arduino.h +++ b/variants/adafruit_feather_esp32s2_tft/pins_arduino.h @@ -2,7 +2,7 @@ #define Pins_Arduino_h #include - +#include "soc/soc_caps.h" #define USB_VID 0x239A #define USB_PID 0x810F @@ -10,18 +10,15 @@ #define USB_PRODUCT "Feather ESP32-S2 TFT" #define USB_SERIAL "" // Empty string for MAC adddress +// Neopixel +#define PIN_NEOPIXEL 33 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - -#define LED_BUILTIN 13 - -#define PIN_NEOPIXEL 33 #define NEOPIXEL_NUM 1 // number of neopixels #define NEOPIXEL_POWER 34 // power pin #define NEOPIXEL_POWER_ON HIGH // power pin state when on diff --git a/variants/adafruit_feather_esp32s3/pins_arduino.h b/variants/adafruit_feather_esp32s3/pins_arduino.h index 16ae97b640f..e49848fd773 100644 --- a/variants/adafruit_feather_esp32s3/pins_arduino.h +++ b/variants/adafruit_feather_esp32s3/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x239A #define USB_PID 0x811B @@ -9,17 +10,14 @@ #define USB_PRODUCT "Feather ESP32-S3" #define USB_SERIAL "" // Empty string for MAC adddress -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - -#define LED_BUILTIN 13 - #define PIN_NEOPIXEL 33 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 + #define NEOPIXEL_NUM 1 // number of neopixels #define NEOPIXEL_POWER 21 // power pin #define NEOPIXEL_POWER_ON HIGH // power pin state when on diff --git a/variants/adafruit_feather_esp32s3_nopsram/pins_arduino.h b/variants/adafruit_feather_esp32s3_nopsram/pins_arduino.h index 58a23a17f7c..3265df48c7d 100644 --- a/variants/adafruit_feather_esp32s3_nopsram/pins_arduino.h +++ b/variants/adafruit_feather_esp32s3_nopsram/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x239A #define USB_PID 0x8113 @@ -9,17 +10,14 @@ #define USB_PRODUCT "Feather ESP32-S3 No PSRAM" #define USB_SERIAL "" // Empty string for MAC adddress -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - -#define LED_BUILTIN 13 - #define PIN_NEOPIXEL 33 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 + #define NEOPIXEL_NUM 1 // number of neopixels #define NEOPIXEL_POWER 21 // power pin #define NEOPIXEL_POWER_ON HIGH // power pin state when on diff --git a/variants/adafruit_feather_esp32s3_reversetft/pins_arduino.h b/variants/adafruit_feather_esp32s3_reversetft/pins_arduino.h index 594940f5710..d920c5764ad 100644 --- a/variants/adafruit_feather_esp32s3_reversetft/pins_arduino.h +++ b/variants/adafruit_feather_esp32s3_reversetft/pins_arduino.h @@ -2,7 +2,7 @@ #define Pins_Arduino_h #include - +#include "soc/soc_caps.h" #define USB_VID 0x239A #define USB_PID 0x8123 @@ -10,18 +10,14 @@ #define USB_PRODUCT "Feather ESP32-S3 Reverse TFT" #define USB_SERIAL "" // Empty string for MAC adddress - -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - -#define LED_BUILTIN 13 - #define PIN_NEOPIXEL 33 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 + #define NEOPIXEL_NUM 1 // number of neopixels #define NEOPIXEL_POWER 21 // power pin #define NEOPIXEL_POWER_ON HIGH // power pin state when on diff --git a/variants/adafruit_feather_esp32s3_tft/pins_arduino.h b/variants/adafruit_feather_esp32s3_tft/pins_arduino.h index d1a9dc5ff81..65e67d10e9a 100644 --- a/variants/adafruit_feather_esp32s3_tft/pins_arduino.h +++ b/variants/adafruit_feather_esp32s3_tft/pins_arduino.h @@ -2,7 +2,7 @@ #define Pins_Arduino_h #include - +#include "soc/soc_caps.h" #define USB_VID 0x239A #define USB_PID 0x811D @@ -10,18 +10,14 @@ #define USB_PRODUCT "Feather ESP32-S3 TFT" #define USB_SERIAL "" // Empty string for MAC adddress - -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - -#define LED_BUILTIN 13 - #define PIN_NEOPIXEL 33 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 + #define NEOPIXEL_NUM 1 // number of neopixels #define NEOPIXEL_POWER 34 // power pin #define NEOPIXEL_POWER_ON HIGH // power pin state when on diff --git a/variants/adafruit_funhouse_esp32s2/pins_arduino.h b/variants/adafruit_funhouse_esp32s2/pins_arduino.h index 6b4fa1ec5b3..e59252d7cf2 100644 --- a/variants/adafruit_funhouse_esp32s2/pins_arduino.h +++ b/variants/adafruit_funhouse_esp32s2/pins_arduino.h @@ -10,15 +10,6 @@ #define USB_PRODUCT "Funhouse ESP32-S2" #define USB_SERIAL "" // Empty string for MAC adddress - -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - #define LED_BUILTIN 37 #define PIN_BUTTON1 3 diff --git a/variants/adafruit_itsybitsy_esp32/pins_arduino.h b/variants/adafruit_itsybitsy_esp32/pins_arduino.h index d81c077c91d..4eecff69887 100644 --- a/variants/adafruit_itsybitsy_esp32/pins_arduino.h +++ b/variants/adafruit_itsybitsy_esp32/pins_arduino.h @@ -2,21 +2,17 @@ #define Pins_Arduino_h #include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - -static const uint8_t LED_BUILTIN = 13; -#define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN +#include "soc/soc_caps.h" // Neopixel static const uint8_t PIN_NEOPIXEL = 0; +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 + static const uint8_t NEOPIXEL_POWER = 2; static const uint8_t TX = 20; diff --git a/variants/adafruit_magtag29_esp32s2/pins_arduino.h b/variants/adafruit_magtag29_esp32s2/pins_arduino.h index 610312d05fd..92d78503514 100644 --- a/variants/adafruit_magtag29_esp32s2/pins_arduino.h +++ b/variants/adafruit_magtag29_esp32s2/pins_arduino.h @@ -2,7 +2,7 @@ #define Pins_Arduino_h #include - +#include "soc/soc_caps.h" #define USB_VID 0x239A #define USB_PID 0x80E5 @@ -10,18 +10,15 @@ #define USB_PRODUCT "EPD MagTag 2.9\" ESP32-S2" #define USB_SERIAL "" // Empty string for MAC adddress - -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - -#define LED_BUILTIN 13 - +// Neopixel #define PIN_NEOPIXEL 1 // D1 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); // Only 1 NeoPixel will be affected +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 + #define NEOPIXEL_NUM 4 // number of neopixels #define NEOPIXEL_POWER 21 // power pin #define NEOPIXEL_POWER_ON LOW // power pin state when on diff --git a/variants/adafruit_matrixportal_esp32s3/pins_arduino.h b/variants/adafruit_matrixportal_esp32s3/pins_arduino.h index fc7e69f5c1d..fa08fc95141 100644 --- a/variants/adafruit_matrixportal_esp32s3/pins_arduino.h +++ b/variants/adafruit_matrixportal_esp32s3/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x239A #define USB_PID 0x8125 @@ -9,18 +10,15 @@ #define USB_PRODUCT "MatrixPortal ESP32-S3" #define USB_SERIAL "" // Empty string for MAC adddress -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 6 - -#define analogInputToDigitalPin(p) (((p) - +#include "soc/soc_caps.h" #define USB_VID 0x239A #define USB_PID 0x80DF @@ -10,17 +10,13 @@ #define USB_PRODUCT "Metro ESP32-S2" #define USB_SERIAL "" // Empty string for MAC adddress -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - #define LED_BUILTIN 42 #define PIN_NEOPIXEL 45 +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT) +#define RGB_BRIGHTNESS 64 + #define NEOPIXEL_NUM 1 #define PIN_BUTTON1 0 // BOOT0 switch diff --git a/variants/adafruit_metro_esp32s3/pins_arduino.h b/variants/adafruit_metro_esp32s3/pins_arduino.h index e4e69345cb7..dd6e1cd3e9c 100644 --- a/variants/adafruit_metro_esp32s3/pins_arduino.h +++ b/variants/adafruit_metro_esp32s3/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x239A #define USB_PID 0x8145 @@ -9,18 +10,15 @@ #define USB_PRODUCT "Metro ESP32-S3" #define USB_SERIAL "" // Empty string for MAC adddress -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - -#define LED_BUILTIN 13 - #define PIN_NEOPIXEL 45 #define NEOPIXEL_PIN 45 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 + #define NEOPIXEL_NUM 1 #define PIN_BUTTON1 0 // BOOT0 switch diff --git a/variants/adafruit_qtpy_esp32/pins_arduino.h b/variants/adafruit_qtpy_esp32/pins_arduino.h index b22d0d5b780..f87fe4dd8fe 100644 --- a/variants/adafruit_qtpy_esp32/pins_arduino.h +++ b/variants/adafruit_qtpy_esp32/pins_arduino.h @@ -2,16 +2,15 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - -#define PIN_NEOPIXEL 5 #define NEOPIXEL_POWER 8 static const uint8_t TX = 32; diff --git a/variants/adafruit_qtpy_esp32c3/pins_arduino.h b/variants/adafruit_qtpy_esp32c3/pins_arduino.h index 6c93bfd5820..b5fdc5a1f59 100644 --- a/variants/adafruit_qtpy_esp32c3/pins_arduino.h +++ b/variants/adafruit_qtpy_esp32c3/pins_arduino.h @@ -2,17 +2,16 @@ #define Pins_Arduino_h #include - -#define EXTERNAL_NUM_INTERRUPTS 22 -#define NUM_DIGITAL_PINS 22 -#define NUM_ANALOG_INPUTS 6 - -#define analogInputToDigitalPin(p) (((p) - +#include "soc/soc_caps.h" #define USB_VID 0x239A #define USB_PID 0x8111 @@ -10,18 +10,15 @@ #define USB_PRODUCT "QT Py ESP32-S2" #define USB_SERIAL "" // Empty string for MAC adddress +#define PIN_NEOPIXEL 39 +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT) +#define RGB_BRIGHTNESS 64 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - -//#define LED_BUILTIN 13 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); +#define BUILTIN_LED LED_BUILTIN // backward compatibility -#define PIN_NEOPIXEL 39 #define NEOPIXEL_NUM 1 // number of neopixels #define NEOPIXEL_POWER 38 // power pin #define NEOPIXEL_POWER_ON HIGH // power pin state when on diff --git a/variants/adafruit_qtpy_esp32s3_n4r2/pins_arduino.h b/variants/adafruit_qtpy_esp32s3_n4r2/pins_arduino.h index 789161da4ad..a4892c6b553 100644 --- a/variants/adafruit_qtpy_esp32s3_n4r2/pins_arduino.h +++ b/variants/adafruit_qtpy_esp32s3_n4r2/pins_arduino.h @@ -10,14 +10,6 @@ #define USB_PRODUCT "QT Py ESP32-S3 (4MB Flash 2MB PSRAM)" #define USB_SERIAL "" // Empty string for MAC adddress -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - #define PIN_NEOPIXEL 39 #define NEOPIXEL_NUM 1 // number of neopixels #define NEOPIXEL_POWER 38 // power pin @@ -25,7 +17,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 diff --git a/variants/adafruit_qtpy_esp32s3_nopsram/pins_arduino.h b/variants/adafruit_qtpy_esp32s3_nopsram/pins_arduino.h index 38305f67e36..0197b2dd810 100644 --- a/variants/adafruit_qtpy_esp32s3_nopsram/pins_arduino.h +++ b/variants/adafruit_qtpy_esp32s3_nopsram/pins_arduino.h @@ -10,22 +10,15 @@ #define USB_PRODUCT "QT Py ESP32-S3 No PSRAM" #define USB_SERIAL "" // Empty string for MAC adddress -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - #define PIN_NEOPIXEL 39 #define NEOPIXEL_NUM 1 // number of neopixels #define NEOPIXEL_POWER 38 // power pin #define NEOPIXEL_POWER_ON HIGH // power pin state when on +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 diff --git a/variants/alksesp32/pins_arduino.h b/variants/alksesp32/pins_arduino.h index a40501ab20d..d1971b3ac56 100644 --- a/variants/alksesp32/pins_arduino.h +++ b/variants/alksesp32/pins_arduino.h @@ -3,19 +3,10 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - #define ALKSESP32 // tell library to not map pins again static const uint8_t LED_BUILTIN = 23; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/atmegazero_esp32s2/pins_arduino.h b/variants/atmegazero_esp32s2/pins_arduino.h index 44df45e0b18..93f8fe5e598 100644 --- a/variants/atmegazero_esp32s2/pins_arduino.h +++ b/variants/atmegazero_esp32s2/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x239A #define USB_PID 0x800A @@ -9,15 +10,14 @@ #define USB_PRODUCT "ATMZ-ESP32S2" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t NEOPIXEL = 40; +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = (NEOPIXEL + SOC_GPIO_PIN_COUNT); +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 + static const uint8_t PD5 = 0; static const uint8_t TX = 43; diff --git a/variants/bpi-bit/pins_arduino.h b/variants/bpi-bit/pins_arduino.h index f1ef3003662..80ff9c2746b 100644 --- a/variants/bpi-bit/pins_arduino.h +++ b/variants/bpi-bit/pins_arduino.h @@ -2,22 +2,22 @@ #define Pins_Arduino_h #include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1) -#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1) -#define digitalPinHasPWM(p) (p < 34) +#include "soc/soc_caps.h" static const uint8_t BUZZER = 25; static const uint8_t BUTTON_A = 35; static const uint8_t BUTTON_B = 27; +// NeoPixel Matrix 5 x 5 static const uint8_t RGB_LED = 4; +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +#define LED_BUILTIN (RGB_LED + SOC_GPIO_PIN_COUNT) // Just a single LED in the Matrix +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 static const uint8_t LIGHT_SENSOR1 = 36; static const uint8_t LIGHT_SENSOR2 = 39; diff --git a/variants/bpi_leaf_s3/pins_arduino.h b/variants/bpi_leaf_s3/pins_arduino.h index 56876ce9c9d..bf03da6ca27 100644 --- a/variants/bpi_leaf_s3/pins_arduino.h +++ b/variants/bpi_leaf_s3/pins_arduino.h @@ -10,23 +10,17 @@ #define USB_PRODUCT "BPI-Leaf-S3" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - // Some boards have too low voltage on this pin (board design bug) // Use different pin with 3V and connect with 48 // and change this setup for the chosen pin (for example 38) -static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48; +#define PIN_NEOPIXEL 48 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 25 -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/ch_denky/pins_arduino.h b/variants/ch_denky/pins_arduino.h index 23a786e0e53..ac202d527db 100644 --- a/variants/ch_denky/pins_arduino.h +++ b/variants/ch_denky/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/cnrs_aw2eth/pins_arduino.h b/variants/cnrs_aw2eth/pins_arduino.h index 56db3aebe58..b21c5889a38 100644 --- a/variants/cnrs_aw2eth/pins_arduino.h +++ b/variants/cnrs_aw2eth/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/connaxio_espoir/pins_arduino.h b/variants/connaxio_espoir/pins_arduino.h index ac5d025afd8..6e9a4fa3ceb 100644 --- a/variants/connaxio_espoir/pins_arduino.h +++ b/variants/connaxio_espoir/pins_arduino.h @@ -8,14 +8,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - /* USB UART */ static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/crabik_slot_esp32_s3/pins_arduino.h b/variants/crabik_slot_esp32_s3/pins_arduino.h index 31aa9ee79cb..18484f90ea3 100644 --- a/variants/crabik_slot_esp32_s3/pins_arduino.h +++ b/variants/crabik_slot_esp32_s3/pins_arduino.h @@ -9,17 +9,8 @@ #define USB_PRODUCT "Slot ESP32-S3" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t LED_BUILTIN = 21; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t S1 = 1; static const uint8_t S2 = 12; diff --git a/variants/cytron_maker_feather_aiot_s3/pins_arduino.h b/variants/cytron_maker_feather_aiot_s3/pins_arduino.h index bd3e9c278c9..c91a292578d 100644 --- a/variants/cytron_maker_feather_aiot_s3/pins_arduino.h +++ b/variants/cytron_maker_feather_aiot_s3/pins_arduino.h @@ -10,23 +10,11 @@ #define USB_PRODUCT "Maker Feather AIoT S3" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 20 -#define NUM_ANALOG_INPUTS 12 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - - - static const uint8_t LED_BUILTIN = 2; // Status LED. static const uint8_t RGB_BUILTIN = SOC_GPIO_PIN_COUNT + 46; // RGB LED. #define BUILTIN_LED LED_BUILTIN // Backward compatibility -#define LED_BUILTIN LED_BUILTIN #define LED LED_BUILTIN -#define RGB_BUILTIN RGB_BUILTIN #define RGB RGB_BUILTIN #define NEOPIXEL RGB_BUILTIN #define RGB_BRIGHTNESS 65 diff --git a/variants/d-duino-32/pins_arduino.h b/variants/d-duino-32/pins_arduino.h index 579cdfac77b..935261996b1 100644 --- a/variants/d-duino-32/pins_arduino.h +++ b/variants/d-duino-32/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/d1_mini32/pins_arduino.h b/variants/d1_mini32/pins_arduino.h index 69982798610..757adf14149 100644 --- a/variants/d1_mini32/pins_arduino.h +++ b/variants/d1_mini32/pins_arduino.h @@ -6,7 +6,6 @@ static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t _VBAT = 35; // battery voltage #define PIN_WIRE_SDA SDA // backward compatibility diff --git a/variants/d1_uno32/pins_arduino.h b/variants/d1_uno32/pins_arduino.h index 8bf0a6d7fa3..1f6b48397e2 100644 --- a/variants/d1_uno32/pins_arduino.h +++ b/variants/d1_uno32/pins_arduino.h @@ -5,15 +5,6 @@ #include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; @@ -34,7 +25,6 @@ static const uint8_t A5 = 39; static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN #define PIN_WIRE_SDA SDA // backward compatibility #define PIN_WIRE_SCL SCL // backward compatibility diff --git a/variants/d32/d32_core.h b/variants/d32/d32_core.h index 0416719f2cb..e658c980896 100644 --- a/variants/d32/d32_core.h +++ b/variants/d32/d32_core.h @@ -1,14 +1,6 @@ #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)?(analogChannelToDigitalPin(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; diff --git a/variants/d32/pins_arduino.h b/variants/d32/pins_arduino.h index 810eeae6de2..065cef91ea8 100644 --- a/variants/d32/pins_arduino.h +++ b/variants/d32/pins_arduino.h @@ -6,7 +6,6 @@ static const uint8_t LED_BUILTIN = 5; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN 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 index ce36f21bc08..97535b76566 100644 --- a/variants/d32_pro/pins_arduino.h +++ b/variants/d32_pro/pins_arduino.h @@ -6,7 +6,6 @@ static const uint8_t LED_BUILTIN = 5; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t _VBAT = 35; // battery voltage #define TF_CS 4 // TF (Micro SD Card) CS pin diff --git a/variants/deneyapkart/pins_arduino.h b/variants/deneyapkart/pins_arduino.h index 9b28273cc7d..749b2822b4b 100644 --- a/variants/deneyapkart/pins_arduino.h +++ b/variants/deneyapkart/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 4; #define BUILTIN_LED LED_BUILTIN -#define LED_BUILTIN LED_BUILTIN #define LEDB LED_BUILTIN #define LEDR 3 #define LEDG 1 diff --git a/variants/deneyapkart1A/pins_arduino.h b/variants/deneyapkart1A/pins_arduino.h index a079608fe16..c423d4433a8 100644 --- a/variants/deneyapkart1A/pins_arduino.h +++ b/variants/deneyapkart1A/pins_arduino.h @@ -4,17 +4,8 @@ #include #include "soc/soc_caps.h" -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+13; #define BUILTIN_LED LED_BUILTIN -#define LED_BUILTIN LED_BUILTIN #define RGB_BUILTIN LED_BUILTIN #define RGBLED LED_BUILTIN #define RGB_BRIGHTNESS 64 diff --git a/variants/deneyapkart1Av2/pins_arduino.h b/variants/deneyapkart1Av2/pins_arduino.h index 24928d48422..ef0a0d85d91 100644 --- a/variants/deneyapkart1Av2/pins_arduino.h +++ b/variants/deneyapkart1Av2/pins_arduino.h @@ -10,17 +10,8 @@ #define USB_PRODUCT "DENEYAP KART 1A v2" #define USB_SERIAL "" // Empty string for MAC adddress -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48; #define BUILTIN_LED LED_BUILTIN -#define LED_BUILTIN LED_BUILTIN #define RGB_BUILTIN LED_BUILTIN #define RGBLED LED_BUILTIN #define RGB_BRIGHTNESS 64 diff --git a/variants/deneyapkartg/pins_arduino.h b/variants/deneyapkartg/pins_arduino.h index f73f172876d..257e3e57159 100644 --- a/variants/deneyapkartg/pins_arduino.h +++ b/variants/deneyapkartg/pins_arduino.h @@ -10,17 +10,8 @@ #define USB_PRODUCT "DENEYAP KART G" #define USB_SERIAL "" // Empty string for MAC adddress -#define EXTERNAL_NUM_INTERRUPTS 22 -#define NUM_DIGITAL_PINS 22 -#define NUM_ANALOG_INPUTS 6 - -#define analogInputToDigitalPin(p) (((p) - +#include "soc/soc_caps.h" #define USB_VID 0x303a #define USB_PID 0x80FF @@ -10,18 +10,14 @@ #define USB_PRODUCT "MiniMain ESP32-S2" #define USB_SERIAL "" // Empty string for MAC adddress - -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - -#define LED_BUILTIN 13 - #define PIN_NEOPIXEL 33 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 + #define NEOPIXEL_NUM 1 // number of neopixels #define NEOPIXEL_POWER 21 // power pin #define NEOPIXEL_POWER_ON HIGH // power pin state when on diff --git a/variants/dfrobot_beetle_esp32c3/pins_arduino.h b/variants/dfrobot_beetle_esp32c3/pins_arduino.h index 735f894281f..c3d50852cbf 100644 --- a/variants/dfrobot_beetle_esp32c3/pins_arduino.h +++ b/variants/dfrobot_beetle_esp32c3/pins_arduino.h @@ -9,16 +9,8 @@ #define USB_PRODUCT "Beetle ESP32-C3" #define USB_SERIAL "" // Empty string for MAC adddress - -#define EXTERNAL_NUM_INTERRUPTS 22 -#define NUM_DIGITAL_PINS 22 -#define NUM_ANALOG_INPUTS 6 - -#define analogInputToDigitalPin(p) (((p) -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - typedef unsigned char uint8_t; static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN - - static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/dfrobot_firebeetle2_esp32s3/pins_arduino.h b/variants/dfrobot_firebeetle2_esp32s3/pins_arduino.h index 91e164478b2..1c206c6868a 100644 --- a/variants/dfrobot_firebeetle2_esp32s3/pins_arduino.h +++ b/variants/dfrobot_firebeetle2_esp32s3/pins_arduino.h @@ -9,15 +9,6 @@ #define USB_PRODUCT "FireBeetle 2 ESP32-S3" #define USB_SERIAL "" // Empty string for MAC adddress -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - - static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/dfrobot_romeo_esp32s3/pins_arduino.h b/variants/dfrobot_romeo_esp32s3/pins_arduino.h index 1c16f6e9f65..40774c71ddf 100644 --- a/variants/dfrobot_romeo_esp32s3/pins_arduino.h +++ b/variants/dfrobot_romeo_esp32s3/pins_arduino.h @@ -3,17 +3,6 @@ #include - - -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - - static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/doitESP32devkitV1/pins_arduino.h b/variants/doitESP32devkitV1/pins_arduino.h index 69e4138428f..fd642f2aaaa 100644 --- a/variants/doitESP32devkitV1/pins_arduino.h +++ b/variants/doitESP32devkitV1/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/doitESPduino32/pins_arduino.h b/variants/doitESPduino32/pins_arduino.h index 991090a5fac..c64c241a570 100644 --- a/variants/doitESPduino32/pins_arduino.h +++ b/variants/doitESPduino32/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility diff --git a/variants/dpu_esp32/pins_arduino.h b/variants/dpu_esp32/pins_arduino.h index ff6cb1e9ba4..1b2e1b6634f 100644 --- a/variants/dpu_esp32/pins_arduino.h +++ b/variants/dpu_esp32/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/esp32-devkit-lipo/pins_arduino.h b/variants/esp32-devkit-lipo/pins_arduino.h index d784eb0297a..fb715c0e79e 100644 --- a/variants/esp32-devkit-lipo/pins_arduino.h +++ b/variants/esp32-devkit-lipo/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/esp32-evb/pins_arduino.h b/variants/esp32-evb/pins_arduino.h index 327a5ba92e4..43691f02c7b 100644 --- a/variants/esp32-evb/pins_arduino.h +++ b/variants/esp32-evb/pins_arduino.h @@ -3,15 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - - static const uint8_t KEY_BUILTIN = 34; static const uint8_t TX = 1; diff --git a/variants/esp32-gateway/pins_arduino.h b/variants/esp32-gateway/pins_arduino.h index 5dd5d7e0fd9..96297b83997 100644 --- a/variants/esp32-gateway/pins_arduino.h +++ b/variants/esp32-gateway/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - #if defined (ARDUINO_ESP32_GATEWAY_E) || defined (ARDUINO_ESP32_GATEWAY_F) #define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT #define ETH_PHY_POWER 5 @@ -18,7 +10,6 @@ static const uint8_t LED_BUILTIN = 33; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 34; diff --git a/variants/esp32-poe-iso/pins_arduino.h b/variants/esp32-poe-iso/pins_arduino.h index 06a0dc15afd..b9033d74cfe 100644 --- a/variants/esp32-poe-iso/pins_arduino.h +++ b/variants/esp32-poe-iso/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - #define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT #define ETH_PHY_POWER 12 diff --git a/variants/esp32-poe/pins_arduino.h b/variants/esp32-poe/pins_arduino.h index 06a0dc15afd..b9033d74cfe 100644 --- a/variants/esp32-poe/pins_arduino.h +++ b/variants/esp32-poe/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - #define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT #define ETH_PHY_POWER 12 diff --git a/variants/esp32-trueverit-iot-driver-mkii/pins_arduino.h b/variants/esp32-trueverit-iot-driver-mkii/pins_arduino.h index aea4585f266..65ba4060e43 100644 --- a/variants/esp32-trueverit-iot-driver-mkii/pins_arduino.h +++ b/variants/esp32-trueverit-iot-driver-mkii/pins_arduino.h @@ -6,14 +6,6 @@ static const uint8_t LED_BUILTIN = 18; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1) -#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1) -#define digitalPinHasPWM(p) (p < 34) - #define TX1 12 #define RX1 13 #define TX2 33 diff --git a/variants/esp32-trueverit-iot-driver-mkiii/pins_arduino.h b/variants/esp32-trueverit-iot-driver-mkiii/pins_arduino.h index b86654113b8..a10e4227eac 100644 --- a/variants/esp32-trueverit-iot-driver-mkiii/pins_arduino.h +++ b/variants/esp32-trueverit-iot-driver-mkiii/pins_arduino.h @@ -6,14 +6,6 @@ static const uint8_t LED_BUILTIN = 18; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1) -#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1) -#define digitalPinHasPWM(p) (p < 34) - #define TX1 12 #define RX1 13 #define TX2 33 diff --git a/variants/esp32-trueverit-iot-driver/pins_arduino.h b/variants/esp32-trueverit-iot-driver/pins_arduino.h index f6fa15fc4f2..90a1731f1f5 100644 --- a/variants/esp32-trueverit-iot-driver/pins_arduino.h +++ b/variants/esp32-trueverit-iot-driver/pins_arduino.h @@ -6,14 +6,6 @@ static const uint8_t LED_BUILTIN = 18; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1) -#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1) -#define digitalPinHasPWM(p) (p < 34) - #define TX1 12 #define RX1 13 #define TX2 33 diff --git a/variants/esp32/pins_arduino.h b/variants/esp32/pins_arduino.h index 4ad96ccef51..27ecc063483 100644 --- a/variants/esp32/pins_arduino.h +++ b/variants/esp32/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/esp320/pins_arduino.h b/variants/esp320/pins_arduino.h index f62b6502c42..3619264e433 100644 --- a/variants/esp320/pins_arduino.h +++ b/variants/esp320/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 11 -#define NUM_DIGITAL_PINS 12 -#define NUM_ANALOG_INPUTS 5 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 5; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/esp32_s3r8n16/pins_arduino.h b/variants/esp32_s3r8n16/pins_arduino.h index 919765a7583..844e0764139 100644 --- a/variants/esp32_s3r8n16/pins_arduino.h +++ b/variants/esp32_s3r8n16/pins_arduino.h @@ -10,14 +10,6 @@ #define USB_PRODUCT "4D Systems gen4-ESP32 16MB Modules (ESP32-S3R8n16)" //#define USB_CLASS 2 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/esp32c3/pins_arduino.h b/variants/esp32c3/pins_arduino.h index ab28240d4b4..16704f96a30 100644 --- a/variants/esp32c3/pins_arduino.h +++ b/variants/esp32c3/pins_arduino.h @@ -4,20 +4,14 @@ #include #include "soc/soc_caps.h" -#define EXTERNAL_NUM_INTERRUPTS 22 -#define NUM_DIGITAL_PINS 22 -#define NUM_ANALOG_INPUTS 6 - -static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+8; +#define PIN_NEOPIXEL 8 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 -#define analogInputToDigitalPin(p) (((p) #include "soc/soc_caps.h" -#define EXTERNAL_NUM_INTERRUPTS 24 -#define NUM_DIGITAL_PINS 24 -#define NUM_ANALOG_INPUTS 7 - -static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+8; +#define PIN_NEOPIXEL 8 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 -#define analogInputToDigitalPin(p) (((p) -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/esp32h2/pins_arduino.h b/variants/esp32h2/pins_arduino.h index dda584ccb49..fc9b6c8166b 100644 --- a/variants/esp32h2/pins_arduino.h +++ b/variants/esp32h2/pins_arduino.h @@ -4,20 +4,14 @@ #include #include "soc/soc_caps.h" -#define EXTERNAL_NUM_INTERRUPTS 28 -#define NUM_DIGITAL_PINS 28 -#define NUM_ANALOG_INPUTS 5 - -static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+8; +#define PIN_NEOPIXEL 8 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 -#define analogInputToDigitalPin(p) (((p) -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; @@ -71,5 +63,6 @@ static const uint8_t DAC1 = 25; static const uint8_t DAC2 = 26; static const uint8_t LED_BUILTIN = 2; +#define BUILTIN_LED LED_BUILTIN // backward compatibility #endif /* Pins_Arduino_h */ diff --git a/variants/esp32s2/pins_arduino.h b/variants/esp32s2/pins_arduino.h index 4ab0f712042..36d272159c9 100644 --- a/variants/esp32s2/pins_arduino.h +++ b/variants/esp32s2/pins_arduino.h @@ -4,21 +4,17 @@ #include #include "soc/soc_caps.h" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+18; // GPIO pin for Saola-1 & DevKitM-1 = 18 -//static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+45; // GPIO pin for Kaluga = 45 +// GPIO pin for Saola-1 & DevKitM-1 = 18 +#define PIN_NEOPIXEL 18 +// GPIO pin for Kaluga = 45 +//#define PIN_NEOPIXEL 45 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/esp32s2thing_plus/pins_arduino.h b/variants/esp32s2thing_plus/pins_arduino.h index 219f357981e..73929c7bd13 100644 --- a/variants/esp32s2thing_plus/pins_arduino.h +++ b/variants/esp32s2thing_plus/pins_arduino.h @@ -9,14 +9,6 @@ #define USB_PRODUCT "ESP32-S2 Thing Plus" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t LED_BUILTIN = 13; #define BUILTIN_LED LED_BUILTIN // backward compatibility diff --git a/variants/esp32s2usb/pins_arduino.h b/variants/esp32s2usb/pins_arduino.h index c6d464b79b4..636c62482a0 100644 --- a/variants/esp32s2usb/pins_arduino.h +++ b/variants/esp32s2usb/pins_arduino.h @@ -19,15 +19,6 @@ #define USB_FW_MSC_VOLUME_NAME "S2-Firmware" //max 11 chars #define USB_FW_MSC_SERIAL_NUMBER 0x00000000 - -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/esp32s3/pins_arduino.h b/variants/esp32s3/pins_arduino.h index d746573aa94..ae8ddcdad47 100644 --- a/variants/esp32s3/pins_arduino.h +++ b/variants/esp32s3/pins_arduino.h @@ -7,22 +7,17 @@ #define USB_VID 0x303a #define USB_PID 0x1001 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - // Some boards have too low voltage on this pin (board design bug) // Use different pin with 3V and connect with 48 // and change this setup for the chosen pin (for example 38) -static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48; +#define PIN_NEOPIXEL 48 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/esp32s3box/pins_arduino.h b/variants/esp32s3box/pins_arduino.h index 3ed655d1d3f..115ded2a2ec 100644 --- a/variants/esp32s3box/pins_arduino.h +++ b/variants/esp32s3box/pins_arduino.h @@ -6,14 +6,6 @@ #define USB_VID 0x303a #define USB_PID 0x1001 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/esp32s3camlcd/pins_arduino.h b/variants/esp32s3camlcd/pins_arduino.h index 308644ff52e..9580091dd3a 100644 --- a/variants/esp32s3camlcd/pins_arduino.h +++ b/variants/esp32s3camlcd/pins_arduino.h @@ -6,14 +6,6 @@ #define USB_VID 0x303a #define USB_PID 0x1001 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/esp32s3usbotg/pins_arduino.h b/variants/esp32s3usbotg/pins_arduino.h index 94edeeca74c..1983c45d1a4 100644 --- a/variants/esp32s3usbotg/pins_arduino.h +++ b/variants/esp32s3usbotg/pins_arduino.h @@ -6,14 +6,6 @@ #define USB_VID 0x303a #define USB_PID 0x1001 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/esp32thing/pins_arduino.h b/variants/esp32thing/pins_arduino.h index 2ab5614033f..2350ce82d1f 100644 --- a/variants/esp32thing/pins_arduino.h +++ b/variants/esp32thing/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 5; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/esp32thing_plus/pins_arduino.h b/variants/esp32thing_plus/pins_arduino.h index f1342b2c3c0..b9f898de0a5 100644 --- a/variants/esp32thing_plus/pins_arduino.h +++ b/variants/esp32thing_plus/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 13; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 17; static const uint8_t RX = 16; diff --git a/variants/esp32thing_plus_c/pins_arduino.h b/variants/esp32thing_plus_c/pins_arduino.h index e91fb212a99..e48102de0d2 100644 --- a/variants/esp32thing_plus_c/pins_arduino.h +++ b/variants/esp32thing_plus_c/pins_arduino.h @@ -4,20 +4,11 @@ #include #include "soc/soc_caps.h" -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 13; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() static const uint8_t RGB_BUILTIN = SOC_GPIO_PIN_COUNT+2; -#define RGB_BUILTIN RGB_BUILTIN #define RGB_BRIGHTNESS 64 static const uint8_t TX = 17; diff --git a/variants/esp32vn-iot-uno/pins_arduino.h b/variants/esp32vn-iot-uno/pins_arduino.h index c6e9127e254..fd196bdf34f 100644 --- a/variants/esp32vn-iot-uno/pins_arduino.h +++ b/variants/esp32vn-iot-uno/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/esp_c3_m1_i_kit/pins_arduino.h b/variants/esp_c3_m1_i_kit/pins_arduino.h index 0a1a0fe9fe8..ccad25ead2e 100644 --- a/variants/esp_c3_m1_i_kit/pins_arduino.h +++ b/variants/esp_c3_m1_i_kit/pins_arduino.h @@ -8,14 +8,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 22 -#define NUM_DIGITAL_PINS 22 -#define NUM_ANALOG_INPUTS 6 - -#define analogInputToDigitalPin(p) (((p) -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 5; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/espectro32/pins_arduino.h b/variants/espectro32/pins_arduino.h index 0be1919c1d6..6c664c941d7 100644 --- a/variants/espectro32/pins_arduino.h +++ b/variants/espectro32/pins_arduino.h @@ -7,17 +7,8 @@ #define ESPECTRO32_VERSION 1 #endif -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 15; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/espino32/pins_arduino.h b/variants/espino32/pins_arduino.h index 586f9725dc4..cb9c151fa3f 100644 --- a/variants/espino32/pins_arduino.h +++ b/variants/espino32/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 38 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 16; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t BUILTIN_KEY = 0; diff --git a/variants/feather_esp32/pins_arduino.h b/variants/feather_esp32/pins_arduino.h index 8b2b200ddcb..85f4ef4ba99 100644 --- a/variants/feather_esp32/pins_arduino.h +++ b/variants/feather_esp32/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 13; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 17; static const uint8_t RX = 16; diff --git a/variants/firebeetle32/pins_arduino.h b/variants/firebeetle32/pins_arduino.h index 15d54fe9a37..adba287b45e 100644 --- a/variants/firebeetle32/pins_arduino.h +++ b/variants/firebeetle32/pins_arduino.h @@ -3,21 +3,10 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - typedef unsigned char uint8_t; static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN - - static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/fm-devkit/pins_arduino.h b/variants/fm-devkit/pins_arduino.h index 5c1054fafb5..3a0f7ced06c 100644 --- a/variants/fm-devkit/pins_arduino.h +++ b/variants/fm-devkit/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/franzininho_wifi_esp32s2/pins_arduino.h b/variants/franzininho_wifi_esp32s2/pins_arduino.h index dd287f417d0..359251c98a4 100644 --- a/variants/franzininho_wifi_esp32s2/pins_arduino.h +++ b/variants/franzininho_wifi_esp32s2/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x303A #define USB_PID 0x80A9 @@ -10,15 +11,13 @@ #define USB_SERIAL "0" #define USB_WEBUSB_ENABLED false -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t PIN_NEOPIXEL = 18; +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/franzininho_wifi_msc_esp32s2/pins_arduino.h b/variants/franzininho_wifi_msc_esp32s2/pins_arduino.h index 58db2039d26..a78f7a8b300 100644 --- a/variants/franzininho_wifi_msc_esp32s2/pins_arduino.h +++ b/variants/franzininho_wifi_msc_esp32s2/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x303A #define USB_PID 0x80A9 @@ -17,15 +18,13 @@ #define USB_FW_MSC_VOLUME_NAME "S2-Firmware" //max 11 chars #define USB_FW_MSC_SERIAL_NUMBER 0x00000000 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t PIN_NEOPIXEL = 18; +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/frog32/pins_arduino.h b/variants/frog32/pins_arduino.h index 4ad96ccef51..27ecc063483 100644 --- a/variants/frog32/pins_arduino.h +++ b/variants/frog32/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/gpy/pins_arduino.h b/variants/gpy/pins_arduino.h index aa41db48bf1..1c067cace52 100644 --- a/variants/gpy/pins_arduino.h +++ b/variants/gpy/pins_arduino.h @@ -2,14 +2,7 @@ #define Pins_Arduino_h #include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 18 - -#define analogInputToDigitalPin(p) (((p)<40)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) +#include "soc/soc_caps.h" // Sequans Monarch LTE Cat M1/NB1 modem // NOTE: The Pycom pinout as well as spec sheet block diagram / pin details @@ -22,9 +15,13 @@ #define LTE_WAKE 27 // GPIO27 - Sequans modem wake-up interrupt #define LTE_BAUD 921600 -static const uint8_t LED_BUILTIN = 0; // ->2812 RGB !!! +// Neopixel +#define PIN_NEOPIXEL 0 // ->2812 RGB !!! +static const uint8_t LED_BUILTIN = PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT) +#define RGB_BRIGHTNESS 64 #define ANT_SELECT 21 // GPIO21 - WiFi external / internal antenna switch diff --git a/variants/healthypi4/pins_arduino.h b/variants/healthypi4/pins_arduino.h index b3eb897374a..4cca34c24a0 100644 --- a/variants/healthypi4/pins_arduino.h +++ b/variants/healthypi4/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 15; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 17; diff --git a/variants/heltec_wifi_kit_32/pins_arduino.h b/variants/heltec_wifi_kit_32/pins_arduino.h index 9efa252d564..992bab081f1 100644 --- a/variants/heltec_wifi_kit_32/pins_arduino.h +++ b/variants/heltec_wifi_kit_32/pins_arduino.h @@ -7,17 +7,8 @@ #define DISPLAY_HEIGHT 64 #define DISPLAY_WIDTH 128 -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 25; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/heltec_wifi_kit_32_v3/pins_arduino.h b/variants/heltec_wifi_kit_32_V3/pins_arduino.h similarity index 82% rename from variants/heltec_wifi_kit_32_v3/pins_arduino.h rename to variants/heltec_wifi_kit_32_V3/pins_arduino.h index 6e889604dd8..4c0cfa87326 100644 --- a/variants/heltec_wifi_kit_32_v3/pins_arduino.h +++ b/variants/heltec_wifi_kit_32_V3/pins_arduino.h @@ -2,23 +2,19 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define WIFI_Kit_32_V3 true #define DISPLAY_HEIGHT 64 #define DISPLAY_WIDTH 128 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - -static const uint8_t LED_BUILTIN = 35; +#define PIN_NEOPIXEL 35 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN - +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 static const uint8_t KEY_BUILTIN = 0; static const uint8_t TX = 43; diff --git a/variants/heltec_wifi_lora_32/pins_arduino.h b/variants/heltec_wifi_lora_32/pins_arduino.h index ee5a2affd46..71ec6eb5f7d 100644 --- a/variants/heltec_wifi_lora_32/pins_arduino.h +++ b/variants/heltec_wifi_lora_32/pins_arduino.h @@ -7,17 +7,8 @@ #define DISPLAY_HEIGHT 64 #define DISPLAY_WIDTH 128 -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 25; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/heltec_wifi_lora_32_V2/pins_arduino.h b/variants/heltec_wifi_lora_32_V2/pins_arduino.h index 420c23c3ffa..158fe9859d4 100644 --- a/variants/heltec_wifi_lora_32_V2/pins_arduino.h +++ b/variants/heltec_wifi_lora_32_V2/pins_arduino.h @@ -7,17 +7,8 @@ #define DISPLAY_HEIGHT 64 #define DISPLAY_WIDTH 128 -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 25; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/heltec_wifi_lora_32_V3/pins_arduino.h b/variants/heltec_wifi_lora_32_V3/pins_arduino.h index cbc50a0d117..4af96c90903 100644 --- a/variants/heltec_wifi_lora_32_V3/pins_arduino.h +++ b/variants/heltec_wifi_lora_32_V3/pins_arduino.h @@ -11,22 +11,8 @@ #define USB_VID 0x303a #define USB_PID 0x1001 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -// Some boards have too low voltage on this pin (board design bug) -// Use different pin with 3V and connect with 48 -// and change this setup for the chosen pin (for example 38) -static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48; +static const uint8_t LED_BUILTIN = 35; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN -#define RGB_BUILTIN LED_BUILTIN -#define RGB_BRIGHTNESS 64 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/heltec_wireless_stick/pins_arduino.h b/variants/heltec_wireless_stick/pins_arduino.h index a1c4eec28c8..9611e245b3b 100644 --- a/variants/heltec_wireless_stick/pins_arduino.h +++ b/variants/heltec_wireless_stick/pins_arduino.h @@ -7,17 +7,8 @@ #define DISPLAY_HEIGHT 32 #define DISPLAY_WIDTH 64 -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 25; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/heltec_wireless_stick_lite/pins_arduino.h b/variants/heltec_wireless_stick_lite/pins_arduino.h index 981c66b2b74..9ff45b7a8ae 100644 --- a/variants/heltec_wireless_stick_lite/pins_arduino.h +++ b/variants/heltec_wireless_stick_lite/pins_arduino.h @@ -7,17 +7,8 @@ #define DISPLAY_HEIGHT 0 #define DISPLAY_WIDTH 0 -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 25; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/heltec_wireless_stick_lite_v3/pins_arduino.h b/variants/heltec_wireless_stick_lite_v3/pins_arduino.h index 174b9e7f2d5..946b3f4197c 100644 --- a/variants/heltec_wireless_stick_lite_v3/pins_arduino.h +++ b/variants/heltec_wireless_stick_lite_v3/pins_arduino.h @@ -7,17 +7,8 @@ #define DISPLAY_HEIGHT 0 #define DISPLAY_WIDTH 0 -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 20 -#define NUM_ANALOG_INPUTS 15 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 35; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/honeylemon/pins_arduino.h b/variants/honeylemon/pins_arduino.h index 0156f5d3254..00be2ba530a 100644 --- a/variants/honeylemon/pins_arduino.h +++ b/variants/honeylemon/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 38 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t BUILTIN_KEY = 0; diff --git a/variants/hornbill32dev/pins_arduino.h b/variants/hornbill32dev/pins_arduino.h index 48adf9d75a8..13df63e1c29 100644 --- a/variants/hornbill32dev/pins_arduino.h +++ b/variants/hornbill32dev/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 13; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/hornbill32minima/pins_arduino.h b/variants/hornbill32minima/pins_arduino.h index c8d65c77a01..a8fb52c60f7 100644 --- a/variants/hornbill32minima/pins_arduino.h +++ b/variants/hornbill32minima/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t TX = 1; //taken out on pgm header static const uint8_t RX = 3; //taken out on pgm header diff --git a/variants/imbrios-logsens-v1p1/pins_arduino.h b/variants/imbrios-logsens-v1p1/pins_arduino.h index 3c3f083e034..3dd50c5f92b 100644 --- a/variants/imbrios-logsens-v1p1/pins_arduino.h +++ b/variants/imbrios-logsens-v1p1/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 9 -#define NUM_ANALOG_INPUTS 7 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - // Renaming few signals #define SPI_CLK SCK // IO14 #define SPI_MISO MISO // IO12 @@ -23,7 +15,6 @@ /* LED_BUILTIN is kept for compatibility reason; mapped to LED2 on the LogSens V1.1 Board */ static const uint8_t LED_BUILTIN = 33; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN /* UART0: Serial Port for Programming and Debugging on the LogSens V1.1 Board */ static const uint8_t TX = 1; diff --git a/variants/intorobot-fig/pins_arduino.h b/variants/intorobot-fig/pins_arduino.h index 50cb9c83ce4..deb292abcc3 100644 --- a/variants/intorobot-fig/pins_arduino.h +++ b/variants/intorobot-fig/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 7 -#define NUM_ANALOG_INPUTS 10 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 4; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t RGB_R_BUILTIN = 27; static const uint8_t RGB_G_BUILTIN = 21; diff --git a/variants/lilygo_t_display/pins_arduino.h.txt b/variants/lilygo_t_display/pins_arduino.h similarity index 83% rename from variants/lilygo_t_display/pins_arduino.h.txt rename to variants/lilygo_t_display/pins_arduino.h index e911f09b86c..beae4b311c6 100644 --- a/variants/lilygo_t_display/pins_arduino.h.txt +++ b/variants/lilygo_t_display/pins_arduino.h @@ -9,14 +9,6 @@ #define USB_PRODUCT "T-Display" #define USB_SERIAL "" -#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; diff --git a/variants/lilygo_t_display_s3/pins_arduino.h b/variants/lilygo_t_display_s3/pins_arduino.h index 099bdad5876..bdad2730aff 100644 --- a/variants/lilygo_t_display_s3/pins_arduino.h +++ b/variants/lilygo_t_display_s3/pins_arduino.h @@ -7,14 +7,6 @@ #define USB_VID 0x303a #define USB_PID 0x1001 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t BUTTON_1 = 0; static const uint8_t BUTTON_2 = 14; static const uint8_t BAT_VOLT = 4; diff --git a/variants/lionbit/pins_arduino.h b/variants/lionbit/pins_arduino.h index b7f5825079a..2196ddcdca5 100644 --- a/variants/lionbit/pins_arduino.h +++ b/variants/lionbit/pins_arduino.h @@ -3,15 +3,9 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1) -#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 0; // GPIO0, ADC2_CH1, TOUCH1, RTC_GPIO11, CLK_OUT1,EMAC_TX_CLK +#define BUILTIN_LED LED_BUILTIN // backward compatibility + static const uint8_t SWITCH_A = 2; // GPIO2, ADC2_CH2, TOUCH2, RTC_GPIO12, HSPIWP, HS2_DATA0,SD_DATA0 static const uint8_t SWITCH_B = 4; // GPIO4, ADC2_CH0, TOUCH0, RTC_GPIO10, HSPIHD, HS2_DATA1,SD_DATA1, EMAC_TX_ER diff --git a/variants/lionbits3/pins_arduino.h b/variants/lionbits3/pins_arduino.h index 1428b1507c5..5f9e82f054a 100644 --- a/variants/lionbits3/pins_arduino.h +++ b/variants/lionbits3/pins_arduino.h @@ -3,15 +3,9 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1) -#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 0; //GPIO0, +#define BUILTIN_LED LED_BUILTIN // backward compatibility + static const uint8_t SWITCH_A = 46; //GPIO46, static const uint8_t SWITCH_B = 47; //GPIO47, //Wifi and Bluetooth LEDs diff --git a/variants/lolin32-lite/pins_arduino.h b/variants/lolin32-lite/pins_arduino.h index 883695dfcf1..b8b5c56b97c 100755 --- a/variants/lolin32-lite/pins_arduino.h +++ b/variants/lolin32-lite/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/lolin32/pins_arduino.h b/variants/lolin32/pins_arduino.h index f38be67cc58..20c407e79ad 100644 --- a/variants/lolin32/pins_arduino.h +++ b/variants/lolin32/pins_arduino.h @@ -3,19 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 5; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN - - static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/lolin_c3_mini/pins_arduino.h b/variants/lolin_c3_mini/pins_arduino.h index 59889448572..a0aca8cbcbe 100644 --- a/variants/lolin_c3_mini/pins_arduino.h +++ b/variants/lolin_c3_mini/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 22 -#define NUM_DIGITAL_PINS 22 -#define NUM_ANALOG_INPUTS 6 - -#define analogInputToDigitalPin(p) (((p) - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 18 - -#define analogInputToDigitalPin(p) (((p)<40)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) +#include "soc/soc_caps.h" // SPI LoRa Radio #define LORA_SCK 5 // GPIO5 - SX1276 SCK @@ -22,9 +15,13 @@ #define LORA_IO1 LORA_IRQ // tied by diode to IO0 #define LORA_IO2 LORA_IRQ // tied by diode to IO0 -static const uint8_t LED_BUILTIN = 0; // ->2812 RGB !!! +// Neopixel +#define PIN_NEOPIXEL 0 // ->2812 RGB !!! +static const uint8_t LED_BUILTIN = PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT) +#define RGB_BRIGHTNESS 64 #define ANT_SELECT 16 // GPIO16 - External Antenna Switch diff --git a/variants/lopy4/pins_arduino.h b/variants/lopy4/pins_arduino.h index 723d3fa8c3c..642a3e41c39 100644 --- a/variants/lopy4/pins_arduino.h +++ b/variants/lopy4/pins_arduino.h @@ -2,14 +2,7 @@ #define Pins_Arduino_h #include - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 18 - -#define analogInputToDigitalPin(p) (((p)<40)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) +#include "soc/soc_caps.h" // SPI LoRa Radio #define LORA_SCK 5 // GPIO5 - SX1276 SCK @@ -22,9 +15,13 @@ #define LORA_IO2 LORA_IRQ // tied by diode to IO0 #define LORA_RST NOT_A_PIN -static const uint8_t LED_BUILTIN = 0; // ->2812 RGB !!! +// Neopixel +#define PIN_NEOPIXEL 0 // ->2812 RGB !!! +static const uint8_t LED_BUILTIN = PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT) +#define RGB_BRIGHTNESS 64 #define ANT_SELECT 21 // GPIO21 - External Antenna Switch diff --git a/variants/m5stack_atom/pins_arduino.h b/variants/m5stack_atom/pins_arduino.h index 645436bd7da..00f3d130743 100644 --- a/variants/m5stack_atom/pins_arduino.h +++ b/variants/m5stack_atom/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/m5stack_atoms3/pins_arduino.h b/variants/m5stack_atoms3/pins_arduino.h index 8af4ef2e53d..1c6ead7ff14 100644 --- a/variants/m5stack_atoms3/pins_arduino.h +++ b/variants/m5stack_atoms3/pins_arduino.h @@ -7,24 +7,11 @@ #define USB_VID 0x303a #define USB_PID 0x1001 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -// Some boards have too low voltage on this pin (board design bug) -// Use different pin with 3V and connect with 48 -// and change this setup for the chosen pin (for example 38) -static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + 48; +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + 35; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 -#define analogInputToDigitalPin(p) \ - (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1) -#define digitalPinToInterrupt(p) (((p) < 48) ? (p) : -1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/m5stack_core2/pins_arduino.h b/variants/m5stack_core2/pins_arduino.h index 895c7c0de2a..c5ea5d78eee 100644 --- a/variants/m5stack_core2/pins_arduino.h +++ b/variants/m5stack_core2/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - #define TX2 14 #define RX2 13 diff --git a/variants/m5stack_core_esp32/pins_arduino.h b/variants/m5stack_core_esp32/pins_arduino.h index 8b86a0d6fdc..1984ab6bc6e 100644 --- a/variants/m5stack_core_esp32/pins_arduino.h +++ b/variants/m5stack_core_esp32/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 20 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/m5stack_coreink/pins_arduino.h b/variants/m5stack_coreink/pins_arduino.h index 4ce9b122880..84c0903c166 100644 --- a/variants/m5stack_coreink/pins_arduino.h +++ b/variants/m5stack_coreink/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - #define TX2 14 #define RX2 13 diff --git a/variants/m5stack_cores3/pins_arduino.h b/variants/m5stack_cores3/pins_arduino.h index c8c979abe69..e5dc7caf628 100644 --- a/variants/m5stack_cores3/pins_arduino.h +++ b/variants/m5stack_cores3/pins_arduino.h @@ -7,24 +7,14 @@ #define USB_VID 0x303a #define USB_PID 0x1001 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - // Some boards have too low voltage on this pin (board design bug) // Use different pin with 3V and connect with 48 // and change this setup for the chosen pin (for example 38) static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + 48; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 -#define analogInputToDigitalPin(p) \ - (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1) -#define digitalPinToInterrupt(p) (((p) < 48) ? (p) : -1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/m5stack_fire/pins_arduino.h b/variants/m5stack_fire/pins_arduino.h index 8b86a0d6fdc..1984ab6bc6e 100644 --- a/variants/m5stack_fire/pins_arduino.h +++ b/variants/m5stack_fire/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 20 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/m5stack_stamp_pico/pins_arduino.h b/variants/m5stack_stamp_pico/pins_arduino.h index d784362da76..705890facea 100644 --- a/variants/m5stack_stamp_pico/pins_arduino.h +++ b/variants/m5stack_stamp_pico/pins_arduino.h @@ -3,15 +3,6 @@ #include -#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; diff --git a/variants/m5stack_stamp_s3/pins_arduino.h b/variants/m5stack_stamp_s3/pins_arduino.h index 510a459b11d..aff8d808d86 100644 --- a/variants/m5stack_stamp_s3/pins_arduino.h +++ b/variants/m5stack_stamp_s3/pins_arduino.h @@ -7,15 +7,6 @@ #define USB_VID 0x303a #define USB_PID 0x1001 -#define EXTERNAL_NUM_INTERRUPTS 23 -#define NUM_DIGITAL_PINS 46 -#define NUM_ANALOG_INPUTS 15 - -#define analogInputToDigitalPin(p) \ - (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1) -#define digitalPinToInterrupt(p) (((p) < 48) ? (p) : -1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/m5stack_station/pins_arduino.h b/variants/m5stack_station/pins_arduino.h index 9ba182b90b5..3a5812e3262 100644 --- a/variants/m5stack_station/pins_arduino.h +++ b/variants/m5stack_station/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 20 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/m5stack_timer_cam/pins_arduino.h b/variants/m5stack_timer_cam/pins_arduino.h index 1f7f4b46aae..5a2cc5dcdb4 100644 --- a/variants/m5stack_timer_cam/pins_arduino.h +++ b/variants/m5stack_timer_cam/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility diff --git a/variants/m5stick_c/pins_arduino.h b/variants/m5stick_c/pins_arduino.h index e4d73f6a2e3..35092416486 100644 --- a/variants/m5stick_c/pins_arduino.h +++ b/variants/m5stick_c/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/magicbit/pins_arduino.h b/variants/magicbit/pins_arduino.h index 6bf769942a7..e00419279c7 100644 --- a/variants/magicbit/pins_arduino.h +++ b/variants/magicbit/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; @@ -66,6 +58,8 @@ static const uint8_t MOTOR1A = 27; static const uint8_t MOTOR1B = 18; static const uint8_t MOTOR2A = 16; static const uint8_t MOTOR2B = 17; + static const uint8_t LED_BUILTIN=16; +#define BUILTIN_LED LED_BUILTIN // backward compatibility #endif /* Pins_Arduino_h */ diff --git a/variants/metro_esp-32/pins_arduino.h b/variants/metro_esp-32/pins_arduino.h index 6675823c50e..1d81e564c9f 100644 --- a/variants/metro_esp-32/pins_arduino.h +++ b/variants/metro_esp-32/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/mgbot-iotik32a/pins_arduino.h b/variants/mgbot-iotik32a/pins_arduino.h index 283e01b2b9b..f9234f83575 100644 --- a/variants/mgbot-iotik32a/pins_arduino.h +++ b/variants/mgbot-iotik32a/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 4; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/mgbot-iotik32b/pins_arduino.h b/variants/mgbot-iotik32b/pins_arduino.h index 04dfe30c52f..e55119e7c0e 100644 --- a/variants/mgbot-iotik32b/pins_arduino.h +++ b/variants/mgbot-iotik32b/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 18; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN // IR receiver static const uint8_t IR = 27; diff --git a/variants/mhetesp32devkit/pins_arduino.h b/variants/mhetesp32devkit/pins_arduino.h index badd89bf58c..6211eafb9bf 100644 --- a/variants/mhetesp32devkit/pins_arduino.h +++ b/variants/mhetesp32devkit/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/mhetesp32minikit/pins_arduino.h b/variants/mhetesp32minikit/pins_arduino.h index badd89bf58c..6211eafb9bf 100644 --- a/variants/mhetesp32minikit/pins_arduino.h +++ b/variants/mhetesp32minikit/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/micro_s2/pins_arduino.h b/variants/micro_s2/pins_arduino.h index 389e51d9772..e3a25a43269 100644 --- a/variants/micro_s2/pins_arduino.h +++ b/variants/micro_s2/pins_arduino.h @@ -9,14 +9,6 @@ #define USB_PRODUCT "microS2" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; @@ -71,7 +63,12 @@ static const uint8_t DAC2 = 18; static const uint8_t LED_BUILTIN = 21; #define BUILTIN_LED LED_BUILTIN // backward compatibility + static const uint8_t PIXEL_BUILTIN = 33; +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN (PIXEL_BUILTIN + SOC_GPIO_PIN_COUNT) +#define RGB_BRIGHTNESS 64 + static const uint8_t BUTTON_BUILTIN = 0; #endif /* Pins_Arduino_h */ diff --git a/variants/mpython/pins_arduino.h b/variants/mpython/pins_arduino.h index 301700d6355..5f17b4ad1e3 100644 --- a/variants/mpython/pins_arduino.h +++ b/variants/mpython/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/namino_arancio/pins_arduino.h b/variants/namino_arancio/pins_arduino.h index 6f1972a4b5b..7cf807c014b 100644 --- a/variants/namino_arancio/pins_arduino.h +++ b/variants/namino_arancio/pins_arduino.h @@ -6,20 +6,12 @@ #define Pins_Arduino_h #include -#include "soc/soc_caps.h" #define USB_VID 0x303a #define USB_PID 0x1001 #define NAMINO_ARANCIO_BOARD -#define NUM_DIGITAL_PINS SOC_GPIO_PIN_COUNT // GPIO 0..48 -#define NUM_ANALOG_INPUTS 20 // GPIO 1..20 -#define EXTERNAL_NUM_INTERRUPTS NUM_DIGITAL_PINS // All GPIOs -#define analogInputToDigitalPin(p) (((p) -#include "soc/soc_caps.h" #define USB_VID 0x303a #define USB_PID 0x1001 #define NAMINO_ROSSO_BOARD -#define NUM_DIGITAL_PINS SOC_GPIO_PIN_COUNT // GPIO 0..48 -#define NUM_ANALOG_INPUTS 20 // GPIO 1..20 -#define EXTERNAL_NUM_INTERRUPTS NUM_DIGITAL_PINS // All GPIOs -#define analogInputToDigitalPin(p) (((p) -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 38 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 16; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t BUILTIN_KEY = 0; diff --git a/variants/nina_w10/pins_arduino.h b/variants/nina_w10/pins_arduino.h index 00bd44c05b9..660424de2b6 100644 --- a/variants/nina_w10/pins_arduino.h +++ b/variants/nina_w10/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_GREEN = 33; static const uint8_t LED_RED = 23; static const uint8_t LED_BLUE = 21; diff --git a/variants/node32s/pins_arduino.h b/variants/node32s/pins_arduino.h index b37eaed659c..341135c1957 100644 --- a/variants/node32s/pins_arduino.h +++ b/variants/node32s/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/nodemcu-32s/pins_arduino.h b/variants/nodemcu-32s/pins_arduino.h index b37eaed659c..341135c1957 100644 --- a/variants/nodemcu-32s/pins_arduino.h +++ b/variants/nodemcu-32s/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/nora_w10/pins_arduino.h b/variants/nora_w10/pins_arduino.h index ccf4556dcfc..ee473f5856f 100644 --- a/variants/nora_w10/pins_arduino.h +++ b/variants/nora_w10/pins_arduino.h @@ -2,19 +2,10 @@ #define Pins_Arduino_h #include -#include "soc/soc_caps.h" #define USB_VID 0x303a #define USB_PID 0x1001 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - // The pin assignments in this file are based on u-blox EVK-NORA-W1, a Arduino compatible board. // For your own module design you can freely chose the pins available on the module module pins diff --git a/variants/odroid_esp32/pins_arduino.h b/variants/odroid_esp32/pins_arduino.h index 01a863ab236..06ddaa05ec0 100644 --- a/variants/odroid_esp32/pins_arduino.h +++ b/variants/odroid_esp32/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/onehorse32dev/pins_arduino.h b/variants/onehorse32dev/pins_arduino.h index e57615e3272..ab1984b64e8 100644 --- a/variants/onehorse32dev/pins_arduino.h +++ b/variants/onehorse32dev/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 5; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/openkb/pins_arduino.h b/variants/openkb/pins_arduino.h index 4928bd49539..5e98341e56e 100644 --- a/variants/openkb/pins_arduino.h +++ b/variants/openkb/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 38 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 16; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/oroca_edubot/pins_arduino.h b/variants/oroca_edubot/pins_arduino.h index 1cfa1fb86fb..878777b82f7 100644 --- a/variants/oroca_edubot/pins_arduino.h +++ b/variants/oroca_edubot/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 13; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 17; static const uint8_t RX = 16; diff --git a/variants/pico32/pins_arduino.h b/variants/pico32/pins_arduino.h index 4ad96ccef51..27ecc063483 100644 --- a/variants/pico32/pins_arduino.h +++ b/variants/pico32/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/piranha_esp-32/pins_arduino.h b/variants/piranha_esp-32/pins_arduino.h index 4de761d9aa5..25888c69160 100644 --- a/variants/piranha_esp-32/pins_arduino.h +++ b/variants/piranha_esp-32/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/pocket_32/pins_arduino.h b/variants/pocket_32/pins_arduino.h index af926f45982..00046a558d4 100644 --- a/variants/pocket_32/pins_arduino.h +++ b/variants/pocket_32/pins_arduino.h @@ -3,19 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 16; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN - - static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/quantum/pins_arduino.h b/variants/quantum/pins_arduino.h index 4ad96ccef51..27ecc063483 100644 --- a/variants/quantum/pins_arduino.h +++ b/variants/quantum/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/redpill_esp32s3/pins_arduino.h b/variants/redpill_esp32s3/pins_arduino.h index 0b58bd2415e..1eac28e8b9b 100644 --- a/variants/redpill_esp32s3/pins_arduino.h +++ b/variants/redpill_esp32s3/pins_arduino.h @@ -6,17 +6,8 @@ #define USB_VID 0x303A #define USB_PID 0x1001 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t LED_BUILTIN = 3; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 diff --git a/variants/roboheart_hercules/pins_arduino.h b/variants/roboheart_hercules/pins_arduino.h index 17a5951773e..fc98590040f 100644 --- a/variants/roboheart_hercules/pins_arduino.h +++ b/variants/roboheart_hercules/pins_arduino.h @@ -3,15 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 20 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - - // Motor driver pins #define MOTOR_A_IN1 25 // PHASE/IN1 #define MOTOR_A_IN2 26 // ENABLE/IN2 diff --git a/variants/sonoff_dualr3/pins_arduino.h b/variants/sonoff_dualr3/pins_arduino.h index 1b3fae2d8bb..e7d6c6c1555 100644 --- a/variants/sonoff_dualr3/pins_arduino.h +++ b/variants/sonoff_dualr3/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/sparkfun_esp32_iot_redboard/pins_arduino.h b/variants/sparkfun_esp32_iot_redboard/pins_arduino.h index b644d7baf95..4eedb6bd552 100644 --- a/variants/sparkfun_esp32_iot_redboard/pins_arduino.h +++ b/variants/sparkfun_esp32_iot_redboard/pins_arduino.h @@ -4,20 +4,11 @@ #include #include "soc/soc_caps.h" -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 18; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN -static const uint8_t RGB_BUILTIN = SOC_GPIO_PIN_COUNT+2; -#define RGB_BUILTIN RGB_BUILTIN +#define NEO_PIXEL 2 //WS2812 LED +static const uint8_t RGB_BUILTIN = (SOC_GPIO_PIN_COUNT+NEO_PIXEL); #define RGB_BRIGHTNESS 64 static const uint8_t TX = 1; diff --git a/variants/sparkfun_lora_gateway_1-channel/pins_arduino.h b/variants/sparkfun_lora_gateway_1-channel/pins_arduino.h index 5d0b845764d..559db4b9112 100755 --- a/variants/sparkfun_lora_gateway_1-channel/pins_arduino.h +++ b/variants/sparkfun_lora_gateway_1-channel/pins_arduino.h @@ -3,15 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const int LED_BUILTIN = 17; +#define BUILTIN_LED LED_BUILTIN // backward compatibility static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/tamc_termod_s3/pins_arduino.h b/variants/tamc_termod_s3/pins_arduino.h index ca86f85469f..4db71009c76 100644 --- a/variants/tamc_termod_s3/pins_arduino.h +++ b/variants/tamc_termod_s3/pins_arduino.h @@ -7,23 +7,14 @@ #define USB_VID 0x303a #define USB_PID 0x1001 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - // Some boards have too low voltage on this pin (board design bug) // Use different pin with 3V and connect with 48 // and change this setup for the chosen pin (for example 38) static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/tbeam/pins_arduino.h b/variants/tbeam/pins_arduino.h index fdec62d96d3..c12fe5f7f45 100644 --- a/variants/tbeam/pins_arduino.h +++ b/variants/tbeam/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 20 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - // SPI LoRa Radio #define LORA_SCK 5 // GPIO5 - SX1276 SCK #define LORA_MISO 19 // GPIO19 - SX1276 MISO @@ -26,7 +18,6 @@ static const uint8_t KEY_BUILTIN = 39; static const uint8_t LED_BUILTIN = 14; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/ttgo-lora32-v1/pins_arduino.h b/variants/ttgo-lora32-v1/pins_arduino.h index 0faf524e233..1ed027e17bf 100644 --- a/variants/ttgo-lora32-v1/pins_arduino.h +++ b/variants/ttgo-lora32-v1/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - // I2C OLED Display works with SSD1306 driver #define OLED_SDA 4 #define OLED_SCL 15 @@ -26,7 +18,6 @@ static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/ttgo-lora32-v2/pins_arduino.h b/variants/ttgo-lora32-v2/pins_arduino.h index 5cf49fdd4b7..37b1d031c89 100644 --- a/variants/ttgo-lora32-v2/pins_arduino.h +++ b/variants/ttgo-lora32-v2/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - // I2C OLED Display works with SSD1306 driver #define OLED_SDA 21 #define OLED_SCL 22 @@ -32,7 +24,6 @@ static const uint8_t LED_BUILTIN = 22; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/ttgo-lora32-v21new/pins_arduino.h b/variants/ttgo-lora32-v21new/pins_arduino.h index cb4f917b8fc..0b16f0844ae 100644 --- a/variants/ttgo-lora32-v21new/pins_arduino.h +++ b/variants/ttgo-lora32-v21new/pins_arduino.h @@ -9,14 +9,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - // I2C OLED Display works with SSD1306 driver #define OLED_SDA 21 #define OLED_SCL 22 @@ -38,9 +30,8 @@ #define SD_MOSI 15 #define SD_CS 13 -static const uint8_t LED_BUILTIN = 25 ; +static const uint8_t LED_BUILTIN = 25; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/ttgo-t-oi-plus/pins_arduino.h b/variants/ttgo-t-oi-plus/pins_arduino.h index 16cac90bdaf..cc6aaf09798 100644 --- a/variants/ttgo-t-oi-plus/pins_arduino.h +++ b/variants/ttgo-t-oi-plus/pins_arduino.h @@ -3,15 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 12 -#define NUM_DIGITAL_PINS 12 -#define NUM_ANALOG_INPUTS 3 - -#define analogInputToDigitalPin(p) (((p) -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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 LED_BUILTIN = 22; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t SDA = 21; // Despite the many diagrams from TTGO showing SCL on pin 22, due to the on-board LED diff --git a/variants/ttgo-t7-v13-mini32/pins_arduino.h b/variants/ttgo-t7-v13-mini32/pins_arduino.h index 75057d726d5..553cffecd10 100755 --- a/variants/ttgo-t7-v13-mini32/pins_arduino.h +++ b/variants/ttgo-t7-v13-mini32/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/ttgo-t7-v14-mini32/pins_arduino.h b/variants/ttgo-t7-v14-mini32/pins_arduino.h index b0ca79e64e4..bac1acd28db 100755 --- a/variants/ttgo-t7-v14-mini32/pins_arduino.h +++ b/variants/ttgo-t7-v14-mini32/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/turta_iot_node/pins_arduino.h b/variants/turta_iot_node/pins_arduino.h index f156ee2fb70..3611535e03c 100644 --- a/variants/turta_iot_node/pins_arduino.h +++ b/variants/turta_iot_node/pins_arduino.h @@ -3,18 +3,9 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 20 -#define NUM_DIGITAL_PINS 21 -#define NUM_ANALOG_INPUTS 9 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - // LED static const uint8_t LED_BUILTIN = 13; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN // UART static const uint8_t TX = 10; diff --git a/variants/twatch/pins_arduino.h b/variants/twatch/pins_arduino.h index b46288c7e76..e10a0d6a8e1 100644 --- a/variants/twatch/pins_arduino.h +++ b/variants/twatch/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 20 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - // touch screen #define TP_SDA 23 #define TP_SCL 32 diff --git a/variants/uPesy_esp32_wroom_devkit/pins_arduino.h b/variants/uPesy_esp32_wroom_devkit/pins_arduino.h index 69e4138428f..fd642f2aaaa 100644 --- a/variants/uPesy_esp32_wroom_devkit/pins_arduino.h +++ b/variants/uPesy_esp32_wroom_devkit/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/uPesy_esp32_wrover_devkit/pins_arduino.h b/variants/uPesy_esp32_wrover_devkit/pins_arduino.h index 69e4138428f..fd642f2aaaa 100644 --- a/variants/uPesy_esp32_wrover_devkit/pins_arduino.h +++ b/variants/uPesy_esp32_wrover_devkit/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/um_feathers2/pins_arduino.h b/variants/um_feathers2/pins_arduino.h index 26ff851d66f..edcde26ac71 100644 --- a/variants/um_feathers2/pins_arduino.h +++ b/variants/um_feathers2/pins_arduino.h @@ -9,14 +9,6 @@ #define USB_PRODUCT "FeatherS2" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; diff --git a/variants/um_feathers2neo/pins_arduino.h b/variants/um_feathers2neo/pins_arduino.h index 44609d463ab..02e285a2d57 100644 --- a/variants/um_feathers2neo/pins_arduino.h +++ b/variants/um_feathers2neo/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x239A #define USB_PID 0x80B4 @@ -9,14 +10,6 @@ #define USB_PRODUCT "FeatherS2 Neo" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 22 -#define NUM_ANALOG_INPUTS 11 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; @@ -59,6 +52,13 @@ static const uint8_t DAC1 = 17; static const uint8_t DAC2 = 18; static const uint8_t NEOPIXEL_MATRIX_DATA = 21; +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN (NEOPIXEL_DATA + SOC_GPIO_PIN_COUNT) +#define RGB_BRIGHTNESS 64 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = RGB_BUILTIN; +#define BUILTIN_LED LED_BUILTIN // backward compatibility + static const uint8_t NEOPIXEL_MATRIX_PWR = 4; static const uint8_t NEOPIXEL_DATA = 40; diff --git a/variants/um_feathers3/pins_arduino.h b/variants/um_feathers3/pins_arduino.h index 9b60548d08f..a06825c8584 100644 --- a/variants/um_feathers3/pins_arduino.h +++ b/variants/um_feathers3/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x303A #define USB_PID 0x80D6 @@ -9,14 +10,6 @@ #define USB_PRODUCT "FeatherS3" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 21 -#define NUM_ANALOG_INPUTS 13 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; @@ -60,6 +53,13 @@ static const uint8_t VBAT_SENSE = 2; static const uint8_t VBUS_SENSE = 34; static const uint8_t RGB_DATA = 40; +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT) +#define RGB_BRIGHTNESS 64 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = RGB_BUILTIN; +#define BUILTIN_LED LED_BUILTIN // backward compatibility + static const uint8_t RGB_PWR = 39; static const uint8_t LDO2 = 39; static const uint8_t LED_BUILTIN = 13; diff --git a/variants/um_nanos3/pins_arduino.h b/variants/um_nanos3/pins_arduino.h index d80a40b8517..36539234118 100644 --- a/variants/um_nanos3/pins_arduino.h +++ b/variants/um_nanos3/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x303A #define USB_PID 0x8179 @@ -9,14 +10,6 @@ #define USB_PRODUCT "Nanos3" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 17 -#define NUM_ANALOG_INPUTS 9 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; @@ -51,6 +44,13 @@ static const uint8_t T8 = 8; static const uint8_t T9 = 9; static const uint8_t RGB_DATA = 41; +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT) +#define RGB_BRIGHTNESS 64 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = RGB_BUILTIN; +#define BUILTIN_LED LED_BUILTIN // backward compatibility + static const uint8_t RGB_PWR = 42; #endif /* Pins_Arduino_h */ diff --git a/variants/um_pros3/pins_arduino.h b/variants/um_pros3/pins_arduino.h index d46a772d0cb..749fa3c8309 100644 --- a/variants/um_pros3/pins_arduino.h +++ b/variants/um_pros3/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x303A #define USB_PID 0x80D3 @@ -9,14 +10,6 @@ #define USB_PRODUCT "ProS3" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 27 -#define NUM_ANALOG_INPUTS 14 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; @@ -62,6 +55,13 @@ static const uint8_t VBAT_SENSE = 10; static const uint8_t VBUS_SENSE = 33; static const uint8_t RGB_DATA = 18; +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT) +#define RGB_BRIGHTNESS 64 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = RGB_BUILTIN; +#define BUILTIN_LED LED_BUILTIN // backward compatibility + static const uint8_t RGB_PWR = 17; static const uint8_t LDO2 = 17; diff --git a/variants/um_rmp/pins_arduino.h b/variants/um_rmp/pins_arduino.h index bf79ad86176..a7bf599403d 100644 --- a/variants/um_rmp/pins_arduino.h +++ b/variants/um_rmp/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x303A #define USB_PID 0x8001 @@ -9,14 +10,6 @@ #define USB_PRODUCT "RM Pro" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; @@ -73,6 +66,13 @@ static const uint8_t VBAT_SENSE = 3; static const uint8_t VBUS_SENSE = 21; static const uint8_t RGB_DATA = 1; +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT) +#define RGB_BRIGHTNESS 64 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = RGB_BUILTIN; +#define BUILTIN_LED LED_BUILTIN // backward compatibility + static const uint8_t RGB_PWR = 2; #endif /* Pins_Arduino_h */ diff --git a/variants/um_tinypico/pins_arduino.h b/variants/um_tinypico/pins_arduino.h index 134a5ce88d4..b10b9274178 100644 --- a/variants/um_tinypico/pins_arduino.h +++ b/variants/um_tinypico/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/um_tinys2/pins_arduino.h b/variants/um_tinys2/pins_arduino.h index a493a3fd78b..3deae45c04c 100644 --- a/variants/um_tinys2/pins_arduino.h +++ b/variants/um_tinys2/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x303A #define USB_PID 0x8001 @@ -9,14 +10,6 @@ #define USB_PRODUCT "TinyS2" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; @@ -73,6 +66,13 @@ static const uint8_t VBAT_SENSE = 3; static const uint8_t VBUS_SENSE = 21; static const uint8_t RGB_DATA = 1; +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT) +#define RGB_BRIGHTNESS 64 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = RGB_BUILTIN; +#define BUILTIN_LED LED_BUILTIN // backward compatibility + static const uint8_t RGB_PWR = 2; #endif /* Pins_Arduino_h */ diff --git a/variants/um_tinys3/pins_arduino.h b/variants/um_tinys3/pins_arduino.h index ca2b4ba4873..374956965c8 100644 --- a/variants/um_tinys3/pins_arduino.h +++ b/variants/um_tinys3/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x303A #define USB_PID 0x80D0 @@ -9,14 +10,6 @@ #define USB_PRODUCT "TinyS3" #define USB_SERIAL "" -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 17 -#define NUM_ANALOG_INPUTS 9 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 43; static const uint8_t RX = 44; @@ -54,6 +47,13 @@ static const uint8_t VBAT_SENSE = 10; static const uint8_t VBUS_SENSE = 33; static const uint8_t RGB_DATA = 18; +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT) +#define RGB_BRIGHTNESS 64 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = RGB_BUILTIN; +#define BUILTIN_LED LED_BUILTIN // backward compatibility + static const uint8_t RGB_PWR = 17; #endif /* Pins_Arduino_h */ diff --git a/variants/unphone8/pins_arduino.h b/variants/unphone8/pins_arduino.h index f6270e7224b..66e30bdd564 100644 --- a/variants/unphone8/pins_arduino.h +++ b/variants/unphone8/pins_arduino.h @@ -6,14 +6,6 @@ #define USB_VID 0x16D0 #define USB_PID 0x1178 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - #define LED_BUILTIN 13 #define BUILTIN_LED LED_BUILTIN // backward compatibility diff --git a/variants/unphone9/pins_arduino.h b/variants/unphone9/pins_arduino.h index d16ec924358..e20cd337b7f 100644 --- a/variants/unphone9/pins_arduino.h +++ b/variants/unphone9/pins_arduino.h @@ -6,14 +6,6 @@ #define USB_VID 0x16D0 #define USB_PID 0x1178 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - #define LED_BUILTIN 13 #define BUILTIN_LED LED_BUILTIN // backward compatibility diff --git a/variants/vintlabsdevkitv1/pins_arduino.h b/variants/vintlabsdevkitv1/pins_arduino.h index 6f0df757180..7e27761e252 100644 --- a/variants/vintlabsdevkitv1/pins_arduino.h +++ b/variants/vintlabsdevkitv1/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/watchy/pins_arduino.h b/variants/watchy/pins_arduino.h index 2c93c173429..b5bc02f374c 100644 --- a/variants/watchy/pins_arduino.h +++ b/variants/watchy/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(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; diff --git a/variants/wesp32/pins_arduino.h b/variants/wesp32/pins_arduino.h index 7dbfa439e06..670c75fff93 100644 --- a/variants/wesp32/pins_arduino.h +++ b/variants/wesp32/pins_arduino.h @@ -3,14 +3,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - #define TX1 12 #define RX1 13 #define TX2 33 diff --git a/variants/widora-air/pins_arduino.h b/variants/widora-air/pins_arduino.h index 4cb0fa4da0d..6d9906cac54 100644 --- a/variants/widora-air/pins_arduino.h +++ b/variants/widora-air/pins_arduino.h @@ -3,18 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 7 -#define NUM_ANALOG_INPUTS 10 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 25; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN - static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/wifiduino32/pins_arduino.h b/variants/wifiduino32/pins_arduino.h index 841721d6d8d..93822072f2b 100644 --- a/variants/wifiduino32/pins_arduino.h +++ b/variants/wifiduino32/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/wifiduino32s3/pins_arduino.h b/variants/wifiduino32s3/pins_arduino.h index 9115256472b..6a887f9cad3 100644 --- a/variants/wifiduino32s3/pins_arduino.h +++ b/variants/wifiduino32s3/pins_arduino.h @@ -7,23 +7,14 @@ #define USB_VID 0x303a #define USB_PID 0x1001 -#define EXTERNAL_NUM_INTERRUPTS 46 -#define NUM_DIGITAL_PINS 48 -#define NUM_ANALOG_INPUTS 20 - // Some boards have too low voltage on this pin (board design bug) // Use different pin with 3V and connect with 48 // and change this setup for the chosen pin (for example 38) static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN #define BOARD_HAS_NEOPIXEL #define LED_BRIGHTNESS 64 -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) -#define digitalPinHasPWM(p) (p < 46) - static const uint8_t TX = 45; static const uint8_t RX = 44; diff --git a/variants/wifiduinov2/pins_arduino.h b/variants/wifiduinov2/pins_arduino.h index 4eb83a7c3ae..e07c8b459e8 100644 --- a/variants/wifiduinov2/pins_arduino.h +++ b/variants/wifiduinov2/pins_arduino.h @@ -4,20 +4,11 @@ #include #include "soc/soc_caps.h" -#define EXTERNAL_NUM_INTERRUPTS 22 -#define NUM_DIGITAL_PINS 22 -#define NUM_ANALOG_INPUTS 6 - static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+13; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN #define BOARD_HAS_NEOPIXEL #define LED_BRIGHTNESS 64 -#define analogInputToDigitalPin(p) (((p) +#include "soc/soc_caps.h" -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 18 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - -static const uint8_t LED_BUILTIN = 0; // ->2812 RGB !!! +// Neopixel +#define PIN_NEOPIXEL 0 // ->2812 RGB !!! +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() +#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT) +#define RGB_BRIGHTNESS 64 #define ANT_SELECT 21 // GPIO21 - External Antenna Switch diff --git a/variants/wt32-eth01/pins_arduino.h b/variants/wt32-eth01/pins_arduino.h index 6cb2a6a5d7a..49cc740efb3 100644 --- a/variants/wt32-eth01/pins_arduino.h +++ b/variants/wt32-eth01/pins_arduino.h @@ -9,14 +9,6 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1) -#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1) -#define digitalPinHasPWM(p) (p < 34) - // interface to Ethernet PHY (LAN8720A) #define ETH_PHY_ADDR 1 #define ETH_PHY_POWER 16 diff --git a/variants/xinabox/pins_arduino.h b/variants/xinabox/pins_arduino.h index 52b3e4f12d8..4f784ef234a 100644 --- a/variants/xinabox/pins_arduino.h +++ b/variants/xinabox/pins_arduino.h @@ -3,17 +3,8 @@ #include -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 40 -#define NUM_ANALOG_INPUTS 16 - -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) -#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) -#define digitalPinHasPWM(p) (p < 34) - static const uint8_t LED_BUILTIN = 27; #define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; From 8b4b5463afb130b7e2cdb9e6b15c9350273ee31e Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Wed, 4 Oct 2023 22:47:43 -0300 Subject: [PATCH 2/3] Git Action Fixes --- variants/adafruit_qtpy_esp32/pins_arduino.h | 2 ++ variants/um_feathers2neo/pins_arduino.h | 6 +++--- variants/um_feathers3/pins_arduino.h | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/variants/adafruit_qtpy_esp32/pins_arduino.h b/variants/adafruit_qtpy_esp32/pins_arduino.h index f87fe4dd8fe..38f3af064d2 100644 --- a/variants/adafruit_qtpy_esp32/pins_arduino.h +++ b/variants/adafruit_qtpy_esp32/pins_arduino.h @@ -4,6 +4,8 @@ #include #include "soc/soc_caps.h" +// Neopixel +#define PIN_NEOPIXEL 5 // BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility diff --git a/variants/um_feathers2neo/pins_arduino.h b/variants/um_feathers2neo/pins_arduino.h index 02e285a2d57..70420af3a0e 100644 --- a/variants/um_feathers2neo/pins_arduino.h +++ b/variants/um_feathers2neo/pins_arduino.h @@ -52,6 +52,9 @@ static const uint8_t DAC1 = 17; static const uint8_t DAC2 = 18; static const uint8_t NEOPIXEL_MATRIX_DATA = 21; +static const uint8_t NEOPIXEL_MATRIX_PWR = 4; + +static const uint8_t NEOPIXEL_DATA = 40; // RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() #define RGB_BUILTIN (NEOPIXEL_DATA + SOC_GPIO_PIN_COUNT) #define RGB_BRIGHTNESS 64 @@ -59,9 +62,6 @@ static const uint8_t NEOPIXEL_MATRIX_DATA = 21; static const uint8_t LED_BUILTIN = RGB_BUILTIN; #define BUILTIN_LED LED_BUILTIN // backward compatibility -static const uint8_t NEOPIXEL_MATRIX_PWR = 4; - -static const uint8_t NEOPIXEL_DATA = 40; static const uint8_t NEOPIXEL_PWR = 39; static const uint8_t VBAT_SENSE = 2; diff --git a/variants/um_feathers3/pins_arduino.h b/variants/um_feathers3/pins_arduino.h index a06825c8584..672c4784431 100644 --- a/variants/um_feathers3/pins_arduino.h +++ b/variants/um_feathers3/pins_arduino.h @@ -62,7 +62,6 @@ static const uint8_t LED_BUILTIN = RGB_BUILTIN; static const uint8_t RGB_PWR = 39; static const uint8_t LDO2 = 39; -static const uint8_t LED_BUILTIN = 13; static const uint8_t LED = 13; #endif /* Pins_Arduino_h */ From e4b6eba1900f226dfd829c21a9177086ab7c3e33 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Thu, 5 Oct 2023 10:01:42 -0300 Subject: [PATCH 3/3] adds LED_BUILTIN back --- .../adafruit_feather_esp32_v2/pins_arduino.h | 17 ++++++++--------- .../adafruit_feather_esp32s2/pins_arduino.h | 11 ++++++----- .../pins_arduino.h | 11 ++++++----- .../adafruit_feather_esp32s2_tft/pins_arduino.h | 11 ++++++----- .../adafruit_feather_esp32s3/pins_arduino.h | 12 +++++++----- .../pins_arduino.h | 12 +++++++----- .../pins_arduino.h | 12 +++++++----- .../adafruit_feather_esp32s3_tft/pins_arduino.h | 12 +++++++----- .../adafruit_funhouse_esp32s2/pins_arduino.h | 1 + .../adafruit_itsybitsy_esp32/pins_arduino.h | 12 +++++++----- .../adafruit_magtag29_esp32s2/pins_arduino.h | 11 ++++++----- .../pins_arduino.h | 11 ++++++----- variants/adafruit_metro_esp32s2/pins_arduino.h | 6 ++++-- variants/adafruit_metro_esp32s3/pins_arduino.h | 12 ++++++------ variants/adafruit_qtpy_esp32/pins_arduino.h | 2 ++ variants/adafruit_qtpy_esp32c3/pins_arduino.h | 4 ++++ variants/adafruit_qtpy_esp32s2/pins_arduino.h | 10 +++++----- .../adafruit_qtpy_esp32s3_n4r2/pins_arduino.h | 1 + .../pins_arduino.h | 2 +- .../pins_arduino.h | 12 +++++++----- variants/um_feathers3/pins_arduino.h | 7 ++++--- 21 files changed, 108 insertions(+), 81 deletions(-) diff --git a/variants/adafruit_feather_esp32_v2/pins_arduino.h b/variants/adafruit_feather_esp32_v2/pins_arduino.h index 9a618f1fd63..7aae51a2d16 100644 --- a/variants/adafruit_feather_esp32_v2/pins_arduino.h +++ b/variants/adafruit_feather_esp32_v2/pins_arduino.h @@ -4,15 +4,6 @@ #include #include "soc/soc_caps.h" -// Neopixel -#define PIN_NEOPIXEL 0 -// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino -static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); -#define BUILTIN_LED LED_BUILTIN // backward compatibility -// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() -#define RGB_BUILTIN LED_BUILTIN -#define RGB_BRIGHTNESS 64 - static const uint8_t TX = 8; static const uint8_t RX = 7; #define TX1 TX @@ -48,8 +39,16 @@ static const uint8_t A13 = 35; // internal switch #define BUTTON 38 +// User LED +static const uint8_t LED_BUILTIN = 13; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN + // Neopixel #define PIN_NEOPIXEL 0 +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking +#define RGB_BUILTIN (PIN_NEOPIXEL+SOC_GPIO_PIN_COUNT) +#define RGB_BRIGHTNESS 64 // Neopixel & I2C power #define NEOPIXEL_I2C_POWER 2 diff --git a/variants/adafruit_feather_esp32s2/pins_arduino.h b/variants/adafruit_feather_esp32s2/pins_arduino.h index 399f0b601f7..013ae6c6dea 100644 --- a/variants/adafruit_feather_esp32s2/pins_arduino.h +++ b/variants/adafruit_feather_esp32s2/pins_arduino.h @@ -10,13 +10,14 @@ #define USB_PRODUCT "Feather ESP32-S2" #define USB_SERIAL "" // Empty string for MAC adddress +// User LED +#define LED_BUILTIN 13 +#define BUILTIN_LED LED_BUILTIN // backward compatibility + // Neopixel #define PIN_NEOPIXEL 33 -// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino -static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); -#define BUILTIN_LED LED_BUILTIN // backward compatibility -// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() -#define RGB_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking +#define RGB_BUILTIN (PIN_NEOPIXEL+SOC_GPIO_PIN_COUNT) #define RGB_BRIGHTNESS 64 #define NEOPIXEL_NUM 1 // number of neopixels diff --git a/variants/adafruit_feather_esp32s2_reversetft/pins_arduino.h b/variants/adafruit_feather_esp32s2_reversetft/pins_arduino.h index 317299d60b8..d39b50628e2 100644 --- a/variants/adafruit_feather_esp32s2_reversetft/pins_arduino.h +++ b/variants/adafruit_feather_esp32s2_reversetft/pins_arduino.h @@ -10,13 +10,14 @@ #define USB_PRODUCT "Feather ESP32-S2 Reverse TFT" #define USB_SERIAL "" // Empty string for MAC adddress +// User LED +#define LED_BUILTIN 13 +#define BUILTIN_LED LED_BUILTIN // backward compatibility + // Neopixel #define PIN_NEOPIXEL 33 -// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino -static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); -#define BUILTIN_LED LED_BUILTIN // backward compatibility -// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() -#define RGB_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking +#define RGB_BUILTIN (PIN_NEOPIXEL+SOC_GPIO_PIN_COUNT) #define RGB_BRIGHTNESS 64 #define NEOPIXEL_NUM 1 // number of neopixels diff --git a/variants/adafruit_feather_esp32s2_tft/pins_arduino.h b/variants/adafruit_feather_esp32s2_tft/pins_arduino.h index 0c6a68c0c2b..ca713ac315d 100644 --- a/variants/adafruit_feather_esp32s2_tft/pins_arduino.h +++ b/variants/adafruit_feather_esp32s2_tft/pins_arduino.h @@ -10,13 +10,14 @@ #define USB_PRODUCT "Feather ESP32-S2 TFT" #define USB_SERIAL "" // Empty string for MAC adddress +// User LED +#define LED_BUILTIN 13 +#define BUILTIN_LED LED_BUILTIN // backward compatibility + // Neopixel #define PIN_NEOPIXEL 33 -// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino -static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); -#define BUILTIN_LED LED_BUILTIN // backward compatibility -// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() -#define RGB_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking +#define RGB_BUILTIN (PIN_NEOPIXEL+SOC_GPIO_PIN_COUNT) #define RGB_BRIGHTNESS 64 #define NEOPIXEL_NUM 1 // number of neopixels diff --git a/variants/adafruit_feather_esp32s3/pins_arduino.h b/variants/adafruit_feather_esp32s3/pins_arduino.h index e49848fd773..a8c491a64ad 100644 --- a/variants/adafruit_feather_esp32s3/pins_arduino.h +++ b/variants/adafruit_feather_esp32s3/pins_arduino.h @@ -10,12 +10,14 @@ #define USB_PRODUCT "Feather ESP32-S3" #define USB_SERIAL "" // Empty string for MAC adddress -#define PIN_NEOPIXEL 33 -// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino -static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; +// User LED +#define LED_BUILTIN 13 #define BUILTIN_LED LED_BUILTIN // backward compatibility -// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() -#define RGB_BUILTIN LED_BUILTIN + +// Neopixel +#define PIN_NEOPIXEL 33 +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking +#define RGB_BUILTIN (PIN_NEOPIXEL+SOC_GPIO_PIN_COUNT) #define RGB_BRIGHTNESS 64 #define NEOPIXEL_NUM 1 // number of neopixels diff --git a/variants/adafruit_feather_esp32s3_nopsram/pins_arduino.h b/variants/adafruit_feather_esp32s3_nopsram/pins_arduino.h index 3265df48c7d..65aec064fad 100644 --- a/variants/adafruit_feather_esp32s3_nopsram/pins_arduino.h +++ b/variants/adafruit_feather_esp32s3_nopsram/pins_arduino.h @@ -10,12 +10,14 @@ #define USB_PRODUCT "Feather ESP32-S3 No PSRAM" #define USB_SERIAL "" // Empty string for MAC adddress -#define PIN_NEOPIXEL 33 -// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino -static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; +// User LED +#define LED_BUILTIN 13 #define BUILTIN_LED LED_BUILTIN // backward compatibility -// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() -#define RGB_BUILTIN LED_BUILTIN + +// Neopixel +#define PIN_NEOPIXEL 33 +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking +#define RGB_BUILTIN (PIN_NEOPIXEL+SOC_GPIO_PIN_COUNT) #define RGB_BRIGHTNESS 64 #define NEOPIXEL_NUM 1 // number of neopixels diff --git a/variants/adafruit_feather_esp32s3_reversetft/pins_arduino.h b/variants/adafruit_feather_esp32s3_reversetft/pins_arduino.h index d920c5764ad..8fa045489fe 100644 --- a/variants/adafruit_feather_esp32s3_reversetft/pins_arduino.h +++ b/variants/adafruit_feather_esp32s3_reversetft/pins_arduino.h @@ -10,12 +10,14 @@ #define USB_PRODUCT "Feather ESP32-S3 Reverse TFT" #define USB_SERIAL "" // Empty string for MAC adddress -#define PIN_NEOPIXEL 33 -// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino -static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; +// User LED +#define LED_BUILTIN 13 #define BUILTIN_LED LED_BUILTIN // backward compatibility -// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() -#define RGB_BUILTIN LED_BUILTIN + +// Neopixel +#define PIN_NEOPIXEL 33 +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking +#define RGB_BUILTIN (PIN_NEOPIXEL+SOC_GPIO_PIN_COUNT) #define RGB_BRIGHTNESS 64 #define NEOPIXEL_NUM 1 // number of neopixels diff --git a/variants/adafruit_feather_esp32s3_tft/pins_arduino.h b/variants/adafruit_feather_esp32s3_tft/pins_arduino.h index 65e67d10e9a..56860f3c2d7 100644 --- a/variants/adafruit_feather_esp32s3_tft/pins_arduino.h +++ b/variants/adafruit_feather_esp32s3_tft/pins_arduino.h @@ -10,12 +10,14 @@ #define USB_PRODUCT "Feather ESP32-S3 TFT" #define USB_SERIAL "" // Empty string for MAC adddress -#define PIN_NEOPIXEL 33 -// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino -static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; +// User LED +#define LED_BUILTIN 13 #define BUILTIN_LED LED_BUILTIN // backward compatibility -// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() -#define RGB_BUILTIN LED_BUILTIN + +// Neopixel +#define PIN_NEOPIXEL 33 +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking +#define RGB_BUILTIN (PIN_NEOPIXEL+SOC_GPIO_PIN_COUNT) #define RGB_BRIGHTNESS 64 #define NEOPIXEL_NUM 1 // number of neopixels diff --git a/variants/adafruit_funhouse_esp32s2/pins_arduino.h b/variants/adafruit_funhouse_esp32s2/pins_arduino.h index e59252d7cf2..3594af16021 100644 --- a/variants/adafruit_funhouse_esp32s2/pins_arduino.h +++ b/variants/adafruit_funhouse_esp32s2/pins_arduino.h @@ -11,6 +11,7 @@ #define USB_SERIAL "" // Empty string for MAC adddress #define LED_BUILTIN 37 +#define BUILTIN_LED LED_BUILTIN // backward compatibility #define PIN_BUTTON1 3 #define PIN_BUTTON2 4 diff --git a/variants/adafruit_itsybitsy_esp32/pins_arduino.h b/variants/adafruit_itsybitsy_esp32/pins_arduino.h index 4eecff69887..c526628f7b1 100644 --- a/variants/adafruit_itsybitsy_esp32/pins_arduino.h +++ b/variants/adafruit_itsybitsy_esp32/pins_arduino.h @@ -4,13 +4,15 @@ #include #include "soc/soc_caps.h" +// User LED +static const uint8_t LED_BUILTIN = 13; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN + // Neopixel static const uint8_t PIN_NEOPIXEL = 0; -// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino -static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); -#define BUILTIN_LED LED_BUILTIN // backward compatibility -// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() -#define RGB_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking +#define RGB_BUILTIN (PIN_NEOPIXEL+SOC_GPIO_PIN_COUNT) #define RGB_BRIGHTNESS 64 static const uint8_t NEOPIXEL_POWER = 2; diff --git a/variants/adafruit_magtag29_esp32s2/pins_arduino.h b/variants/adafruit_magtag29_esp32s2/pins_arduino.h index 92d78503514..aaeb744ce0a 100644 --- a/variants/adafruit_magtag29_esp32s2/pins_arduino.h +++ b/variants/adafruit_magtag29_esp32s2/pins_arduino.h @@ -10,13 +10,14 @@ #define USB_PRODUCT "EPD MagTag 2.9\" ESP32-S2" #define USB_SERIAL "" // Empty string for MAC adddress +// User LED +#define LED_BUILTIN 13 +#define BUILTIN_LED LED_BUILTIN // backward compatibility + // Neopixel #define PIN_NEOPIXEL 1 // D1 -// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino -static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); // Only 1 NeoPixel will be affected -#define BUILTIN_LED LED_BUILTIN // backward compatibility -// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() -#define RGB_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking +#define RGB_BUILTIN (PIN_NEOPIXEL+SOC_GPIO_PIN_COUNT) #define RGB_BRIGHTNESS 64 #define NEOPIXEL_NUM 4 // number of neopixels diff --git a/variants/adafruit_matrixportal_esp32s3/pins_arduino.h b/variants/adafruit_matrixportal_esp32s3/pins_arduino.h index fa08fc95141..99529c02510 100644 --- a/variants/adafruit_matrixportal_esp32s3/pins_arduino.h +++ b/variants/adafruit_matrixportal_esp32s3/pins_arduino.h @@ -10,13 +10,14 @@ #define USB_PRODUCT "MatrixPortal ESP32-S3" #define USB_SERIAL "" // Empty string for MAC adddress +// User LED +#define LED_BUILTIN 13 +#define BUILTIN_LED LED_BUILTIN // backward compatibility + #define PIN_NEOPIXEL 4 #define NEOPIXEL_PIN 4 -// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino -static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; -#define BUILTIN_LED LED_BUILTIN // backward compatibility -// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() -#define RGB_BUILTIN LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking +#define RGB_BUILTIN (PIN_NEOPIXEL+SOC_GPIO_PIN_COUNT) #define RGB_BRIGHTNESS 64 #define NEOPIXEL_NUM 1 diff --git a/variants/adafruit_metro_esp32s2/pins_arduino.h b/variants/adafruit_metro_esp32s2/pins_arduino.h index de816dee10e..3b2e02b1dc1 100644 --- a/variants/adafruit_metro_esp32s2/pins_arduino.h +++ b/variants/adafruit_metro_esp32s2/pins_arduino.h @@ -11,10 +11,12 @@ #define USB_SERIAL "" // Empty string for MAC adddress #define LED_BUILTIN 42 +#define BUILTIN_LED LED_BUILTIN // backward compatibility +// Neopixel #define PIN_NEOPIXEL 45 -// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() -#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT) +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking +#define RGB_BUILTIN (PIN_NEOPIXEL+SOC_GPIO_PIN_COUNT) #define RGB_BRIGHTNESS 64 #define NEOPIXEL_NUM 1 diff --git a/variants/adafruit_metro_esp32s3/pins_arduino.h b/variants/adafruit_metro_esp32s3/pins_arduino.h index dd6e1cd3e9c..dd77fa7a5ab 100644 --- a/variants/adafruit_metro_esp32s3/pins_arduino.h +++ b/variants/adafruit_metro_esp32s3/pins_arduino.h @@ -10,13 +10,13 @@ #define USB_PRODUCT "Metro ESP32-S3" #define USB_SERIAL "" // Empty string for MAC adddress -#define PIN_NEOPIXEL 45 -#define NEOPIXEL_PIN 45 -// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino -static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; +#define LED_BUILTIN 13 #define BUILTIN_LED LED_BUILTIN // backward compatibility -// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() -#define RGB_BUILTIN LED_BUILTIN + +// Neopixel +#define PIN_NEOPIXEL 45 +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking +#define RGB_BUILTIN (PIN_NEOPIXEL+SOC_GPIO_PIN_COUNT) #define RGB_BRIGHTNESS 64 #define NEOPIXEL_NUM 1 diff --git a/variants/adafruit_qtpy_esp32/pins_arduino.h b/variants/adafruit_qtpy_esp32/pins_arduino.h index 38f3af064d2..40cad9f7005 100644 --- a/variants/adafruit_qtpy_esp32/pins_arduino.h +++ b/variants/adafruit_qtpy_esp32/pins_arduino.h @@ -9,6 +9,8 @@ // BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN + // RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 diff --git a/variants/adafruit_qtpy_esp32c3/pins_arduino.h b/variants/adafruit_qtpy_esp32c3/pins_arduino.h index b5fdc5a1f59..6b50bbddbd0 100644 --- a/variants/adafruit_qtpy_esp32c3/pins_arduino.h +++ b/variants/adafruit_qtpy_esp32c3/pins_arduino.h @@ -5,10 +5,14 @@ #include "soc/soc_caps.h" #define BUTTON 9 + +// Neopixel #define PIN_NEOPIXEL 2 // BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN + // RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 diff --git a/variants/adafruit_qtpy_esp32s2/pins_arduino.h b/variants/adafruit_qtpy_esp32s2/pins_arduino.h index 4752d269a11..aac8614875b 100644 --- a/variants/adafruit_qtpy_esp32s2/pins_arduino.h +++ b/variants/adafruit_qtpy_esp32s2/pins_arduino.h @@ -10,15 +10,15 @@ #define USB_PRODUCT "QT Py ESP32-S2" #define USB_SERIAL "" // Empty string for MAC adddress +// Neopixel #define PIN_NEOPIXEL 39 +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN // RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() -#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT) +#define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 -// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino -static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); -#define BUILTIN_LED LED_BUILTIN // backward compatibility - #define NEOPIXEL_NUM 1 // number of neopixels #define NEOPIXEL_POWER 38 // power pin #define NEOPIXEL_POWER_ON HIGH // power pin state when on diff --git a/variants/adafruit_qtpy_esp32s3_n4r2/pins_arduino.h b/variants/adafruit_qtpy_esp32s3_n4r2/pins_arduino.h index a4892c6b553..f4082c5cb2c 100644 --- a/variants/adafruit_qtpy_esp32s3_n4r2/pins_arduino.h +++ b/variants/adafruit_qtpy_esp32s3_n4r2/pins_arduino.h @@ -17,6 +17,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN // RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 diff --git a/variants/adafruit_qtpy_esp32s3_nopsram/pins_arduino.h b/variants/adafruit_qtpy_esp32s3_nopsram/pins_arduino.h index 0197b2dd810..e8f4ab08130 100644 --- a/variants/adafruit_qtpy_esp32s3_nopsram/pins_arduino.h +++ b/variants/adafruit_qtpy_esp32s3_nopsram/pins_arduino.h @@ -15,9 +15,9 @@ #define NEOPIXEL_POWER 38 // power pin #define NEOPIXEL_POWER_ON HIGH // power pin state when on -// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN // RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 diff --git a/variants/department_of_alchemy_minimain_esp32s2/pins_arduino.h b/variants/department_of_alchemy_minimain_esp32s2/pins_arduino.h index 63bf5608593..67427d7e516 100644 --- a/variants/department_of_alchemy_minimain_esp32s2/pins_arduino.h +++ b/variants/department_of_alchemy_minimain_esp32s2/pins_arduino.h @@ -10,12 +10,14 @@ #define USB_PRODUCT "MiniMain ESP32-S2" #define USB_SERIAL "" // Empty string for MAC adddress -#define PIN_NEOPIXEL 33 -// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino -static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT); +// User LED +#define LED_BUILTIN 13 #define BUILTIN_LED LED_BUILTIN // backward compatibility -// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() -#define RGB_BUILTIN LED_BUILTIN + +// Neopixel +#define PIN_NEOPIXEL 33 +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking +#define RGB_BUILTIN (PIN_NEOPIXEL+SOC_GPIO_PIN_COUNT) #define RGB_BRIGHTNESS 64 #define NEOPIXEL_NUM 1 // number of neopixels diff --git a/variants/um_feathers3/pins_arduino.h b/variants/um_feathers3/pins_arduino.h index 672c4784431..804a60d28e4 100644 --- a/variants/um_feathers3/pins_arduino.h +++ b/variants/um_feathers3/pins_arduino.h @@ -52,13 +52,14 @@ static const uint8_t T14 = 14; static const uint8_t VBAT_SENSE = 2; static const uint8_t VBUS_SENSE = 34; +// User LED +#define LED_BUILTIN 13 +#define BUILTIN_LED LED_BUILTIN // backward compatibility + static const uint8_t RGB_DATA = 40; // RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() #define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT) #define RGB_BRIGHTNESS 64 -// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino -static const uint8_t LED_BUILTIN = RGB_BUILTIN; -#define BUILTIN_LED LED_BUILTIN // backward compatibility static const uint8_t RGB_PWR = 39; static const uint8_t LDO2 = 39;