|
37 | 37 | #include "soc/periph_defs.h"
|
38 | 38 | #include "soc/rtc_io_reg.h"
|
39 | 39 | #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 |
41 | 47 | #define USE_ESP_IDF_GPIO 1
|
42 | 48 | #endif
|
43 | 49 | #else // ESP32 Before IDF 4.0
|
@@ -143,6 +149,29 @@ const DRAM_ATTR esp32_gpioMux_t esp32_gpioMux[SOC_GPIO_PIN_COUNT]={
|
143 | 149 | {0xb8, -1, -1, -1},//SCL?
|
144 | 150 | {0xbc, -1, -1, -1},//INPUT ONLY
|
145 | 151 | {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 |
146 | 175 | #endif
|
147 | 176 | };
|
148 | 177 |
|
@@ -481,4 +510,3 @@ extern int digitalRead(uint8_t pin) __attribute__ ((weak, alias("__digitalRead")
|
481 | 510 | extern void attachInterrupt(uint8_t pin, voidFuncPtr handler, int mode) __attribute__ ((weak, alias("__attachInterrupt")));
|
482 | 511 | extern void attachInterruptArg(uint8_t pin, voidFuncPtrArg handler, void * arg, int mode) __attribute__ ((weak, alias("__attachInterruptArg")));
|
483 | 512 | extern void detachInterrupt(uint8_t pin) __attribute__ ((weak, alias("__detachInterrupt")));
|
484 |
| - |
|
0 commit comments