Skip to content

Commit ab9cef7

Browse files
authored
Merge pull request #5779 from dhalbert/feather-esp32-s2-turn-on-i2c-power-by-default
Feather ESP32-S2: turn on I2C power after reset
2 parents 78637e0 + cf70a9c commit ab9cef7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ports/espressif/boards/adafruit_feather_esp32s2/board.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "supervisor/board.h"
2828
#include "mpconfigboard.h"
2929
#include "shared-bindings/microcontroller/Pin.h"
30+
#include "components/driver/include/driver/gpio.h"
3031

3132
void board_init(void) {
3233
// USB
@@ -39,7 +40,9 @@ bool board_requests_safe_mode(void) {
3940
}
4041

4142
void reset_board(void) {
42-
43+
// Turn on I2C power by default.
44+
gpio_set_direction(7, GPIO_MODE_DEF_OUTPUT);
45+
gpio_set_level(7, false);
4346
}
4447

4548
void board_deinit(void) {

ports/espressif/boards/adafruit_feather_esp32s2/pins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
1414
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) },
1515
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) },
1616

17-
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) },
1817
{ MP_ROM_QSTR(MP_QSTR_I2C_POWER_INVERTED), MP_ROM_PTR(&pin_GPIO7) },
18+
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) },
1919

2020
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO8) },
2121
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) },

0 commit comments

Comments
 (0)