Skip to content

Instantly share code, notes, and snippets.

@mcorrigan
Last active November 19, 2024 02:50
Show Gist options
  • Save mcorrigan/1aec03bd57453a409494d585cb142e6d to your computer and use it in GitHub Desktop.
Save mcorrigan/1aec03bd57453a409494d585cb142e6d to your computer and use it in GitHub Desktop.
Lolin ESP32-C3 PlatformIO Board
{
"build": {
"arduino": {
"ldscript": "esp32c3_out.ld"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_LOLIN_C3_PICO",
"-DARDUINO_USB_MODE=1",
"-DARDUINO_USB_CDC_ON_BOOT=1"
],
"f_cpu": "160000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [
[
"0X303A",
"0x1001"
]
],
"mcu": "esp32c3",
"variant": "lolin_c3_pico"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32c3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "WEMOS LOLIN C3 Pico",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 460800
},
"url": "https://www.wemos.cc/en/latest/c3/c3_pico.html",
"vendor": "WEMOS"
}
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#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)?(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 = 7;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
static const uint8_t TX = 21;
static const uint8_t RX = 20;
static const uint8_t SDA = 8;
static const uint8_t SCL = 10;
static const uint8_t SS = 5;
static const uint8_t MOSI = 4;
static const uint8_t MISO = 3;
static const uint8_t SCK = 2;
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 */
@mcorrigan
Copy link
Author

I should probably create PRs for this, but I'm not 100% sure it's right. Use as your own risk.

~.platformio\platforms\espressif32\boards\lolin_c3_pico.json
~.platformio\packages\framework-arduinoespressif32\variants\lolin_c3_pico\pins_arduino.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment