Skip to content

Commit 1deee65

Browse files
committed
Update M5Stack related board and pin configuration
1 parent 70786dc commit 1deee65

File tree

24 files changed

+525
-151
lines changed

24 files changed

+525
-151
lines changed

Diff for: boards.txt

+298-151
Large diffs are not rendered by default.

Diff for: variants/m5stack_atom/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
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) ? (esp32_adc2gpio[(p)]) : -1)
11+
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
614
static const uint8_t TX = 1;
715
static const uint8_t RX = 3;
816

Diff for: variants/m5stack_atoms3/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
#define USB_VID 0x303a
88
#define USB_PID 0x1001
99

10+
#define EXTERNAL_NUM_INTERRUPTS 46
11+
#define NUM_DIGITAL_PINS 48
12+
#define NUM_ANALOG_INPUTS 20
13+
1014
// Some boards have too low voltage on this pin (board design bug)
1115
// Use different pin with 3V and connect with 48
1216
// and change this setup for the chosen pin (for example 38)
@@ -16,6 +20,10 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + 48;
1620
#define RGB_BUILTIN LED_BUILTIN
1721
#define RGB_BRIGHTNESS 64
1822

23+
#define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1)
24+
#define digitalPinToInterrupt(p) (((p) < 48) ? (p) : -1)
25+
#define digitalPinHasPWM(p) (p < 46)
26+
1927
static const uint8_t TX = 43;
2028
static const uint8_t RX = 44;
2129

Diff for: variants/m5stack_capsule/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
#define USB_VID 0x303a
88
#define USB_PID 0x1001
99

10+
#define EXTERNAL_NUM_INTERRUPTS 23
11+
#define NUM_DIGITAL_PINS 46
12+
#define NUM_ANALOG_INPUTS 15
13+
14+
#define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1)
15+
#define digitalPinToInterrupt(p) (((p) < 48) ? (p) : -1)
16+
#define digitalPinHasPWM(p) (p < 46)
17+
1018
static const uint8_t TX = 43;
1119
static const uint8_t RX = 44;
1220

Diff for: variants/m5stack_cardputer/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
#define USB_VID 0x303a
88
#define USB_PID 0x1001
99

10+
#define EXTERNAL_NUM_INTERRUPTS 23
11+
#define NUM_DIGITAL_PINS 46
12+
#define NUM_ANALOG_INPUTS 15
13+
14+
#define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1)
15+
#define digitalPinToInterrupt(p) (((p) < 48) ? (p) : -1)
16+
#define digitalPinHasPWM(p) (p < 46)
17+
1018
static const uint8_t TX = 43;
1119
static const uint8_t RX = 44;
1220

Diff for: variants/m5stack_core/pins_arduino.h

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

44
#include <stdint.h>
55

6+
#define EXTERNAL_NUM_INTERRUPTS 16
7+
#define NUM_DIGITAL_PINS 20
8+
#define NUM_ANALOG_INPUTS 16
9+
10+
#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
11+
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
614
static const uint8_t TX = 1;
715
static const uint8_t RX = 3;
816

Diff for: variants/m5stack_core2/pins_arduino.h

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

44
#include <stdint.h>
55

6+
#define EXTERNAL_NUM_INTERRUPTS 16
7+
#define NUM_DIGITAL_PINS 20
8+
#define NUM_ANALOG_INPUTS 16
9+
10+
#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
11+
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
614
#define TX2 14
715
#define RX2 13
816

Diff for: variants/m5stack_coreink/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
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) ? (esp32_adc2gpio[(p)]) : -1)
11+
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
614
#define TX2 14
715
#define RX2 13
816

Diff for: variants/m5stack_cores3/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
#define USB_VID 0x303a
88
#define USB_PID 0x1001
99

10+
#define EXTERNAL_NUM_INTERRUPTS 46
11+
#define NUM_DIGITAL_PINS 48
12+
#define NUM_ANALOG_INPUTS 20
13+
1014
// Some boards have too low voltage on this pin (board design bug)
1115
// Use different pin with 3V and connect with 48
1216
// and change this setup for the chosen pin (for example 38)
@@ -16,6 +20,10 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + 48;
1620
#define RGB_BUILTIN LED_BUILTIN
1721
#define RGB_BRIGHTNESS 64
1822

23+
#define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1)
24+
#define digitalPinToInterrupt(p) (((p) < 48) ? (p) : -1)
25+
#define digitalPinHasPWM(p) (p < 46)
26+
1927
static const uint8_t TX = 43;
2028
static const uint8_t RX = 44;
2129

Diff for: variants/m5stack_dinmeter/pins_arduino.h

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#ifndef Pins_Arduino_h
2+
#define Pins_Arduino_h
3+
4+
#include <stdint.h>
5+
#include "soc/soc_caps.h"
6+
7+
#define USB_VID 0x303a
8+
#define USB_PID 0x1001
9+
10+
static const uint8_t TX = 43;
11+
static const uint8_t RX = 44;
12+
13+
static const uint8_t TXD2 = 1;
14+
static const uint8_t RXD2 = 2;
15+
16+
static const uint8_t SDA = 13;
17+
static const uint8_t SCL = 15;
18+
19+
static const uint8_t SS = 12;
20+
static const uint8_t MOSI = 14;
21+
static const uint8_t MISO = 39;
22+
static const uint8_t SCK = 40;
23+
24+
static const uint8_t G0 = 0;
25+
static const uint8_t G1 = 1;
26+
static const uint8_t G2 = 2;
27+
static const uint8_t G3 = 3;
28+
static const uint8_t G4 = 4;
29+
static const uint8_t G5 = 5;
30+
static const uint8_t G6 = 6;
31+
static const uint8_t G7 = 7;
32+
static const uint8_t G8 = 8;
33+
static const uint8_t G9 = 9;
34+
static const uint8_t G10 = 10;
35+
static const uint8_t G11 = 11;
36+
static const uint8_t G12 = 12;
37+
static const uint8_t G13 = 13;
38+
static const uint8_t G14 = 14;
39+
static const uint8_t G15 = 15;
40+
static const uint8_t G39 = 39;
41+
static const uint8_t G40 = 40;
42+
static const uint8_t G41 = 41;
43+
static const uint8_t G42 = 42;
44+
static const uint8_t G43 = 43;
45+
static const uint8_t G44 = 44;
46+
static const uint8_t G46 = 46;
47+
48+
static const uint8_t ADC1 = 7;
49+
static const uint8_t ADC2 = 8;
50+
51+
#endif /* Pins_Arduino_h */

Diff for: variants/m5stack_fire/pins_arduino.h

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

44
#include <stdint.h>
55

6+
#define EXTERNAL_NUM_INTERRUPTS 16
7+
#define NUM_DIGITAL_PINS 20
8+
#define NUM_ANALOG_INPUTS 16
9+
10+
#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
11+
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
614
static const uint8_t TX = 1;
715
static const uint8_t RX = 3;
816

Diff for: variants/m5stack_paper/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
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) ? (esp32_adc2gpio[(p)]) : -1)
11+
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
614
#define TX2 14
715
#define RX2 13
816

Diff for: variants/m5stack_poe_cam/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
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) ? (esp32_adc2gpio[(p)]) : -1)
11+
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
614
static const uint8_t TX = 1;
715
static const uint8_t RX = 3;
816

Diff for: variants/m5stack_stamp_c3/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
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) ? (esp32_adc2gpio[(p)]) : -1)
11+
#define digitalPinToInterrupt(p) (((p) < NUM_DIGITAL_PINS) ? (p) : -1)
12+
#define digitalPinHasPWM(p) (p < EXTERNAL_NUM_INTERRUPTS)
13+
614
static const uint8_t TX = 21;
715
static const uint8_t RX = 20;
816

Diff for: variants/m5stack_stamp_pico/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
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) ? (esp32_adc2gpio[(p)]) : -1)
11+
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
614
static const uint8_t TX = 1;
715
static const uint8_t RX = 3;
816

Diff for: variants/m5stack_stamp_s3/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
#define USB_VID 0x303a
88
#define USB_PID 0x1001
99

10+
#define EXTERNAL_NUM_INTERRUPTS 23
11+
#define NUM_DIGITAL_PINS 46
12+
#define NUM_ANALOG_INPUTS 15
13+
14+
#define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1)
15+
#define digitalPinToInterrupt(p) (((p) < 48) ? (p) : -1)
16+
#define digitalPinHasPWM(p) (p < 46)
17+
1018
static const uint8_t TX = 43;
1119
static const uint8_t RX = 44;
1220

Diff for: variants/m5stack_station/pins_arduino.h

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

44
#include <stdint.h>
55

6+
#define EXTERNAL_NUM_INTERRUPTS 16
7+
#define NUM_DIGITAL_PINS 20
8+
#define NUM_ANALOG_INPUTS 16
9+
10+
#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
11+
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
614
static const uint8_t TX = 1;
715
static const uint8_t RX = 3;
816

Diff for: variants/m5stack_stickc/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
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) ? (esp32_adc2gpio[(p)]) : -1)
11+
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
614
static const uint8_t TX = 1;
715
static const uint8_t RX = 3;
816

Diff for: variants/m5stack_stickc_plus/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
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) ? (esp32_adc2gpio[(p)]) : -1)
11+
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
614
static const uint8_t TX = 1;
715
static const uint8_t RX = 3;
816

Diff for: variants/m5stack_stickc_plus2/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
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) ? (esp32_adc2gpio[(p)]) : -1)
11+
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
614
static const uint8_t TX = 1;
715
static const uint8_t RX = 3;
816

Diff for: variants/m5stack_timer_cam/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
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) ? (esp32_adc2gpio[(p)]) : -1)
11+
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
614
static const uint8_t LED_BUILTIN = 2;
715
#define BUILTIN_LED LED_BUILTIN // backward compatibility
816

Diff for: variants/m5stack_tough/pins_arduino.h

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

44
#include <stdint.h>
55

6+
#define EXTERNAL_NUM_INTERRUPTS 16
7+
#define NUM_DIGITAL_PINS 20
8+
#define NUM_ANALOG_INPUTS 16
9+
10+
#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
11+
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
614
#define TX2 14
715
#define RX2 13
816

Diff for: variants/m5stack_unit_cam/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
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) ? (esp32_adc2gpio[(p)]) : -1)
11+
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
614
static const uint8_t LED_BUILTIN = 4;
715
#define BUILTIN_LED LED_BUILTIN // backward compatibility
816

Diff for: variants/m5stack_unit_cams3/pins_arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
#define USB_VID 0x303a
88
#define USB_PID 0x1001
99

10+
#define EXTERNAL_NUM_INTERRUPTS 23
11+
#define NUM_DIGITAL_PINS 46
12+
#define NUM_ANALOG_INPUTS 15
13+
14+
#define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1)
15+
#define digitalPinToInterrupt(p) (((p) < 48) ? (p) : -1)
16+
#define digitalPinHasPWM(p) (p < 46)
17+
1018
static const uint8_t TX = 43;
1119
static const uint8_t RX = 44;
1220

0 commit comments

Comments
 (0)