Skip to content

Commit aaa2be1

Browse files
committed
Set the default pin state for GPIOs to pull down.
1 parent 5a053f9 commit aaa2be1

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

ports/espressif/boards/cytron_maker_feather_aiot_s3/board.c

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,47 @@ void board_init(void) {
3535
reset_board();
3636
}
3737

38+
bool espressif_board_reset_pin_number(gpio_num_t pin_number) {
39+
// For GPIOs used in Maker Feather AIoT S3, set the default state to pull down
40+
// as most of them are connected to active high LED.
41+
switch (pin_number) {
42+
case 4:
43+
case 5:
44+
case 6:
45+
case 7:
46+
case 8:
47+
case 9:
48+
case 10:
49+
case 12:
50+
case 14:
51+
case 15:
52+
case 16:
53+
case 17:
54+
case 18:
55+
case 21:
56+
case 38:
57+
case 39:
58+
case 40:
59+
case 41:
60+
case 42:
61+
case 47:
62+
case 48:
63+
gpio_reset_pin(pin_number);
64+
gpio_pullup_dis(pin_number);
65+
gpio_pulldown_en(pin_number);
66+
return true;
67+
68+
// Do not pull up/down as this is the battery voltage monitoring pin.
69+
case 13:
70+
gpio_reset_pin(pin_number);
71+
gpio_pullup_dis(pin_number);
72+
gpio_pulldown_dis(pin_number);
73+
return true;
74+
}
75+
76+
return false;
77+
}
78+
3879
void reset_board(void) {
3980
// Turn on VP by default.
4081
gpio_set_direction(11, GPIO_MODE_DEF_OUTPUT);

ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#define MICROPY_HW_MCU_NAME "ESP32S3"
3131

3232
#define MICROPY_HW_NEOPIXEL (&pin_GPIO46)
33+
#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO11)
3334

3435
#define MICROPY_HW_LED_STATUS (&pin_GPIO2)
3536

0 commit comments

Comments
 (0)