Thanks to visit codestin.com
Credit goes to github.com

Skip to content

esp32 s2/s3 port pin definition updates #8542

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ports/esp32/machine_pin.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,19 @@ STATIC const machine_pin_obj_t machine_pin_obj[] = {
{{NULL}, -1}, // 30 FLASH/PSRAM
{{NULL}, -1}, // 31 FLASH/PSRAM
{{NULL}, -1}, // 32 FLASH/PSRAM
#if CONFIG_SPIRAM_MODE_OCT
{{NULL}, -1}, // 33 FLASH/PSRAM
{{NULL}, -1}, // 34 FLASH/PSRAM
{{NULL}, -1}, // 35 FLASH/PSRAM
{{NULL}, -1}, // 36 FLASH/PSRAM
{{NULL}, -1}, // 37 FLASH/PSRAM
#else
{{&machine_pin_type}, GPIO_NUM_33},
{{&machine_pin_type}, GPIO_NUM_34},
{{&machine_pin_type}, GPIO_NUM_35},
{{&machine_pin_type}, GPIO_NUM_36},
{{&machine_pin_type}, GPIO_NUM_37},
#endif
{{&machine_pin_type}, GPIO_NUM_38},
{{&machine_pin_type}, GPIO_NUM_39}, // MTCLK
{{&machine_pin_type}, GPIO_NUM_40}, // MTDO
Expand Down Expand Up @@ -658,11 +666,19 @@ STATIC const machine_pin_irq_obj_t machine_pin_irq_object[] = {
{{NULL}, -1}, // 30 FLASH/PSRAM
{{NULL}, -1}, // 31 FLASH/PSRAM
{{NULL}, -1}, // 32 FLASH/PSRAM
#if CONFIG_SPIRAM_MODE_OCT
{{NULL}, -1}, // 33 FLASH/PSRAM
{{NULL}, -1}, // 34 FLASH/PSRAM
{{NULL}, -1}, // 35 FLASH/PSRAM
{{NULL}, -1}, // 36 FLASH/PSRAM
{{NULL}, -1}, // 37 FLASH/PSRAM
#else
{{&machine_pin_irq_type}, GPIO_NUM_33},
{{&machine_pin_irq_type}, GPIO_NUM_34},
{{&machine_pin_irq_type}, GPIO_NUM_35},
{{&machine_pin_irq_type}, GPIO_NUM_36},
{{&machine_pin_irq_type}, GPIO_NUM_37},
#endif
{{&machine_pin_irq_type}, GPIO_NUM_38},
{{&machine_pin_irq_type}, GPIO_NUM_39},
{{&machine_pin_irq_type}, GPIO_NUM_40},
Expand Down
37 changes: 35 additions & 2 deletions ports/esp32/modesp32.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
#ifndef MICROPY_INCLUDED_ESP32_MODESP32_H
#define MICROPY_INCLUDED_ESP32_MODESP32_H

#define RTC_VALID_EXT_PINS \
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3

#define RTC_VALID_EXT_PINS \
( \
(1ll << 0) | \
(1ll << 1) | \
(1ll << 2) | \
(1ll << 3) | \
(1ll << 4) | \
(1ll << 5) | \
(1ll << 6) | \
(1ll << 7) | \
(1ll << 8) | \
(1ll << 9) | \
(1ll << 10) | \
(1ll << 11) | \
(1ll << 12) | \
(1ll << 13) | \
(1ll << 14) | \
(1ll << 15) | \
(1ll << 16) | \
(1ll << 17) | \
(1ll << 18) | \
(1ll << 19) | \
(1ll << 20) | \
(1ll << 21) \
)
#define RTC_LAST_EXT_PIN 21

#else

#define RTC_VALID_EXT_PINS \
( \
(1ll << 0) | \
(1ll << 2) | \
Expand All @@ -22,8 +53,10 @@
(1ll << 38) | \
(1ll << 39) \
)
#define RTC_LAST_EXT_PIN 39

#endif

#define RTC_LAST_EXT_PIN 39
#define RTC_IS_VALID_EXT_PIN(pin_id) ((1ll << (pin_id)) & RTC_VALID_EXT_PINS)

extern int8_t esp32_rmt_bitstream_channel_id;
Expand Down