|
31 | 31 | #include "shared-bindings/displayio/FourWire.h"
|
32 | 32 | #include "shared-module/displayio/__init__.h"
|
33 | 33 | #include "shared-module/displayio/mipi_constants.h"
|
| 34 | +#include "shared-bindings/digitalio/DigitalInOut.h" |
34 | 35 |
|
35 | 36 | 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; |
36 | 40 |
|
37 | 41 | uint8_t display_init_sequence[] = {
|
38 | 42 | 0x01, 0x80, 0x80, // Software reset then delay 0x80 (128ms)
|
@@ -106,6 +110,25 @@ void board_init(void) {
|
106 | 110 | true, // auto_refresh
|
107 | 111 | 60, // native_frames_per_second
|
108 | 112 | 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 | + |
109 | 132 | }
|
110 | 133 |
|
111 | 134 | bool board_requests_safe_mode(void) {
|
|
0 commit comments