Skip to content

Commit ab6a25e

Browse files
authored
Master5.1 s3 gpio48 and platform txt review (espressif#8726)
* variants + S3 GPIO48 * fixes unphone8.build.flash_type * fixes unphone8.build.flash_type * heltec board name issue step 1 * heltec board name issue step 2 * fixes defines and new boards * final review
1 parent 709c935 commit ab6a25e

File tree

214 files changed

+557
-1898
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+557
-1898
lines changed

boards.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -23802,7 +23802,7 @@ unphone8.build.partitions=default_8MB
2380223802
unphone8.build.defines=-DBOARD_HAS_PSRAM -DUNPHONE_SPIN=8
2380323803
unphone8.build.loop_core=-DARDUINO_RUNNING_CORE=1
2380423804
unphone8.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1
23805-
unphone8.build.flash_type=qspi
23805+
unphone8.build.flash_type=qio
2380623806
unphone8.build.psram_type=qspi
2380723807
unphone8.build.memory_type={build.flash_type}_{build.psram_type}
2380823808

cores/esp32/Arduino.h

+12
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,18 @@
129129
#define NOT_AN_INTERRUPT -1
130130
#define NOT_ON_TIMER 0
131131

132+
// some defines generic for all SoC moved from variants/board_name/pins_arduino.h
133+
#define NUM_DIGITAL_PINS SOC_GPIO_PIN_COUNT // All GPIOs
134+
#if SOC_ADC_PERIPH_NUM == 1
135+
#define NUM_ANALOG_INPUTS (SOC_ADC_CHANNEL_NUM(0)) // Depends on the SoC (ESP32C6, ESP32H2, ESP32C2, ESP32P4)
136+
#elif SOC_ADC_PERIPH_NUM == 2
137+
#define NUM_ANALOG_INPUTS (SOC_ADC_CHANNEL_NUM(0)+SOC_ADC_CHANNEL_NUM(1)) // Depends on the SoC (ESP32, ESP32S2, ESP32S3, ESP32C3)
138+
#endif
139+
#define EXTERNAL_NUM_INTERRUPTS NUM_DIGITAL_PINS // All GPIOs
140+
#define analogInputToDigitalPin(p) (((p)<NUM_ANALOG_INPUTS)?(analogChannelToDigitalPin(p)):-1)
141+
#define digitalPinToInterrupt(p) (((p)<NUM_DIGITAL_PINS)?(p):NOT_AN_INTERRUPT)
142+
#define digitalPinHasPWM(p) ((p)<NUM_DIGITAL_PINS)
143+
132144
typedef bool boolean;
133145
typedef uint8_t byte;
134146
typedef unsigned int word;

cores/esp32/esp32-hal-gpio.c

+3
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ extern void __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtrArg userFunc,
196196
{
197197
static bool interrupt_initialized = false;
198198

199+
// makes sure that pin -1 (255) will never work -- this follows Arduino standard
200+
if (pin >= SOC_GPIO_PIN_COUNT) return;
201+
199202
if(!interrupt_initialized) {
200203
esp_err_t err = gpio_install_isr_service((int)ARDUINO_ISR_FLAG);
201204
interrupt_initialized = (err == ESP_OK) || (err == ESP_ERR_INVALID_STATE);

variants/AirM2M_CORE_ESP32C3/pins_arduino.h

+3-9
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,10 @@
33

44
#include <stdint.h>
55

6-
#define EXTERNAL_NUM_INTERRUPTS 22
7-
#define NUM_DIGITAL_PINS 22
8-
#define NUM_ANALOG_INPUTS 6
9-
10-
#define analogInputToDigitalPin(p) (((p)<NUM_ANALOG_INPUTS)?(analogChannelToDigitalPin(p)):-1)
11-
#define digitalPinToInterrupt(p) (((p)<NUM_DIGITAL_PINS)?(p):-1)
12-
#define digitalPinHasPWM(p) (p < EXTERNAL_NUM_INTERRUPTS)
13-
146
static const uint8_t LED_BUILTIN = 12;
15-
#define BUILTIN_LED LED_BUILTIN
7+
#define BUILTIN_LED LED_BUILTIN // backward compatibility
8+
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
9+
1610
static const uint8_t LED_BUILTIN_AUX = 13;
1711

1812
static const uint8_t TX = 21;

variants/Aventen_S3_Sync/pins_arduino.h

-9
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,13 @@
22
#define Pins_Arduino_h
33

44
#include <stdint.h>
5-
#include "soc/soc_caps.h"
65

76
#define USB_VID 0x303a
87
#define USB_PID 0x1001
98
#define USB_MANUFACTURER "Aventen"
109
#define USB_PRODUCT "Aventen S3 Sync"
1110
#define USB_SERIAL ""
1211

13-
#define NUM_DIGITAL_PINS SOC_GPIO_PIN_COUNT // GPIO 0..48
14-
#define NUM_ANALOG_INPUTS 20 // GPIO 1..20
15-
#define EXTERNAL_NUM_INTERRUPTS NUM_DIGITAL_PINS // All GPIOs
16-
17-
#define analogInputToDigitalPin(p) (((p)<NUM_ANALOG_INPUTS)?(analogChannelToDigitalPin(p)):-1)
18-
#define digitalPinToInterrupt(p) (((p)<NUM_DIGITAL_PINS)?(p):NOT_AN_INTERRUPT)
19-
#define digitalPinHasPWM(p) (p < NUM_DIGITAL_PINS)
20-
2112
static const uint8_t TX = 43;
2213
static const uint8_t RX = 44;
2314

variants/Bee_Data_Logger/pins_arduino.h

+9-8
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,14 @@
22
#define Pins_Arduino_h
33

44
#include <stdint.h>
5+
#include "soc/soc_caps.h"
56

67
#define USB_VID 0x303A
78
#define USB_PID 0x815C
89
#define USB_MANUFACTURER "Smart Bee Designs"
910
#define USB_PRODUCT "Bee Data Logger"
1011
#define USB_SERIAL ""
1112

12-
#define EXTERNAL_NUM_INTERRUPTS 46
13-
#define NUM_DIGITAL_PINS 13
14-
#define NUM_ANALOG_INPUTS 7
15-
16-
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
17-
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
18-
#define digitalPinHasPWM(p) (p < 46)
19-
2013
static const uint8_t TX = 43;
2114
static const uint8_t RX = 44;
2215

@@ -74,5 +67,13 @@ static const uint8_t LDO2 = 34;
7467
static const uint8_t RGB_DATA = 40;
7568
static const uint8_t RGB_PWR = 34;
7669

70+
#define PIN_NEOPIXEL RGB_DATA
71+
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
72+
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL;
73+
#define BUILTIN_LED LED_BUILTIN // backward compatibility
74+
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
75+
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
76+
#define RGB_BUILTIN LED_BUILTIN
77+
#define RGB_BRIGHTNESS 64
7778

7879
#endif /* Pins_Arduino_h */

variants/Bee_Motion/pins_arduino.h

-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@
99
#define USB_PRODUCT "Bee Motion S3"
1010
#define USB_SERIAL ""
1111

12-
#define EXTERNAL_NUM_INTERRUPTS 46
13-
#define NUM_DIGITAL_PINS 21
14-
#define NUM_ANALOG_INPUTS 12
15-
16-
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
17-
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
18-
#define digitalPinHasPWM(p) (p < 46)
19-
2012
static const uint8_t TX = 43;
2113
static const uint8_t RX = 44;
2214

variants/Bee_Motion_Mini/pins_arduino.h

+13-9
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,26 @@
33

44
#include <stdint.h>
55

6-
7-
#define EXTERNAL_NUM_INTERRUPTS 4
8-
#define NUM_DIGITAL_PINS 4
9-
#define NUM_ANALOG_INPUTS 2
10-
11-
#define analogInputToDigitalPin(p) (((p)<6)?(analogChannelToDigitalPin(p)):-1)
12-
#define digitalPinToInterrupt(p) (((p)<22)?(p):-1)
13-
#define digitalPinHasPWM(p) (p < 22)
14-
156
static const uint8_t TX = 21;
167
static const uint8_t RX = 20;
178

189
static const uint8_t BOOT_BTN = 9;
1910
static const uint8_t PIR = 5;
2011

12+
static const uint8_t SDA = 8;
13+
static const uint8_t SCL = 9;
14+
15+
static const uint8_t SS = 7;
16+
static const uint8_t MOSI = 6;
17+
static const uint8_t MISO = 5;
18+
static const uint8_t SCK = 4;
2119

20+
static const uint8_t A0 = 0;
21+
static const uint8_t A1 = 1;
22+
static const uint8_t A2 = 2;
23+
static const uint8_t A3 = 3;
24+
static const uint8_t A4 = 4;
25+
static const uint8_t A5 = 5;
2226

2327
#endif /* Pins_Arduino_h */
2428

variants/Bee_Motion_S3/pins_arduino.h

+9-8
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,14 @@
22
#define Pins_Arduino_h
33

44
#include <stdint.h>
5+
#include "soc/soc_caps.h"
56

67
#define USB_VID 0x303A
78
#define USB_PID 0x8113
89
#define USB_MANUFACTURER "Smart Bee Designs"
910
#define USB_PRODUCT "Bee Motion S3"
1011
#define USB_SERIAL ""
1112

12-
#define EXTERNAL_NUM_INTERRUPTS 46
13-
#define NUM_DIGITAL_PINS 27
14-
#define NUM_ANALOG_INPUTS 11
15-
16-
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
17-
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
18-
#define digitalPinHasPWM(p) (p < 46)
19-
2013
static const uint8_t TX = 43;
2114
static const uint8_t RX = 44;
2215

@@ -81,5 +74,13 @@ static const uint8_t LDO2 = 34;
8174
static const uint8_t RGB_DATA = 40;
8275
static const uint8_t RGB_PWR = 34;
8376

77+
#define PIN_NEOPIXEL RGB_DATA
78+
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
79+
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL;
80+
#define BUILTIN_LED LED_BUILTIN // backward compatibility
81+
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
82+
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
83+
#define RGB_BUILTIN LED_BUILTIN
84+
#define RGB_BRIGHTNESS 64
8485

8586
#endif /* Pins_Arduino_h */

variants/Bee_S3/pins_arduino.h

+10-8
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,14 @@
22
#define Pins_Arduino_h
33

44
#include <stdint.h>
5+
#include "soc/soc_caps.h"
56

67
#define USB_VID 0x303A
78
#define USB_PID 0x8110
89
#define USB_MANUFACTURER "Smart Bee Designs"
910
#define USB_PRODUCT "BeeS3"
1011
#define USB_SERIAL ""
1112

12-
#define EXTERNAL_NUM_INTERRUPTS 45
13-
#define NUM_DIGITAL_PINS 15
14-
#define NUM_ANALOG_INPUTS 8
15-
16-
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
17-
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
18-
#define digitalPinHasPWM(p) (p < 46)
19-
2013
static const uint8_t TX = 43;
2114
static const uint8_t RX = 44;
2215

@@ -73,4 +66,13 @@ static const uint8_t VBAT_VOLTAGE = 1;
7366
static const uint8_t RGB_DATA = 48;
7467
static const uint8_t RGB_PWR = 34;
7568

69+
#define PIN_NEOPIXEL RGB_DATA
70+
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
71+
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL;
72+
#define BUILTIN_LED LED_BUILTIN // backward compatibility
73+
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
74+
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
75+
#define RGB_BUILTIN LED_BUILTIN
76+
#define RGB_BRIGHTNESS 64
77+
7678
#endif /* Pins_Arduino_h */

variants/ET-Board/pins_arduino.h

+1-11
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,9 @@
33

44
#include <stdint.h>
55

6-
#define EXTERNAL_NUM_INTERRUPTS 16
7-
#define NUM_DIGITAL_PINS 40
8-
#define NUM_ANALOG_INPUTS 7
9-
10-
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
11-
#define digitalPinToInterrupt(p) (((p)<40)?(p):-1)
12-
#define digitalPinHasPWM(p) (p < 34)
13-
146
static const uint8_t LED_BUILTIN = 5;
157
#define BUILTIN_LED LED_BUILTIN // backward compatibility
16-
#define LED_BUILTIN LED_BUILTIN
17-
18-
8+
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
199

2010
static const uint8_t TX = 34;
2111
static const uint8_t RX = 35;

variants/Edgebox-ESP-100/pins_arduino.h

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33

44
#include <stdint.h>
55

6-
#define EXTERNAL_NUM_INTERRUPTS 34
7-
#define NUM_DIGITAL_PINS 34
8-
#define NUM_ANALOG_INPUTS 2
9-
10-
#define analogInputToDigitalPin(p) (((p)<2)?(analogChannelToDigitalPin(p)):-1)
11-
#define digitalPinToInterrupt(p) (((p)<34)?(p):-1)
12-
#define digitalPinHasPWM(p) (p < 34)
13-
146
//Programming and Debugging Port
157
static const uint8_t TXD = 43;
168
static const uint8_t RXD = 44;

variants/Microduino-esp32/pins_arduino.h

+1-9
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,9 @@
33

44
#include <stdint.h>
55

6-
#define EXTERNAL_NUM_INTERRUPTS 16
7-
#define NUM_DIGITAL_PINS 22
8-
#define NUM_ANALOG_INPUTS 12
9-
10-
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
11-
#define digitalPinToInterrupt(p) (((p)<40)?(p):-1)
12-
#define digitalPinHasPWM(p) (p < 34)
13-
146
static const uint8_t LED_BUILTIN = -1;
157
#define BUILTIN_LED LED_BUILTIN // backward compatibility
16-
#define LED_BUILTIN LED_BUILTIN
8+
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
179

1810
#define MTDO 15
1911
#define MTDI 12

variants/Nebula_S3/pins_arduino.h

+3-11
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,14 @@
22
#define Pins_Arduino_h
33

44
#include <stdint.h>
5+
#include "soc/soc_caps.h"
56

67
#define USB_VID 0x303a
78
#define USB_PID 0x1001
89

9-
#define EXTERNAL_NUM_INTERRUPTS 20
10-
#define NUM_DIGITAL_PINS 20
11-
#define NUM_ANALOG_INPUTS 6
12-
13-
#define analogInputToDigitalPin(p) (((p)<6)?(analogChannelToDigitalPin(p)):-1)
14-
#define digitalPinToInterrupt(p) (((p)<20)?(p):-1)
15-
#define digitalPinHasPWM(p) (p < 20)
16-
17-
18-
static const uint8_t LED_BUILTIN = 45;
10+
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + 45;
1911
#define BUILTIN_LED LED_BUILTIN // backward compatibility
20-
#define LED_BUILTIN LED_BUILTIN
12+
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
2113
#define RGB_BUILTIN LED_BUILTIN
2214
#define RGB_BRIGHTNESS 64
2315

variants/S_ODI_Ultra_v1/pins_arduino.h

+1-9
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,10 @@
33

44
#include <stdint.h>
55

6-
#define EXTERNAL_NUM_INTERRUPTS 16
7-
#define NUM_DIGITAL_PINS 40
8-
#define NUM_ANALOG_INPUTS 16
9-
10-
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
11-
#define digitalPinToInterrupt(p) (((p)<40)?(p):-1)
12-
#define digitalPinHasPWM(p) (p < 34)
13-
146
static const uint8_t LED_BUILTIN = 2;
157
static const uint8_t LED_BUILTINB = 4;
168
#define BUILTIN_LED LED_BUILTIN // backward compatibility
17-
#define LED_BUILTIN LED_BUILTIN
9+
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
1810
#define BUILTIN_LED2 LED_BUILTINB
1911

2012
static const uint8_t TX = 1;

variants/VALTRACK_V4_MFW_ESP32_C3/pins_arduino.h

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33

44
#include <stdint.h>
55

6-
#define EXTERNAL_NUM_INTERRUPTS 22
7-
#define NUM_DIGITAL_PINS 22
8-
#define NUM_ANALOG_INPUTS 6
9-
10-
#define analogInputToDigitalPin(p) (((p)<NUM_ANALOG_INPUTS)?(analogChannelToDigitalPin(p)):-1)
11-
#define digitalPinToInterrupt(p) (((p)<NUM_DIGITAL_PINS)?(p):-1)
12-
#define digitalPinHasPWM(p) (p < EXTERNAL_NUM_INTERRUPTS)
13-
146
static const uint8_t TX = 21;
157
static const uint8_t RX = 20;
168

variants/VALTRACK_V4_VTS_ESP32_C3/pins_arduino.h

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33

44
#include <stdint.h>
55

6-
#define EXTERNAL_NUM_INTERRUPTS 22
7-
#define NUM_DIGITAL_PINS 22
8-
#define NUM_ANALOG_INPUTS 6
9-
10-
#define analogInputToDigitalPin(p) (((p)<NUM_ANALOG_INPUTS)?(analogChannelToDigitalPin(p)):-1)
11-
#define digitalPinToInterrupt(p) (((p)<NUM_DIGITAL_PINS)?(p):-1)
12-
#define digitalPinHasPWM(p) (p < EXTERNAL_NUM_INTERRUPTS)
13-
146
static const uint8_t TX = 21;
157
static const uint8_t RX = 20;
168

variants/XIAO_ESP32C3/pins_arduino.h

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33

44
#include <stdint.h>
55

6-
#define EXTERNAL_NUM_INTERRUPTS 22
7-
#define NUM_DIGITAL_PINS 22
8-
#define NUM_ANALOG_INPUTS 6
9-
10-
#define analogInputToDigitalPin(p) (((p)<NUM_ANALOG_INPUTS)?(analogChannelToDigitalPin(p)):-1)
11-
#define digitalPinToInterrupt(p) (((p)<NUM_DIGITAL_PINS)?(p):-1)
12-
#define digitalPinHasPWM(p) (p < EXTERNAL_NUM_INTERRUPTS)
13-
146
static const uint8_t TX = 21;
157
static const uint8_t RX = 20;
168

0 commit comments

Comments
 (0)