esp32: Extend support for S2 series, and S3 where applicable.
Improvements made: - PSRAM support for S2 - partition definition for 16MiB flash - correct ADC and DAC pins - correct GPIO and IRQ pins - S3 components in CMakeLists Based on original commit made by Seon Rozenblum aka @UnexpectedMaker. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -31,7 +31,11 @@
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
|
||||
#include "driver/gpio.h"
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#include "driver/touch_pad.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
|
||||
#include "driver/touch_sensor.h"
|
||||
#endif
|
||||
|
||||
typedef struct _mtp_obj_t {
|
||||
mp_obj_base_t base;
|
||||
@@ -39,6 +43,7 @@ typedef struct _mtp_obj_t {
|
||||
touch_pad_t touchpad_id;
|
||||
} mtp_obj_t;
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
STATIC const mtp_obj_t touchpad_obj[] = {
|
||||
{{&machine_touchpad_type}, GPIO_NUM_4, TOUCH_PAD_NUM0},
|
||||
{{&machine_touchpad_type}, GPIO_NUM_0, TOUCH_PAD_NUM1},
|
||||
@@ -51,6 +56,24 @@ STATIC const mtp_obj_t touchpad_obj[] = {
|
||||
{{&machine_touchpad_type}, GPIO_NUM_33, TOUCH_PAD_NUM8},
|
||||
{{&machine_touchpad_type}, GPIO_NUM_32, TOUCH_PAD_NUM9},
|
||||
};
|
||||
#elif CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
|
||||
STATIC const mtp_obj_t touchpad_obj[] = {
|
||||
{{&machine_touchpad_type}, GPIO_NUM_1, TOUCH_PAD_NUM1},
|
||||
{{&machine_touchpad_type}, GPIO_NUM_2, TOUCH_PAD_NUM2},
|
||||
{{&machine_touchpad_type}, GPIO_NUM_3, TOUCH_PAD_NUM3},
|
||||
{{&machine_touchpad_type}, GPIO_NUM_4, TOUCH_PAD_NUM4},
|
||||
{{&machine_touchpad_type}, GPIO_NUM_5, TOUCH_PAD_NUM5},
|
||||
{{&machine_touchpad_type}, GPIO_NUM_6, TOUCH_PAD_NUM6},
|
||||
{{&machine_touchpad_type}, GPIO_NUM_7, TOUCH_PAD_NUM7},
|
||||
{{&machine_touchpad_type}, GPIO_NUM_8, TOUCH_PAD_NUM8},
|
||||
{{&machine_touchpad_type}, GPIO_NUM_9, TOUCH_PAD_NUM9},
|
||||
{{&machine_touchpad_type}, GPIO_NUM_10, TOUCH_PAD_NUM10},
|
||||
{{&machine_touchpad_type}, GPIO_NUM_11, TOUCH_PAD_NUM11},
|
||||
{{&machine_touchpad_type}, GPIO_NUM_12, TOUCH_PAD_NUM12},
|
||||
{{&machine_touchpad_type}, GPIO_NUM_13, TOUCH_PAD_NUM13},
|
||||
{{&machine_touchpad_type}, GPIO_NUM_14, TOUCH_PAD_NUM14},
|
||||
};
|
||||
#endif
|
||||
|
||||
STATIC mp_obj_t mtp_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw,
|
||||
const mp_obj_t *args) {
|
||||
|
||||
Reference in New Issue
Block a user