Skip to content

Commit 922a16e

Browse files
authored
Merge pull request #14 from espressif/master
22.12.2021
2 parents a0dc6d2 + 44fbde0 commit 922a16e

File tree

10 files changed

+121
-11
lines changed

10 files changed

+121
-11
lines changed

Diff for: cores/esp32/esp32-hal-gpio.c

+30-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@
3737
#include "soc/periph_defs.h"
3838
#include "soc/rtc_io_reg.h"
3939
#define GPIO_FUNC 1
40-
#else
40+
#elif CONFIG_IDF_TARGET_ESP32C3
41+
#include "esp32c3/rom/ets_sys.h"
42+
#include "esp32c3/rom/gpio.h"
43+
#include "esp_intr_alloc.h"
44+
#include "soc/periph_defs.h"
45+
#define USE_ESP_IDF_GPIO 1
46+
#else
4147
#define USE_ESP_IDF_GPIO 1
4248
#endif
4349
#else // ESP32 Before IDF 4.0
@@ -143,6 +149,29 @@ const DRAM_ATTR esp32_gpioMux_t esp32_gpioMux[SOC_GPIO_PIN_COUNT]={
143149
{0xb8, -1, -1, -1},//SCL?
144150
{0xbc, -1, -1, -1},//INPUT ONLY
145151
{0, -1, -1, -1}
152+
#elif CONFIG_IDF_TARGET_ESP32C3
153+
{0x04, -1, 0, -1}, // ADC1_CH0
154+
{0x08, -1, 1, -1}, // ADC1_CH1
155+
{0x0c, -1, 2, -1}, // ADC1_CH2 | FSPIQ
156+
{0x10, -1, 3, -1}, // ADC1_CH3
157+
{0x14, -1, 4, -1}, // MTMS | ADC1_CH4 | FSPIHD
158+
{0x18, -1, 5, -1}, // MTDI | ADC2_CH0 | FSPIWP
159+
{0x1c, -1, -1, -1}, // MTCK | FSPICLK
160+
{0x20, -1, -1, -1}, // MTDO | FSPID
161+
{0x24, -1, -1, -1}, //
162+
{0x28, -1, -1, -1}, //
163+
{0x2c, -1, -1, -1}, // FSPICSO
164+
{0x30, -1, -1, -1}, //
165+
{0x34, -1, -1, -1}, // SPIHD
166+
{0x38, -1, -1, -1}, // SPIWP
167+
{0x3c, -1, -1, -1}, // SPICSO
168+
{0x40, -1, -1, -1}, // SPICLK
169+
{0x44, -1, -1, -1}, // SPID
170+
{0x48, -1, -1, -1}, // SPIQ
171+
{0x4c, -1, -1, -1}, // USB-
172+
{0x50, -1, -1, -1}, // USB+
173+
{0x54, -1, -1, -1}, // U0RXD
174+
{0x58, -1, -1, -1}, // U0TXD
146175
#endif
147176
};
148177

