Skip to content

Add ESP-C3-M1-I-Kit board #6938

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

Merged
merged 16 commits into from
Dec 14, 2022
Merged
40 changes: 40 additions & 0 deletions esp_c3_m1_i_kit/pins_arduino.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 30
#define NUM_DIGITAL_PINS 30
#define NUM_ANALOG_INPUTS 6

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

static const uint8_t LED_BUILTIN = 18;
static const uint8_t LED_BUILTIN = 19;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate pin define... which is it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wmjohnanderson - suggestion:

static const uint8_t LED_C = 18;
static const uint8_t LED_W = 19;
static const uint8_t LED_BUILTIN = 19; 
#define BUILTIN_LED  LED_BUILTIN // backward compatibility

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

#define BUILTIN_LED LED_BUILTIN // backward compatibility

static const uint8_t LED_GREEN = 4;
static const uint8_t LED_RED = 3;
static const uint8_t LED_BLUE = 5;

static const uint8_t TX = 18;
static const uint8_t RX = 19;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the correct pins used in this boards. GPIO18 and 19 are LEDs and USB JTAG/CDC.

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


static const uint8_t SDA = 4;
static const uint8_t SCL = 5;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion based on the boards layout would be:

static const uint8_t SDA = 1;
static const uint8_t SCL = 2;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with standard ESP32-C3 definition.


static const uint8_t SS = 23;
static const uint8_t MOSI = 21;
static const uint8_t MISO = 22;
static const uint8_t SCK = 28;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the above four pins are not recommended for use or do not exist on the ESP32-C3. These should be remapped to valid pins.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wmjohnanderson - suggestion:

static const uint8_t SS    = 5;
static const uint8_t MOSI  = 10;
static const uint8_t MISO  = 6;
static const uint8_t SCK   = 7;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


static const uint8_t A0 = 1;
static const uint8_t A1 = 2;
static const uint8_t A2 = 4;
static const uint8_t A3 = 5;
static const uint8_t A4 = 6;
static const uint8_t A5 = 13;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GPIO 0 - 5 are the only ADC pins, GPIO 13 does not exist.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wmjohnanderson - suggestion:

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;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


#endif /* Pins_Arduino_h */