Skip to content

Commit 6bfcb01

Browse files
authored
Merge pull request adafruit#3478 from ansonhe97/main
Turn Default power on Wio Terminal's 40 Pin
2 parents 785f2be + 96323ac commit 6bfcb01

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

ports/atmel-samd/boards/seeeduino_wio_terminal/board.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@
3131
#include "shared-bindings/displayio/FourWire.h"
3232
#include "shared-module/displayio/__init__.h"
3333
#include "shared-module/displayio/mipi_constants.h"
34+
#include "shared-bindings/digitalio/DigitalInOut.h"
3435

3536
displayio_fourwire_obj_t board_display_obj;
37+
digitalio_digitalinout_obj_t CTR_5V;
38+
digitalio_digitalinout_obj_t CTR_3V3;
39+
digitalio_digitalinout_obj_t USB_HOST_ENABLE;
3640

3741
uint8_t display_init_sequence[] = {
3842
0x01, 0x80, 0x80, // Software reset then delay 0x80 (128ms)
@@ -106,6 +110,25 @@ void board_init(void) {
106110
true, // auto_refresh
107111
60, // native_frames_per_second
108112
true); // backlight_on_high
113+
114+
// Enabling the Power of the 40-pin at the back
115+
CTR_5V.base.type = &digitalio_digitalinout_type;
116+
CTR_3V3.base.type = &digitalio_digitalinout_type;
117+
USB_HOST_ENABLE.base.type = &digitalio_digitalinout_type;
118+
119+
common_hal_digitalio_digitalinout_construct(&CTR_5V, PIN_CTR_5V);
120+
common_hal_digitalio_digitalinout_construct(&CTR_3V3, PIN_CTR_3V3);
121+
common_hal_digitalio_digitalinout_construct(&USB_HOST_ENABLE, PIN_USB_HOST_ENABLE);
122+
123+
common_hal_digitalio_digitalinout_set_value(&CTR_5V, true);
124+
common_hal_digitalio_digitalinout_set_value(&CTR_3V3, false);
125+
common_hal_digitalio_digitalinout_set_value(&USB_HOST_ENABLE, false);
126+
127+
// Never reset
128+
common_hal_digitalio_digitalinout_never_reset(&CTR_5V);
129+
common_hal_digitalio_digitalinout_never_reset(&CTR_3V3);
130+
common_hal_digitalio_digitalinout_never_reset(&USB_HOST_ENABLE);
131+
109132
}
110133

111134
bool board_requests_safe_mode(void) {

ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
#define DEFAULT_UART_BUS_RX (&pin_PB27)
2828
#define DEFAULT_UART_BUS_TX (&pin_PB26)
2929

30+
#define PIN_CTR_5V (&pin_PC14)
31+
#define PIN_CTR_3V3 (&pin_PC15)
32+
#define PIN_USB_HOST_ENABLE (&pin_PA27)
33+
3034
// USB is always used internally so skip the pin objects for it.
3135
#define IGNORE_PIN_PA24 1
3236
#define IGNORE_PIN_PA25 1

0 commit comments

Comments
 (0)