|
| 1 | +/* |
| 2 | + * This file is part of the MicroPython project, http://micropython.org/ |
| 3 | + * |
| 4 | + * The MIT License (MIT) |
| 5 | + * |
| 6 | + * Copyright (c) 2021 fonix232 |
| 7 | + * |
| 8 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 9 | + * of this software and associated documentation files (the "Software"), to deal |
| 10 | + * in the Software without restriction, including without limitation the rights |
| 11 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 12 | + * copies of the Software, and to permit persons to whom the Software is |
| 13 | + * furnished to do so, subject to the following conditions: |
| 14 | + * |
| 15 | + * The above copyright notice and this permission notice shall be included in |
| 16 | + * all copies or substantial portions of the Software. |
| 17 | + * |
| 18 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 20 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 21 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 22 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 23 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 24 | + * THE SOFTWARE. |
| 25 | + */ |
| 26 | + |
| 27 | +#include "supervisor/board.h" |
| 28 | + |
| 29 | +#include "mpconfigboard.h" |
| 30 | +#include "shared-bindings/busio/SPI.h" |
| 31 | +#include "shared-bindings/displayio/FourWire.h" |
| 32 | +#include "shared-bindings/microcontroller/Pin.h" |
| 33 | +#include "shared-module/displayio/__init__.h" |
| 34 | +#include "shared-bindings/board/__init__.h" |
| 35 | + |
| 36 | + |
| 37 | +const uint8_t display_start_sequence[] = { }; |
| 38 | + |
| 39 | +const uint8_t display_stop_sequence[] = { }; |
| 40 | + |
| 41 | +const uint8_t display_refresh_sequence[] = { }; |
| 42 | + |
| 43 | + |
| 44 | +void board_init(void) { |
| 45 | + |
| 46 | + // TODO: Investigate how to initialise display |
| 47 | + |
| 48 | + // // Set up the SPI object used to control the display |
| 49 | + // busio_spi_obj_t *spi = common_hal_board_create_spi(0); |
| 50 | + // common_hal_busio_spi_never_reset(spi); |
| 51 | + |
| 52 | + // // Set up the DisplayIO pin object |
| 53 | + // displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus; |
| 54 | + // bus->base.type = &displayio_fourwire_type; |
| 55 | + // common_hal_displayio_fourwire_construct(bus, |
| 56 | + // spi, |
| 57 | + // &pin_GPIO20, // EPD_DC Command or data |
| 58 | + // &pin_GPIO15, // EPD_CS Chip select |
| 59 | + // &pin_GPIO23, // EPD_RST Reset |
| 60 | + // 1200000, // Baudrate |
| 61 | + // 0, // Polarity |
| 62 | + // 0); // Phase |
| 63 | + |
| 64 | + // displayio_epaperdisplay_obj_t *display = &allocate_display()->epaper_display; |
| 65 | + // display->base.type = &displayio_epaperdisplay_type; |
| 66 | + |
| 67 | + // common_hal_displayio_epaperdisplay_construct( |
| 68 | + // display, |
| 69 | + // bus, |
| 70 | + // display_start_sequence, sizeof(display_start_sequence), |
| 71 | + // 1.0, // start up time |
| 72 | + // display_stop_sequence, sizeof(display_stop_sequence), |
| 73 | + // 540, // width |
| 74 | + // 960, // height |
| 75 | + // 540, // ram_width |
| 76 | + // 960, // ram_height |
| 77 | + // 0, // colstart |
| 78 | + // 0, // rowstart |
| 79 | + // 90, // rotation |
| 80 | + // NO_COMMAND, // set_column_window_command |
| 81 | + // NO_COMMAND, // set_row_window_command |
| 82 | + // NO_COMMAND, // set_current_column_command |
| 83 | + // NO_COMMAND, // set_current_row_command |
| 84 | + // NO_COMMAND, // write_black_ram_command |
| 85 | + // false, // black_bits_inverted |
| 86 | + // NO_COMMAND, // write_color_ram_command |
| 87 | + // false, // color_bits_inverted |
| 88 | + // 0x000000, // highlight_color |
| 89 | + // refresh_sequence, sizeof(refresh_sequence), |
| 90 | + // 28.0, // refresh_time |
| 91 | + // &pin_GPIO27, // busy_pin |
| 92 | + // false, // busy_state |
| 93 | + // 30.0, // seconds_per_frame |
| 94 | + // false, // always_toggle_chip_select |
| 95 | + // false, // grayscale |
| 96 | + // true, // acep |
| 97 | + // false, // two_byte_sequence_length |
| 98 | + // false // address_little_endian |
| 99 | + // ); |
| 100 | +} |
0 commit comments