Skip to content

Commit

Permalink
Merge pull request #5779 from dhalbert/feather-esp32-s2-turn-on-i2c-p…
Browse files Browse the repository at this point in the history
…ower-by-default

Feather ESP32-S2: turn on I2C power after reset
  • Loading branch information
dhalbert authored Dec 24, 2021
2 parents 78637e0 + cf70a9c commit ab9cef7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ports/espressif/boards/adafruit_feather_esp32s2/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "shared-bindings/microcontroller/Pin.h"
#include "components/driver/include/driver/gpio.h"

void board_init(void) {
// USB
Expand All @@ -39,7 +40,9 @@ bool board_requests_safe_mode(void) {
}

void reset_board(void) {

// Turn on I2C power by default.
gpio_set_direction(7, GPIO_MODE_DEF_OUTPUT);
gpio_set_level(7, false);
}

void board_deinit(void) {
Expand Down
2 changes: 1 addition & 1 deletion ports/espressif/boards/adafruit_feather_esp32s2/pins.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) },

{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_I2C_POWER_INVERTED), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) },

{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) },
Expand Down

0 comments on commit ab9cef7

Please sign in to comment.