3333#include "shared-module/displayio/__init__.h"
3434#include "shared-bindings/board/__init__.h"
3535#include "supervisor/shared/board.h"
36+ #include "inky-shared.h"
3637
3738#define DELAY 0x80
3839
40+ digitalio_digitalinout_obj_t enable_pin_obj ;
41+
3942// This is an SPD1656 control chip. The display is a 5.7" ACeP EInk.
4043
4144const uint8_t display_start_sequence [] = {
4245 0x01 , 4 , 0x37 , 0x00 , 0x23 , 0x23 , // power setting
43- 0x00 , 2 , 0xef , 0x08 , // panel setting (PSR)
46+ 0x00 , 2 , 0xe3 , 0x08 , // panel setting (PSR, 0xe3: no rotation )
4447 0x03 , 1 , 0x00 , // PFS
4548 0x06 , 3 , 0xc7 , 0xc7 , 0x1d , // booster
4649 0x30 , 1 , 0x3c , // PLL setting
@@ -62,6 +65,14 @@ const uint8_t refresh_sequence[] = {
6265};
6366
6467void board_init (void ) {
68+ // Drive the EN_3V3 pin high so the board stays awake on battery power
69+ enable_pin_obj .base .type = & digitalio_digitalinout_type ;
70+ common_hal_digitalio_digitalinout_construct (& enable_pin_obj , & pin_GPIO2 );
71+ common_hal_digitalio_digitalinout_switch_to_output (& enable_pin_obj , true, DRIVE_MODE_PUSH_PULL );
72+
73+ // Never reset
74+ common_hal_digitalio_digitalinout_never_reset (& enable_pin_obj );
75+
6576 displayio_fourwire_obj_t * bus = & allocate_display_bus ()-> fourwire_bus ;
6677 busio_spi_obj_t * spi = common_hal_board_create_spi (0 );
6778
@@ -89,7 +100,7 @@ void board_init(void) {
89100 480 , // ram_height
90101 0 , // colstart
91102 0 , // rowstart
92- 180 , // rotation
103+ 0 , // rotation
93104 NO_COMMAND , // set_column_window_command
94105 NO_COMMAND , // set_row_window_command
95106 NO_COMMAND , // set_current_column_command
0 commit comments