Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(board):Update M5Stack related board and pin configuration #10144

Merged
merged 4 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
449 changes: 298 additions & 151 deletions boards.txt

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions variants/m5stack_atom/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 16

#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 34)

P-R-O-C-H-Y marked this conversation as resolved.
Show resolved Hide resolved
static const uint8_t TX = 1;
static const uint8_t RX = 3;

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_atoms3/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#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)
Expand All @@ -16,6 +20,10 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + 48;
#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;

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_capsule/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
#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;

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_cardputer/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
#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;

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_core/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 20
#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;

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_core2/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 20
#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)

#define TX2 14
#define RX2 13

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_coreink/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 16

#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 34)

#define TX2 14
#define RX2 13

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_cores3/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#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)
Expand All @@ -16,6 +20,10 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + 48;
#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;

Expand Down
51 changes: 51 additions & 0 deletions variants/m5stack_dinmeter/pins_arduino.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h

#include <stdint.h>
#include "soc/soc_caps.h"

#define USB_VID 0x303a
#define USB_PID 0x1001

static const uint8_t TX = 43;
static const uint8_t RX = 44;

static const uint8_t TXD2 = 1;
static const uint8_t RXD2 = 2;

static const uint8_t SDA = 13;
static const uint8_t SCL = 15;

static const uint8_t SS = 12;
static const uint8_t MOSI = 14;
static const uint8_t MISO = 39;
static const uint8_t SCK = 40;

static const uint8_t G0 = 0;
static const uint8_t G1 = 1;
static const uint8_t G2 = 2;
static const uint8_t G3 = 3;
static const uint8_t G4 = 4;
static const uint8_t G5 = 5;
static const uint8_t G6 = 6;
static const uint8_t G7 = 7;
static const uint8_t G8 = 8;
static const uint8_t G9 = 9;
static const uint8_t G10 = 10;
static const uint8_t G11 = 11;
static const uint8_t G12 = 12;
static const uint8_t G13 = 13;
static const uint8_t G14 = 14;
static const uint8_t G15 = 15;
static const uint8_t G39 = 39;
static const uint8_t G40 = 40;
static const uint8_t G41 = 41;
static const uint8_t G42 = 42;
static const uint8_t G43 = 43;
static const uint8_t G44 = 44;
static const uint8_t G46 = 46;

static const uint8_t ADC1 = 7;
static const uint8_t ADC2 = 8;

#endif /* Pins_Arduino_h */
8 changes: 8 additions & 0 deletions variants/m5stack_fire/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 20
#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;

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_paper/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 16

#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 34)

#define TX2 14
#define RX2 13

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_poe_cam/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 16

#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 34)

static const uint8_t TX = 1;
static const uint8_t RX = 3;

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_stamp_c3/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 22
#define NUM_DIGITAL_PINS 22
#define NUM_ANALOG_INPUTS 6

#define analogInputToDigitalPin(p) (((p) < NUM_ANALOG_INPUTS) ? (esp32_adc2gpio[(p)]) : -1)
#define digitalPinToInterrupt(p) (((p) < NUM_DIGITAL_PINS) ? (p) : -1)
#define digitalPinHasPWM(p) (p < EXTERNAL_NUM_INTERRUPTS)

static const uint8_t TX = 21;
static const uint8_t RX = 20;

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_stamp_pico/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 16

#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 34)

static const uint8_t TX = 1;
static const uint8_t RX = 3;

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_stamp_s3/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
#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;

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_station/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 20
#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;

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_stickc/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 16

#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 34)

static const uint8_t TX = 1;
static const uint8_t RX = 3;

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_stickc_plus/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 16

#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 34)

static const uint8_t TX = 1;
static const uint8_t RX = 3;

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_stickc_plus2/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 16

#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 34)

static const uint8_t TX = 1;
static const uint8_t RX = 3;

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_timer_cam/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 16

#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 34)

static const uint8_t LED_BUILTIN = 2;
#define BUILTIN_LED LED_BUILTIN // backward compatibility

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_tough/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 20
#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)

#define TX2 14
#define RX2 13

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_unit_cam/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 16

#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 34)

static const uint8_t LED_BUILTIN = 4;
#define BUILTIN_LED LED_BUILTIN // backward compatibility

Expand Down
8 changes: 8 additions & 0 deletions variants/m5stack_unit_cams3/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
#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;

Expand Down