@@ -481,4 +510,3 @@ extern int digitalRead(uint8_t pin) __attribute__ ((weak, alias("__digitalRead")
481510
extern void attachInterrupt(uint8_t pin, voidFuncPtr handler, int mode) __attribute__ ((weak, alias("__attachInterrupt")));
482511
extern void attachInterruptArg(uint8_t pin, voidFuncPtrArg handler, void * arg, int mode) __attribute__ ((weak, alias("__attachInterruptArg")));
483512
extern void detachInterrupt(uint8_t pin) __attribute__ ((weak, alias("__detachInterrupt")));
484-

Diff for: cores/esp32/esp32-hal-rmt.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,9 @@ float rmtSetTick(rmt_obj_t* rmt, float tick)
515515
rmt_obj_t* rmtInit(int pin, bool tx_not_rx, rmt_reserve_memsize_t memsize)
516516
{
517517
int buffers = memsize;
518-
rmt_obj_t* rmt;
519-
size_t i;
520-
size_t j;
518+
rmt_obj_t* rmt = NULL;
519+
size_t i = 0;
520+
size_t j = 0;
521521

522522
// create common block mutex for protecting allocs from multiple threads
523523
if (!g_rmt_block_lock) {
21.9 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ESP-IDF Partition Table
2+
# Name, Type, SubType, Offset, Size, Flags
3+
# bootloader.bin,, 0x1000, 32K
4+
# partition table, 0x8000, 4K
5+
6+
nvs, data, nvs, 0x9000, 20K,
7+
otadata, data, ota, 0xe000, 8K,
8+
ota_0, 0, ota_0, 0x10000, 1408K,
9+
ota_1, 0, ota_1, 0x170000, 1408K,
10+
uf2, app, factory,0x2d0000, 256K,
11+
ffat, data, fat, 0x310000, 960K,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#ifndef Pins_Arduino_h
2+
#define Pins_Arduino_h
3+
4+
#include <stdint.h>
5+
6+
7+
#define USB_VID 0x239A
8+
#define USB_PID 0x80ED
9+
#define USB_MANUFACTURER "Adafruit"
10+
#define USB_PRODUCT "Feather ESP32-S2 Reverse TFT"
11+
#define USB_SERIAL "" // Empty string for MAC adddress
12+
13+
14+
#define EXTERNAL_NUM_INTERRUPTS 46
15+
#define NUM_DIGITAL_PINS 48
16+
#define NUM_ANALOG_INPUTS 20
17+
18+
#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1)
19+
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
20+
#define digitalPinHasPWM(p) (p < 46)
21+
22+
#define LED_BUILTIN 13
23+
24+
#define PIN_NEOPIXEL 33
25+
#define NEOPIXEL_NUM 1 // number of neopixels
26+
#define NEOPIXEL_POWER 21 // power pin
27+
#define NEOPIXEL_POWER_ON HIGH // power pin state when on
28+
29+
#define TFT_I2C_POWER 7
30+
#define TFT_CS 42
31+
#define TFT_RST 41
32+
#define TFT_DC 40
33+
#define TFT_BACKLITE 45
34+
35+
static const uint8_t SDA = 3;
36+
static const uint8_t SCL = 4;
37+
38+
static const uint8_t SS = 42;
39+
static const uint8_t MOSI = 35;
40+
static const uint8_t SCK = 36;
41+
static const uint8_t MISO = 37;
42+
43+
static const uint8_t A0 = 18;
44+
static const uint8_t A1 = 17;
45+
static const uint8_t A2 = 16;
46+
static const uint8_t A3 = 15;
47+
static const uint8_t A4 = 14;
48+
static const uint8_t A5 = 8;
49+
50+
static const uint8_t TX = 39;
51+
static const uint8_t RX = 38;
52+
static const uint8_t TX1 = 39;
53+
static const uint8_t RX1 = 38;
54+
55+
static const uint8_t T5 = 5;
56+
static const uint8_t T6 = 6;
57+
static const uint8_t T8 = 8;
58+
static const uint8_t T9 = 9;
59+
static const uint8_t T10 = 10;
60+
static const uint8_t T11 = 11;
61+
static const uint8_t T12 = 12;
62+
static const uint8_t T13 = 13;
63+
static const uint8_t T14 = 14;
64+
65+
static const uint8_t DAC1 = 17;
66+
static const uint8_t DAC2 = 18;
67+
68+
#endif /* Pins_Arduino_h */
149 KB
Binary file not shown.

Diff for: variants/adafruit_feather_esp32s2_tft/bootloader.bin

400 Bytes
Binary file not shown.

Diff for: variants/adafruit_feather_esp32s2_tft/pins_arduino.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,16 @@
2626
#define NEOPIXEL_POWER 34 // power pin
2727
#define NEOPIXEL_POWER_ON HIGH // power pin state when on
2828

29-
#define TFT_CS 42
30-
#define TFT_RST 41
31-
#define TFT_DC 40
29+
#define TFT_I2C_POWER 21
30+
#define TFT_CS 7
31+
#define TFT_RST 40
32+
#define TFT_DC 39
3233
#define TFT_BACKLITE 45
3334

3435
static const uint8_t SDA = 42;
3536
static const uint8_t SCL = 41;
3637

37-
static const uint8_t SS = 21;
38+
static const uint8_t SS = 7;
3839
static const uint8_t MOSI = 35;
3940
static const uint8_t SCK = 36;
4041
static const uint8_t MISO = 37;

Diff for: variants/adafruit_feather_esp32s2_tft/tinyuf2.bin

-7.66 KB
Binary file not shown.

Diff for: variants/adafruit_qtpy_esp32s2/pins_arduino.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ static const uint8_t SCL1 = 40;
3434

3535
static const uint8_t SS = 42;
3636
static const uint8_t MOSI = 35;
37-
static const uint8_t SCK = 34;
38-
static const uint8_t MISO = 33;
37+
static const uint8_t SCK = 36;
38+
static const uint8_t MISO = 37;
3939

4040
static const uint8_t A0 = 18;
4141
static const uint8_t A1 = 17;
@@ -48,6 +48,8 @@ static const uint8_t A7 = 16;
4848

4949
static const uint8_t TX = 5;
5050
static const uint8_t RX = 16;
51+
#define TX1 TX
52+
#define RX1 RX
5153

5254
static const uint8_t T5 = 5;
5355
static const uint8_t T6 = 6;

0 commit comments

Comments
 (0)