From c17f147be95e7490e5207c747add2da1cc8b167f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 6 Feb 2019 12:13:17 -0800 Subject: A variety of displayio improvements This changes a number of things in displayio: * Introduces BuiltinFont and Glyph so the built in font can be used by libraries. For boards with a font it is available as board.TERMINAL_FONT. Fixes #1172 * Remove _load_row from Bitmap in favor of bitmap[] access. Index can be x/y tuple or overall index. Fixes #1191 * Add width and height properties to Bitmap. * Add insert and [] access to Group. Fixes #1518 * Add index param to pop on Group. * Terminal no longer takes unicode character info. It takes a BuiltinFont instead. * Fix Terminal's handling of [###D vt100 commands used when up arrowing into repl history. * Add x and y positions to Group plus scale as well. * Add bitmap accessor for BuiltinFont --- ports/atmel-samd/Makefile | 2 ++ ports/atmel-samd/boards/grandcentral_m4_express/pins.c | 3 +++ ports/nrf/Makefile | 2 ++ 3 files changed, 7 insertions(+) (limited to 'ports') diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 56c31e5d8..56a858177 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -366,6 +366,7 @@ SRC_BINDINGS_ENUMS = \ digitalio/Direction.c \ digitalio/DriveMode.c \ digitalio/Pull.c \ + displayio/Glyph.c \ microcontroller/RunMode.c \ help.c \ math/__init__.c \ @@ -381,6 +382,7 @@ SRC_SHARED_MODULE = \ busio/OneWire.c \ displayio/__init__.c \ displayio/Bitmap.c \ + displayio/BuiltinFont.c \ displayio/ColorConverter.c \ displayio/Display.c \ displayio/FourWire.c \ diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/pins.c b/ports/atmel-samd/boards/grandcentral_m4_express/pins.c index 26d0e71a0..167d3ee58 100644 --- a/ports/atmel-samd/boards/grandcentral_m4_express/pins.c +++ b/ports/atmel-samd/boards/grandcentral_m4_express/pins.c @@ -1,6 +1,7 @@ #include "shared-bindings/board/__init__.h" #include "supervisor/shared/board_busses.h" +#include "supervisor/shared/display.h" // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from @@ -131,5 +132,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + + { MP_ROM_QSTR(MP_QSTR_TERMINAL_FONT), MP_ROM_PTR(&supervisor_terminal_font) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index f4de71db7..ac7024e82 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -195,6 +195,7 @@ SRC_BINDINGS_ENUMS = \ digitalio/Direction.c \ digitalio/DriveMode.c \ digitalio/Pull.c \ + displayio/Glyph.c \ microcontroller/RunMode.c \ help.c \ math/__init__.c \ @@ -221,6 +222,7 @@ SRC_SHARED_MODULE = \ busio/OneWire.c \ displayio/__init__.c \ displayio/Bitmap.c \ + displayio/BuiltinFont.c \ displayio/ColorConverter.c \ displayio/Display.c \ displayio/FourWire.c \ -- cgit v1.2.3