├── .gitignore ├── LICENSE ├── README.md ├── VERSION ├── docs ├── astrol.svg ├── cyrilc.svg ├── gotheng.svg ├── gothger.svg ├── gothita.svg ├── greekc.svg ├── greekcs.svg ├── greekp.svg ├── greeks.svg ├── italicc.svg ├── italiccs.svg ├── italict.svg ├── japan.svg ├── lowmat.svg ├── m5stack_hello.jpg ├── marker.svg ├── meteo.svg ├── misc.svg ├── music.svg ├── romanc.svg ├── romancs.svg ├── romand.svg ├── romanp.svg ├── romans.svg ├── romant.svg ├── scriptc.svg ├── scripts.svg ├── symbol.svg ├── uppmat.svg ├── vga1_16x16.png ├── vga1_16x32.png ├── vga1_8x16.png ├── vga1_8x8.png ├── vga1_bold_16x16.png ├── vga1_bold_16x32.png ├── vga2_16x16.png ├── vga2_16x32.png ├── vga2_8x16.png ├── vga2_8x8.png ├── vga2_bold_16x16.png └── vga2_bold_16x32.png ├── examples ├── M5CORE2 │ ├── bbbunny │ │ ├── bbbunny.py │ │ └── bigbuckbunny.jpg │ ├── buttons.py │ ├── fonts.py │ ├── hello.py │ ├── hershey.py │ ├── mono_fonts │ │ ├── inconsolata_16.py │ │ ├── inconsolata_32.py │ │ ├── inconsolata_64.py │ │ └── mono_fonts.py │ ├── noto_fonts.py │ ├── paint.py │ ├── prop_fonts │ │ ├── chango.py │ │ ├── chango_16.py │ │ ├── chango_32.py │ │ └── chango_64.py │ ├── scroll.py │ ├── tbbunny.py │ └── toasters │ │ ├── t1.py │ │ ├── t2.py │ │ ├── t3.py │ │ ├── t4.py │ │ ├── t5.py │ │ └── toasters.py └── M5STACK │ ├── bbbunny │ ├── bbbunny.py │ └── bigbuckbunny.jpg │ ├── bitarray.py │ ├── fonts.py │ ├── hello.py │ ├── hershey.py │ ├── mono_fonts │ ├── inconsolata_16.py │ ├── inconsolata_32.py │ ├── inconsolata_64.py │ └── mono_fonts.py │ ├── noto_fonts.py │ ├── prop_fonts │ ├── chango.py │ ├── chango_16.py │ ├── chango_32.py │ └── chango_64.py │ ├── rot.py │ ├── scroll.py │ └── toasters │ ├── t1.py │ ├── t2.py │ ├── t3.py │ ├── t4.py │ ├── t5.py │ └── toasters.py ├── firmware ├── GENERIC-ili9342 │ └── firmware.bin ├── GENERIC_SPIRAM-ili9342 │ └── firmware.bin ├── LICENSE ├── M5CORE2 │ └── firmware.bin ├── M5STACK_16M │ └── firmware.bin └── M5STACK_4M │ └── firmware.bin ├── fonts ├── bitmap │ ├── README.md │ ├── vga1_16x16.py │ ├── vga1_16x32.py │ ├── vga1_8x16.py │ ├── vga1_8x8.py │ ├── vga1_bold_16x16.py │ ├── vga1_bold_16x32.py │ ├── vga2_16x16.py │ ├── vga2_16x32.py │ ├── vga2_8x16.py │ ├── vga2_8x8.py │ ├── vga2_bold_16x16.py │ └── vga2_bold_16x32.py ├── truetype │ ├── Chango-OFL.txt │ ├── Chango-Regular.ttf │ ├── LibreFranklin-OFL.txt │ ├── LibreFranklin.ttf │ ├── README.md │ ├── inconsolata-700.ttf │ └── inconsolata-OFL.txt └── vector │ ├── README.md │ ├── astrol.py │ ├── cyrilc.py │ ├── gotheng.py │ ├── gothger.py │ ├── gothita.py │ ├── greekc.py │ ├── greekcs.py │ ├── greekp.py │ ├── greeks.py │ ├── italicc.py │ ├── italiccs.py │ ├── italict.py │ ├── lowmat.py │ ├── marker.py │ ├── meteo.py │ ├── music.py │ ├── romanc.py │ ├── romancs.py │ ├── romand.py │ ├── romanp.py │ ├── romans.py │ ├── romant.py │ ├── scriptc.py │ ├── scripts.py │ ├── symbol.py │ └── uppmat.py ├── lib ├── axp202c.py ├── focaltouch.py └── sdcard.py ├── manifest.py ├── modules ├── NotoSansMono_32.py ├── NotoSans_32.py ├── NotoSerif_32.py ├── axp202c.py ├── df.py ├── focaltouch.py ├── gotheng.py ├── greekc.py ├── greekcs.py ├── greekp.py ├── greeks.py ├── inconsolata_16.py ├── inconsolata_32.py ├── italicc.py ├── italiccs.py ├── italict.py ├── marker.py ├── meteo.py ├── mf.py ├── music.py ├── romanc.py ├── romancs.py ├── romand.py ├── romanp.py ├── romans.py ├── romant.py ├── scriptc.py ├── scripts.py ├── sdcard.py ├── symbol.py ├── vga1_16x16.py ├── vga1_16x32.py ├── vga1_8x16.py ├── vga1_8x8.py ├── vga1_bold_16x16.py ├── vga1_bold_16x32.py ├── vga2_16x16.py ├── vga2_8x16.py ├── vga2_8x8.py ├── vga2_bold_16x16.py └── vga2_bold_16x32.py ├── src ├── .clang-format ├── ili9342c.c ├── ili9342c.h ├── micropython.cmake ├── micropython.mk ├── mpfile.c ├── mpfile.h ├── tjpgd565.c └── tjpgd565.h └── utils ├── font2bitmap.py ├── font_from_romfont.py ├── imgtobitmap.py ├── maketoast ├── monofont2bitmap.py ├── png_from_font.py ├── requirements.txt ├── t1.png ├── t2.png ├── t3.png ├── t4.png ├── t5.png └── toasters.bmp /.gitignore: -------------------------------------------------------------------------------- 1 | # General 2 | .DS_Store 3 | .AppleDouble 4 | .LSOverride 5 | 6 | # Icon must end with two \r 7 | Icon 8 | 9 | # Thumbnails 10 | ._* 11 | 12 | # Files that might appear in the root of a volume 13 | .DocumentRevisions-V100 14 | .fseventsd 15 | .Spotlight-V100 16 | .TemporaryItems 17 | .Trashes 18 | .VolumeIcon.icns 19 | .com.apple.timemachine.donotpresent 20 | 21 | # Directories potentially created on remote AFP share 22 | .AppleDB 23 | .AppleDesktop 24 | Network Trash Folder 25 | Temporary Items 26 | .apdisk 27 | 28 | .vscode 29 | .idea 30 | __pycache__ 31 | sphinx/build 32 | *~ 33 | *.pyc 34 | *.o 35 | *.P 36 | upload.mpf 37 | .history 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2020-2024 Russ Hughes 3 | 4 | These files incorporate work covered by the following copyright and 5 | permission notice and are licensed under the same terms: 6 | 7 | The MIT License (MIT) 8 | 9 | Copyright (c) 2019 Ivan Belokobylskiy 10 | 11 | Permission is hereby granted, free of charge, to any person obtaining a copy 12 | of this software and associated documentation files (the "Software"), to deal 13 | in the Software without restriction, including without limitation the rights 14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | copies of the Software, and to permit persons to whom the Software is 16 | furnished to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in 19 | all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | THE SOFTWARE. 28 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 0.0.4 2 | -------------------------------------------------------------------------------- /docs/m5stack_hello.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/docs/m5stack_hello.jpg -------------------------------------------------------------------------------- /docs/vga1_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/docs/vga1_16x16.png -------------------------------------------------------------------------------- /docs/vga1_16x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/docs/vga1_16x32.png -------------------------------------------------------------------------------- /docs/vga1_8x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/docs/vga1_8x16.png -------------------------------------------------------------------------------- /docs/vga1_8x8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/docs/vga1_8x8.png -------------------------------------------------------------------------------- /docs/vga1_bold_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/docs/vga1_bold_16x16.png -------------------------------------------------------------------------------- /docs/vga1_bold_16x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/docs/vga1_bold_16x32.png -------------------------------------------------------------------------------- /docs/vga2_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/docs/vga2_16x16.png -------------------------------------------------------------------------------- /docs/vga2_16x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/docs/vga2_16x32.png -------------------------------------------------------------------------------- /docs/vga2_8x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/docs/vga2_8x16.png -------------------------------------------------------------------------------- /docs/vga2_8x8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/docs/vga2_8x8.png -------------------------------------------------------------------------------- /docs/vga2_bold_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/docs/vga2_bold_16x16.png -------------------------------------------------------------------------------- /docs/vga2_bold_16x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/docs/vga2_bold_16x32.png -------------------------------------------------------------------------------- /examples/M5CORE2/bbbunny/bbbunny.py: -------------------------------------------------------------------------------- 1 | ''' 2 | bbbunny.py 3 | 4 | Draw a full screen jpg using the slower but less memory intensive method 5 | of blitting each Minimum Coded Unit (MCU) block. Usually 8×8pixels but can 6 | be other multiples of 8. 7 | 8 | bigbuckbunny.jpg (c)copyright 2008, Blender Foundation/www.bigbuckbunny.org 9 | ''' 10 | 11 | import gc 12 | import random 13 | import time 14 | 15 | import ili9342c 16 | from machine import SPI, Pin 17 | import axp202c 18 | 19 | gc.enable() 20 | gc.collect() 21 | 22 | 23 | def main(): 24 | ''' 25 | Decode and draw the jpg on the display 26 | ''' 27 | try: 28 | # Turn display power 29 | axp = axp202c.PMU(address=0x34) 30 | axp.enablePower(axp202c.AXP192_LDO2) 31 | # Set backlight voltage 32 | axp.setDC3Voltage(3000) 33 | 34 | spi = SPI( 35 | 2, 36 | baudrate=60000000, 37 | sck=Pin(18), 38 | mosi=Pin(23)) 39 | 40 | # initialize display 41 | tft = ili9342c.ILI9342C( 42 | spi, 43 | 320, 44 | 240, 45 | reset=Pin(33, Pin.OUT), 46 | cs=Pin(5, Pin.OUT), 47 | dc=Pin(15, Pin.OUT), 48 | rotation=0) 49 | 50 | # enable display and clear screen 51 | tft.init() 52 | 53 | # display jpg 54 | tft.jpg("bigbuckbunny.jpg", 0, 0, ili9342c.SLOW) 55 | 56 | finally: 57 | # shutdown spi 58 | if 'spi' in locals(): 59 | spi.deinit() 60 | 61 | 62 | main() 63 | -------------------------------------------------------------------------------- /examples/M5CORE2/bbbunny/bigbuckbunny.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/examples/M5CORE2/bbbunny/bigbuckbunny.jpg -------------------------------------------------------------------------------- /examples/M5CORE2/buttons.py: -------------------------------------------------------------------------------- 1 | ''' 2 | buttons.py 3 | 4 | A button press program for the M5CORE2 using the adafruit_focaltouh 5 | driver modified for micropython by franz schaefer from 6 | https://gitlab.com/mooond/t-watch2020-esp32-with-micropython 7 | 8 | I modied the axp202c driver to accept an initalized i2c object so it can 9 | be shared with the focaltouch driver. See the lib directory for source. 10 | ''' 11 | 12 | from machine import Pin, SPI, SoftI2C 13 | import utime 14 | import axp202c 15 | import ili9342c 16 | 17 | import focaltouch 18 | import vga1_16x16 as font 19 | 20 | # button locations: 21 | # [Name, col, row, width, height] 22 | BtnA = ['A', 3, 240, 102, 40] 23 | BtnB = ['B', 109, 240, 102, 40] 24 | BtnC = ['C', 215, 240, 102, 40] 25 | buttons = [BtnA, BtnB, BtnC] 26 | 27 | 28 | def button_pressed(touch): 29 | ''' 30 | returns name of button touched or None if touch is outside of buttons 31 | ''' 32 | for btn in buttons: 33 | if (btn[1] <= touch.touches[0]['x'] <= btn[1] + btn[3] 34 | and btn[2] <= touch.touches[0]['y'] <= btn[2] + btn[4]): 35 | return btn[0] 36 | 37 | return None 38 | 39 | 40 | def main(): 41 | ''' 42 | buttons using focaltouch sensor 43 | ''' 44 | try: 45 | i2c = SoftI2C(scl=Pin(22), sda=Pin(21)) 46 | # Turn display power 47 | axp = axp202c.PMU(i2c=i2c, address=0x34) 48 | axp.enablePower(axp202c.AXP192_LDO2) 49 | # Set backlight voltage 50 | axp.setDC3Voltage(3000) 51 | 52 | spi = SPI( 53 | 2, 54 | baudrate=60000000, 55 | sck=Pin(18), 56 | mosi=Pin(23)) 57 | 58 | # initialize display 59 | tft = ili9342c.ILI9342C( 60 | spi, 61 | 320, 62 | 240, 63 | reset=Pin(33, Pin.OUT), 64 | cs=Pin(5, Pin.OUT), 65 | dc=Pin(15, Pin.OUT), 66 | rotation=0) 67 | 68 | # enable display and clear screen 69 | tft.init() 70 | tft.fill(ili9342c.BLUE) 71 | 72 | # enable focaltouch touchscreen 73 | touch = focaltouch.FocalTouch(i2c) 74 | 75 | last = None 76 | while True: 77 | # can be up to two touches, just checking first. 78 | if touch.touched == 1: 79 | pressed = button_pressed(touch) 80 | # button was pressed 81 | if pressed is not None: 82 | button = pressed 83 | # Check if button was held or new press 84 | if (last == button): 85 | # update display button still pressed 86 | tft.text( 87 | font, 88 | "Button {} Held ".format(button), 89 | 32, 90 | 120, 91 | ili9342c.WHITE, 92 | ili9342c.BLUE) 93 | else: 94 | # update display with new press 95 | tft.text( 96 | font, 97 | "Button {} Pressed".format(button), 98 | 32, 99 | 120, 100 | ili9342c.WHITE, 101 | ili9342c.BLUE) 102 | 103 | # wait half second for debounce 104 | utime.sleep_ms(500) 105 | # save last button pressed 106 | last = button 107 | else: 108 | # press was outside of button areas 109 | button = None 110 | else: 111 | # no touch detected 112 | last = None 113 | 114 | finally: 115 | # shutdown 116 | spi.deinit() 117 | 118 | 119 | main() 120 | -------------------------------------------------------------------------------- /examples/M5CORE2/fonts.py: -------------------------------------------------------------------------------- 1 | """ 2 | fonts.py 3 | 4 | Pages through all characters of four fonts on the M5Stack Display. 5 | 6 | """ 7 | import utime 8 | import random 9 | from machine import Pin, SPI 10 | import ili9342c 11 | import axp202c 12 | 13 | import vga1_8x8 as font1 14 | import vga1_8x16 as font2 15 | import vga1_bold_16x16 as font3 16 | import vga1_bold_16x32 as font4 17 | 18 | def main(): 19 | # Turn display power 20 | axp = axp202c.PMU(address=0x34) 21 | axp.enablePower(axp202c.AXP192_LDO2) 22 | # Set backlight voltage 23 | axp.setDC3Voltage(3000) 24 | 25 | spi = SPI( 26 | 2, 27 | baudrate=60000000, 28 | sck=Pin(18), 29 | mosi=Pin(23)) 30 | 31 | # initialize display 32 | 33 | tft = ili9342c.ILI9342C( 34 | spi, 35 | 320, 36 | 240, 37 | reset=Pin(33, Pin.OUT), 38 | cs=Pin(5, Pin.OUT), 39 | dc=Pin(15, Pin.OUT), 40 | rotation=0) 41 | 42 | tft.init() 43 | tft.fill(ili9342c.BLACK) 44 | utime.sleep(1) 45 | 46 | while True: 47 | for font in (font1, font2, font3, font4): 48 | tft.fill(ili9342c.BLUE) 49 | line = 0 50 | col = 0 51 | for char in range(font.FIRST, font.LAST): 52 | tft.text( 53 | font, 54 | chr(char), 55 | col, 56 | line, 57 | ili9342c.WHITE, 58 | ili9342c.BLUE) 59 | 60 | col += font.WIDTH 61 | if col > tft.width() - font.WIDTH: 62 | col = 0 63 | line += font.HEIGHT 64 | 65 | if line > tft.height()-font.HEIGHT: 66 | utime.sleep(3) 67 | tft.fill(ili9342c.BLUE) 68 | line = 0 69 | col = 0 70 | 71 | utime.sleep(3) 72 | 73 | 74 | main() 75 | -------------------------------------------------------------------------------- /examples/M5CORE2/hello.py: -------------------------------------------------------------------------------- 1 | """ 2 | hello.py 3 | 4 | Writes "Hello!" in random colors at random locations on a 5 | M5Stack core display. 6 | 7 | """ 8 | import time 9 | import random 10 | from machine import Pin, SPI 11 | 12 | import ili9342c 13 | import vga1_bold_16x32 as font 14 | import axp202c 15 | 16 | 17 | def main(): 18 | # Turn display power 19 | axp = axp202c.PMU(address=0x34) 20 | axp.enablePower(axp202c.AXP192_LDO2) 21 | # Set backlight voltage 22 | axp.setDC3Voltage(3000) 23 | 24 | spi = SPI( 25 | 2, 26 | baudrate=60000000, 27 | sck=Pin(18), 28 | mosi=Pin(23)) 29 | 30 | # initialize display 31 | 32 | tft = ili9342c.ILI9342C( 33 | spi, 34 | 320, 35 | 240, 36 | reset=Pin(33, Pin.OUT), 37 | cs=Pin(5, Pin.OUT), 38 | dc=Pin(15, Pin.OUT), 39 | rotation=0) 40 | 41 | tft.init() 42 | tft.fill(ili9342c.BLACK) 43 | time.sleep(1) 44 | 45 | while True: 46 | for rotation in range(4): 47 | tft.rotation(rotation) 48 | tft.fill(0) 49 | col_max = tft.width() - font.WIDTH*6 50 | row_max = tft.height() - font.HEIGHT 51 | 52 | for _ in range(1000): 53 | tft.text( 54 | font, 55 | "Hello!", 56 | random.randint(0, col_max), 57 | random.randint(0, row_max), 58 | ili9342c.color565( 59 | random.getrandbits(8), 60 | random.getrandbits(8), 61 | random.getrandbits(8)), 62 | ili9342c.color565( 63 | random.getrandbits(8), 64 | random.getrandbits(8), 65 | random.getrandbits(8)) 66 | ) 67 | 68 | main() 69 | -------------------------------------------------------------------------------- /examples/M5CORE2/hershey.py: -------------------------------------------------------------------------------- 1 | ''' 2 | hershey.py 3 | 4 | Draw greetings on display cycling thru hershey fonts and colors 5 | ''' 6 | 7 | import utime 8 | from machine import SPI, Pin 9 | import ili9342c 10 | import axp202c 11 | 12 | # Load several frozen fonts from flash 13 | 14 | import gotheng 15 | import greeks 16 | import italicc 17 | import italiccs 18 | import meteo 19 | import music 20 | import romanc 21 | import romancs 22 | import romand 23 | import romanp 24 | import romans 25 | import romant 26 | import scriptc 27 | import scripts 28 | 29 | 30 | def cycle(p): 31 | ''' 32 | return the next item in a list 33 | ''' 34 | try: 35 | len(p) 36 | except TypeError: 37 | cache = [] 38 | for i in p: 39 | yield i 40 | cache.append(i) 41 | p = cache 42 | while p: 43 | yield from p 44 | 45 | 46 | COLORS = cycle([0xe000, 0xece0, 0xe7e0, 0x5e0, 0x00d3, 0x7030]) 47 | 48 | FONTS = cycle([ 49 | gotheng, greeks, italicc, italiccs, meteo, music, romanc, 50 | romancs, romand, romanp, romans, romant, scriptc, scripts]) 51 | 52 | GREETINGS = cycle([ 53 | "bonjour", "buenas noches", "buenos dias", 54 | "good day", "good morning", "hey", 55 | "hi-ya", "hi", "how are you", "how goes it", 56 | "howdy-do", "howdy", "shalom", "welcome", 57 | "what's happening", "what's up"]) 58 | 59 | 60 | def main(): 61 | ''' 62 | Draw greetings on display cycling thru hershey fonts and colors 63 | ''' 64 | try: 65 | # Turn display power 66 | axp = axp202c.PMU(address=0x34) 67 | axp.enablePower(axp202c.AXP192_LDO2) 68 | # Set backlight voltage 69 | axp.setDC3Voltage(3000) 70 | 71 | spi = SPI( 72 | 2, 73 | baudrate=60000000, 74 | sck=Pin(18), 75 | mosi=Pin(23)) 76 | 77 | # Configure display 78 | tft = ili9342c.ILI9342C( 79 | spi, 80 | 320, 81 | 240, 82 | reset=Pin(33, Pin.OUT), 83 | cs=Pin(5, Pin.OUT), 84 | dc=Pin(15, Pin.OUT), 85 | rotation=0) 86 | 87 | tft.init() 88 | tft.fill(ili9342c.BLACK) 89 | height = tft.height() 90 | width = tft.width() 91 | row = 0 92 | 93 | while True: 94 | row += 32 95 | tft.fill_rect(0, row-16, width, 32, ili9342c.BLACK) 96 | tft.draw(next(FONTS), next(GREETINGS), 0, row, next(COLORS)) 97 | 98 | if row > 192: 99 | row = 0 100 | 101 | utime.sleep(0.25) 102 | 103 | finally: 104 | # shutdown spi 105 | if 'spi' in locals(): 106 | spi.deinit() 107 | 108 | 109 | main() 110 | -------------------------------------------------------------------------------- /examples/M5CORE2/mono_fonts/mono_fonts.py: -------------------------------------------------------------------------------- 1 | """ 2 | mono_fonts.py for monofont2bitmap converter and bitmap method. 3 | """ 4 | 5 | import time 6 | from machine import Pin, SPI 7 | import ili9342c 8 | import axp202c 9 | 10 | import inconsolata_16 as font_16 11 | import inconsolata_32 as font_32 12 | import inconsolata_64 as font_64 13 | 14 | 15 | def main(): 16 | fast = False 17 | 18 | def display_font(font): 19 | tft.fill(ili9342c.BLUE) 20 | column = 0 21 | row = 0 22 | for char in font.MAP: 23 | tft.bitmap(font, column, row, font.MAP.index(char)) 24 | column += font.WIDTH 25 | if column >= tft.width() - font.WIDTH: 26 | row += font.HEIGHT 27 | column = 0 28 | 29 | if row > tft.height() - font.HEIGHT: 30 | row = 0 31 | 32 | if not fast: 33 | time.sleep(0.05) 34 | 35 | # Turn display power 36 | axp = axp202c.PMU(address=0x34) 37 | axp.enablePower(axp202c.AXP192_LDO2) 38 | # Set backlight voltage 39 | axp.setDC3Voltage(3000) 40 | 41 | spi = SPI( 42 | 2, 43 | baudrate=60000000, 44 | sck=Pin(18), 45 | mosi=Pin(23)) 46 | 47 | # initialize display 48 | 49 | tft = ili9342c.ILI9342C( 50 | spi, 51 | 320, 52 | 240, 53 | reset=Pin(33, Pin.OUT), 54 | cs=Pin(5, Pin.OUT), 55 | dc=Pin(15, Pin.OUT), 56 | rotation=0) 57 | 58 | tft.init() 59 | 60 | while True: 61 | for font in [font_16, font_32, font_64]: 62 | display_font(font) 63 | 64 | fast = not fast 65 | 66 | 67 | main() 68 | -------------------------------------------------------------------------------- /examples/M5CORE2/noto_fonts.py: -------------------------------------------------------------------------------- 1 | """ 2 | noto_fonts Writes the names of three Noto fonts centered on the display 3 | using the font. The fonts were converted from True Type fonts using 4 | the font2bitmap utility. 5 | """ 6 | 7 | from machine import Pin, SPI 8 | import ili9342c 9 | import axp202c 10 | 11 | import NotoSans_32 as noto_sans 12 | import NotoSerif_32 as noto_serif 13 | import NotoSansMono_32 as noto_mono 14 | 15 | 16 | def main(): 17 | 18 | def center(font, s, row, color=ili9342c.WHITE): 19 | screen = tft.width() # get screen width 20 | width = tft.write_len(font, s) # get the width of the string 21 | if width and width < screen: # if the string < display 22 | col = tft.width() // 2 - width // 2 # find the column to center 23 | else: # otherwise 24 | col = 0 # left justify 25 | 26 | tft.write(font, s, col, row, color) # and write the string 27 | 28 | # Turn display power 29 | axp = axp202c.PMU(address=0x34) 30 | axp.enablePower(axp202c.AXP192_LDO2) 31 | # Set backlight voltage 32 | axp.setDC3Voltage(3000) 33 | 34 | spi = SPI( 35 | 2, 36 | baudrate=60000000, 37 | sck=Pin(18), 38 | mosi=Pin(23)) 39 | 40 | # initialize display 41 | 42 | tft = ili9342c.ILI9342C( 43 | spi, 44 | 320, 45 | 240, 46 | reset=Pin(33, Pin.OUT), 47 | cs=Pin(5, Pin.OUT), 48 | dc=Pin(15, Pin.OUT), 49 | rotation=0) 50 | 51 | tft.init() 52 | tft.fill(ili9342c.BLACK) 53 | 54 | # center the name of the first font, using the font 55 | row = 16 56 | center(noto_sans, "NotoSans", row, ili9342c.RED) 57 | row += noto_sans.HEIGHT 58 | 59 | # center the name of the second font, using the font 60 | center(noto_serif, "NotoSerif", row, ili9342c.GREEN) 61 | row += noto_serif.HEIGHT 62 | 63 | # center the name of the third font, using the font 64 | center(noto_mono, "NotoSansMono", row, ili9342c.BLUE) 65 | row += noto_mono.HEIGHT 66 | 67 | 68 | main() 69 | -------------------------------------------------------------------------------- /examples/M5CORE2/paint.py: -------------------------------------------------------------------------------- 1 | ''' 2 | paint.py 3 | 4 | A very simple paint program for the M5CORE2 using the adafruit_focaltouch 5 | driver modified for micropython by franz schaefer from 6 | https://gitlab.com/mooond/t-watch2020-esp32-with-micropython 7 | 8 | I modied the axp202c driver to accept an initalized i2c object so it can 9 | be shared with the focaltouch driver. See the lib directory for source. 10 | ''' 11 | 12 | from machine import Pin, SPI, SoftI2C 13 | import axp202c 14 | import ili9342c 15 | 16 | import focaltouch 17 | import vga1_8x8 as font 18 | 19 | # color swatches 20 | COLORS = [ 21 | ili9342c.BLACK, 22 | ili9342c.BLUE, 23 | ili9342c.RED, 24 | ili9342c.GREEN, 25 | ili9342c.CYAN, 26 | ili9342c.MAGENTA, 27 | ili9342c.YELLOW, 28 | ili9342c.WHITE] 29 | 30 | 31 | def main(): 32 | ''' 33 | Draw on screen using focaltouch sensor 34 | ''' 35 | try: 36 | i2c = SoftI2C(scl=Pin(22), sda=Pin(21)) 37 | 38 | # Turn display power 39 | axp = axp202c.PMU(i2c=i2c, address=0x34) 40 | axp.enablePower(axp202c.AXP192_LDO2) 41 | # Set backlight voltage 42 | axp.setDC3Voltage(3000) 43 | 44 | spi = SPI( 45 | 2, 46 | baudrate=60000000, 47 | sck=Pin(18), 48 | mosi=Pin(23)) 49 | 50 | # initialize display 51 | 52 | tft = ili9342c.ILI9342C( 53 | spi, 54 | 320, 55 | 240, 56 | reset=Pin(33, Pin.OUT), 57 | cs=Pin(5, Pin.OUT), 58 | dc=Pin(15, Pin.OUT), 59 | rotation=0) 60 | 61 | # enable display and clear screen 62 | tft.init() 63 | tft.fill(ili9342c.BLACK) 64 | tft.text(font, "Draw", 158, 1, ili9342c.WHITE) 65 | 66 | # enable focaltouch touchscreen 67 | touch = focaltouch.FocalTouch(i2c) 68 | 69 | color_index = 0 70 | color = 0 71 | # draw color swatches used to select color to draw 72 | for color_index, color in enumerate(COLORS): 73 | tft.fill_rect(color_index*40, 200, 40, 40, color) 74 | 75 | # draw boxes around currently selected color 76 | tft.rect(color_index*40, 200, 40, 40, ili9342c.WHITE) 77 | tft.rect(color_index*40+1, 201, 38, 38, ili9342c.BLACK) 78 | tft.rect(color_index*40+2, 202, 36, 36, ili9342c.BLACK) 79 | 80 | start = None 81 | while True: 82 | # can be up to two touches 83 | if touch.touched == 1: 84 | # get x and y points of the first touch point 85 | p_x = touch.touches[0]['x'] 86 | p_y = touch.touches[0]['y'] 87 | 88 | # If point is in the lowest 40 rows of the screen 89 | # change color to swatch pressed. 90 | if p_y > 200: 91 | # remove box from around previous color swatch 92 | tft.rect(color_index*40, 200, 40, 40, color) 93 | tft.rect(color_index*40+1, 201, 38, 38, color) 94 | tft.rect(color_index*40+2, 202, 36, 36, color) 95 | 96 | # update new color 97 | color_index = p_x//40 98 | color = COLORS[color_index] 99 | 100 | # draw box around newly selected color swatch 101 | tft.rect(color_index*40, 200, 40, 40, ili9342c.WHITE) 102 | tft.rect(color_index*40+1, 201, 38, 38, ili9342c.BLACK) 103 | tft.rect(color_index*40+2, 202, 36, 36, ili9342c.BLACK) 104 | 105 | else: 106 | # press is out side of colors 107 | if start is None: 108 | # 1st press, save start of line 109 | start = (p_x, p_y) 110 | else: 111 | # draw line to current location and make new start 112 | tft.line(start[0], start[1], p_x, p_y, color) 113 | start = (p_x, p_y) 114 | else: 115 | # no touch, reset for new line 116 | start = None 117 | 118 | finally: 119 | # shutdown spi 120 | spi.deinit() 121 | 122 | 123 | main() 124 | -------------------------------------------------------------------------------- /examples/M5CORE2/prop_fonts/chango.py: -------------------------------------------------------------------------------- 1 | """ 2 | chango.py test for font2bitmap converter. 3 | """ 4 | 5 | from machine import Pin, SPI 6 | import ili9342c 7 | import axp202c 8 | 9 | import chango_16 as font_16 10 | import chango_32 as font_32 11 | import chango_64 as font_64 12 | 13 | 14 | def main(): 15 | 16 | try: 17 | # Turn display power 18 | axp = axp202c.PMU(address=0x34) 19 | axp.enablePower(axp202c.AXP192_LDO2) 20 | # Set backlight voltage 21 | axp.setDC3Voltage(3000) 22 | 23 | spi = SPI( 24 | 2, 25 | baudrate=60000000, 26 | sck=Pin(18), 27 | mosi=Pin(23)) 28 | 29 | # initialize display 30 | tft = ili9342c.ILI9342C( 31 | spi, 32 | 320, 33 | 240, 34 | reset=Pin(33, Pin.OUT), 35 | cs=Pin(5, Pin.OUT), 36 | dc=Pin(15, Pin.OUT), 37 | rotation=0) 38 | 39 | tft.init() 40 | tft.fill(ili9342c.BLACK) 41 | 42 | row = 0 43 | tft.write(font_16, "abcdefghijklmnopqrstuvwxyz", 0, row) 44 | row += font_16.HEIGHT 45 | 46 | tft.write(font_32, "abcdefghijklm", 0, row) 47 | row += font_32.HEIGHT 48 | 49 | tft.write(font_32, "nopqrstuvwxy", 0, row) 50 | row += font_32.HEIGHT 51 | 52 | tft.write(font_64, "abcdef", 0, row) 53 | row += font_64.HEIGHT 54 | 55 | tft.write(font_64, "ghijkl", 0, row) 56 | 57 | finally: 58 | # shutdown spi 59 | if 'spi' in locals(): 60 | spi.deinit() 61 | 62 | 63 | main() 64 | -------------------------------------------------------------------------------- /examples/M5CORE2/scroll.py: -------------------------------------------------------------------------------- 1 | """ 2 | scroll.py 3 | 4 | Smoothly scroll all characters in a font up the M5Stack Core Display. 5 | Fonts heights must be even multiples of the screen height 6 | (i.e. 8 or 16 pixels high). 7 | 8 | """ 9 | 10 | import utime 11 | import random 12 | from machine import Pin, SPI 13 | 14 | import ili9342c 15 | import axp202c 16 | import vga1_bold_16x16 as font 17 | 18 | 19 | def cycle(p): 20 | try: 21 | len(p) 22 | except TypeError: 23 | cache = [] 24 | for i in p: 25 | yield i 26 | cache.append(i) 27 | p = cache 28 | while p: 29 | yield from p 30 | 31 | 32 | def main(): 33 | # Turn display power 34 | axp = axp202c.PMU(address=0x34) 35 | axp.enablePower(axp202c.AXP192_LDO2) 36 | # Set backlight voltage 37 | axp.setDC3Voltage(3000) 38 | 39 | spi = SPI( 40 | 2, 41 | baudrate=60000000, 42 | sck=Pin(18), 43 | mosi=Pin(23)) 44 | 45 | # initialize display 46 | 47 | tft = ili9342c.ILI9342C( 48 | spi, 49 | 320, 50 | 240, 51 | reset=Pin(33, Pin.OUT), 52 | cs=Pin(5, Pin.OUT), 53 | dc=Pin(15, Pin.OUT), 54 | rotation=0) 55 | 56 | colors = cycle([0xe000, 0xece0, 0xe7e0, 0x5e0, 0x00d3, 0x7030]) 57 | foreground = next(colors) 58 | background = ili9342c.BLACK 59 | 60 | tft.init() 61 | tft.fill(background) 62 | utime.sleep(1) 63 | 64 | height = tft.height() 65 | width = tft.width() 66 | last_line = height - font.HEIGHT 67 | 68 | tfa = 0 # top free area 69 | tfb = 0 # bottom free area 70 | tft.vscrdef(tfa, height, tfb) 71 | 72 | scroll = 0 73 | character = 32 74 | 75 | while True: 76 | # clear top line before scrolling off display 77 | tft.fill_rect(0, scroll, width, 1, background) 78 | 79 | # Write new line when we have scrolled the height of a character 80 | if scroll % font.HEIGHT == 0: 81 | line = (scroll + last_line) % height 82 | 83 | # write character hex value as a string 84 | tft.text( 85 | font, 86 | 'x{:02x}'.format(character), 87 | 16, 88 | line, 89 | foreground, 90 | background) 91 | 92 | # write character using a integer (could be > 0x7f) 93 | tft.text( 94 | font, 95 | character, 96 | 90, 97 | line, 98 | foreground, 99 | background) 100 | 101 | # change color for next line 102 | foreground = next(colors) 103 | 104 | # next character with rollover at 256 105 | character += 1 106 | if character > 127: 107 | character = 32 108 | 109 | # scroll the screen up 1 row 110 | tft.vscsad(scroll+tfa) 111 | scroll += 1 112 | scroll %= height 113 | 114 | utime.sleep(0.01) 115 | 116 | 117 | main() 118 | -------------------------------------------------------------------------------- /examples/M5CORE2/tbbunny.py: -------------------------------------------------------------------------------- 1 | """ 2 | tbbunny.py - Tiny Big Buck Bunny for the M5Stack Core2 3 | 4 | The program sequentially reads, decodes and displays each frame from 5 | individual JPG's stored on a SD Card. Originally my device did not have 6 | enough RAM to hold a full sized 320x240 uncompressed image (153600 bytes) 7 | I reduced the frame size to 160x120 (38400 bytes). The Core2 has enough 8 | memory but the SPI interface is slow so I kept the 160x120 size. 9 | 10 | The JPG files are available from https://github.com/russhughes/TinyBigBuckBunny 11 | Requires the use the sdcard.py and axp202c.py driver available from the lib 12 | directory or in the provided firmware.bin from the firmware/M5CORE2 directory. 13 | """ 14 | 15 | from machine import Pin, SPI 16 | import uos 17 | import sdcard 18 | import ili9342c 19 | import axp202c 20 | import gc 21 | 22 | 23 | def main(): 24 | 25 | try: 26 | # Turn display power 27 | axp = axp202c.PMU(address=0x34) 28 | axp.enablePower(axp202c.AXP192_LDO2) 29 | # Set backlight voltage 30 | axp.setDC3Voltage(3000) 31 | 32 | spi = SPI(2, baudrate=20000000, sck=Pin(18), miso=Pin(38), mosi=Pin(23)) 33 | 34 | # initialize and mount the sdcard 35 | sd_device = sdcard.SDCard(spi, cs=Pin(4), baudrate=20000000) 36 | uos.mount(sd_device, '/sd') 37 | 38 | # initialize display 39 | 40 | tft = ili9342c.ILI9342C( 41 | spi, 42 | 320, 43 | 240, 44 | cs=Pin(5, Pin.OUT), 45 | dc=Pin(15, Pin.OUT), 46 | rotation=0, 47 | buffer_size=38400) 48 | 49 | tft.init() 50 | 51 | for i in range(1, 2387): 52 | frame = "/sd/160x120/{:04d}.jpg".format(i) 53 | tft.jpg(frame, 80, 60, ili9342c.FAST) 54 | 55 | finally: 56 | # shutdown spi 57 | if 'spi' in locals(): 58 | spi.deinit() 59 | 60 | 61 | gc.collect() 62 | main() 63 | -------------------------------------------------------------------------------- /examples/M5CORE2/toasters/t1.py: -------------------------------------------------------------------------------- 1 | HEIGHT = 64 2 | WIDTH = 64 3 | COLORS = 8 4 | BITS = 12288 5 | BPP = 3 6 | PALETTE = [0x0000,0xffff,0xb6b5,0x00b0,0x6d6b,0x4082,0x494a,0x2000] 7 | _bitmap =\ 8 | b'\x00\x00\x00\x00\x00\x00\x00\x02\x49\x24\x00\x00\x00\x00\x00\x00'\ 9 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02'\ 10 | b'\x49\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 11 | b'\x00\x00\x00\x00\x00\x00\x24\x92\x40\x00\x90\x00\x00\x00\x00\x00'\ 12 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92'\ 13 | b'\x40\x00\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 14 | b'\x00\x00\x00\x00\x00\x09\x24\x90\x00\x24\x90\x00\x00\x00\x00\x00'\ 15 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x24\x90'\ 16 | b'\x00\x24\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 17 | b'\x00\x00\x00\x00\x02\x49\x00\x92\x49\x00\x02\x40\x49\x24\x92\x00'\ 18 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x49\x00\x92'\ 19 | b'\x49\x00\x02\x40\x49\x24\x92\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 20 | b'\x00\x00\x00\x00\x92\x49\x24\x92\x40\x01\x24\x92\x49\x24\x92\x49'\ 21 | b'\x24\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x92\x49\x24\x92'\ 22 | b'\x40\x01\x24\x92\x49\x24\x92\x49\x24\x80\x00\x00\x00\x00\x00\x00'\ 23 | b'\x00\x00\x00\x00\x92\x49\x24\x04\x92\x49\x20\x00\x01\xb6\xdb\x6d'\ 24 | b'\x24\x92\x48\x00\x00\x00\x00\x00\x00\x00\x00\x00\x92\x49\x24\x04'\ 25 | b'\x92\x49\x20\x00\x01\xb6\xdb\x6d\x24\x92\x48\x00\x00\x00\x00\x00'\ 26 | b'\x00\x00\x00\x24\x92\x49\x49\x24\x80\x00\x06\xdb\x6d\x24\x92\x49'\ 27 | b'\x24\x92\x49\x24\x80\x00\x00\x00\x00\x00\x00\x24\x92\x49\x49\x24'\ 28 | b'\x80\x00\x06\xdb\x6d\x24\x92\x49\x24\x92\x49\x24\x80\x00\x00\x00'\ 29 | b'\x00\x00\x00\x24\x94\x92\x48\x00\x00\x6d\xb4\x92\x49\x20\x00\x01'\ 30 | b'\xb6\xdb\x6d\x24\xa4\x00\x00\x00\x00\x00\x00\x24\x94\x92\x48\x00'\ 31 | b'\x00\x6d\xb4\x92\x49\x20\x00\x01\xb6\xdb\x6d\x24\xa4\x00\x00\x00'\ 32 | b'\x00\x00\x09\x49\x24\x80\x00\x06\xdb\x49\x24\x80\x00\x06\xdb\x6d'\ 33 | b'\x24\x92\x00\x00\x00\x90\x00\x00\x00\x00\x09\x49\x24\x80\x00\x06'\ 34 | b'\xdb\x49\x24\x80\x00\x06\xdb\x6d\x24\x92\x00\x00\x00\x90\x00\x00'\ 35 | b'\x00\x00\x12\x48\x00\x00\x6d\xb4\x92\x48\x00\x00\x6d\xb4\x92\x48'\ 36 | b'\x00\x00\x24\x92\x49\x24\x92\x49\x00\x00\x12\x48\x00\x00\x6d\xb4'\ 37 | b'\x92\x48\x00\x00\x6d\xb4\x92\x48\x00\x00\x24\x92\x49\x24\x92\x49'\ 38 | b'\x00\x04\x92\x00\x00\x1b\x49\x24\x80\x00\x06\xdb\x49\x24\xa4\x00'\ 39 | b'\x92\x49\x24\x90\x09\x00\x90\x00\x00\x04\x92\x00\x00\x1b\x49\x24'\ 40 | b'\x80\x00\x06\xdb\x49\x24\xa4\x00\x92\x49\x24\x90\x09\x00\x90\x00'\ 41 | b'\x01\x24\x80\x00\x06\xd2\x48\x00\x00\x6d\xb4\x92\x4a\x49\x00\x24'\ 42 | b'\x92\x40\x24\x92\x49\x24\x92\x49\x01\x24\x80\x00\x06\xd2\x48\x00'\ 43 | b'\x00\x6d\xb4\x92\x4a\x49\x00\x24\x92\x40\x24\x92\x49\x24\x92\x49'\ 44 | b'\x01\x24\x92\x49\xb4\x92\x00\x00\x1b\x49\x24\xa4\x92\x40\x09\x24'\ 45 | b'\x92\x49\x24\x02\x40\x24\x00\x00\x01\x24\x92\x49\xb4\x92\x00\x00'\ 46 | b'\x1b\x49\x24\xa4\x92\x40\x09\x24\x92\x49\x24\x02\x40\x24\x00\x00'\ 47 | b'\x92\xdb\x52\x49\x24\x80\x00\x06\xd2\x4b\x69\x24\x92\x40\x09\x24'\ 48 | b'\x90\x09\x24\x92\x49\x24\x92\x40\x92\xdb\x52\x49\x24\x80\x00\x06'\ 49 | b'\xd2\x4b\x69\x24\x92\x40\x09\x24\x90\x09\x24\x92\x49\x24\x92\x40'\ 50 | b'\x92\xdb\x6d\xb5\x24\x92\x49\xb4\x92\xda\x49\x24\x90\x02\x49\x24'\ 51 | b'\x92\x49\x00\x90\x09\x00\x00\x00\x92\xdb\x6d\xb5\x24\x92\x49\xb4'\ 52 | b'\x92\xda\x49\x24\x90\x02\x49\x24\x92\x49\x00\x90\x09\x00\x00\x00'\ 53 | b'\x92\xd4\x92\xb6\xdb\x52\x49\x24\xb6\x92\x49\x24\x90\x02\x49\x24'\ 54 | b'\x02\x49\x24\x92\x49\x24\x00\x00\x92\xd4\x92\xb6\xdb\x52\x49\x24'\ 55 | b'\xb6\x92\x49\x24\x90\x02\x49\x24\x02\x49\x24\x92\x49\x24\x00\x00'\ 56 | b'\x92\xd4\xb6\x49\x2b\x6d\xb6\x49\x36\x92\x49\x24\x00\x92\x49\x24'\ 57 | b'\x92\x40\x00\x00\x00\x00\x00\x00\x92\xd4\xb6\x49\x2b\x6d\xb6\x49'\ 58 | b'\x36\x92\x49\x24\x00\x92\x49\x24\x92\x40\x00\x00\x00\x00\x00\x00'\ 59 | b'\x92\xd4\xb6\xdb\x64\x92\xb6\x4b\x64\x92\x49\x24\x00\x92\x40\x24'\ 60 | b'\x92\x49\x24\x09\x2d\xb4\x00\x00\x92\xd4\xb6\xdb\x64\x92\xb6\x4b'\ 61 | b'\x64\x92\x49\x24\x00\x92\x40\x24\x92\x49\x24\x09\x2d\xb4\x00\x00'\ 62 | b'\x92\xdb\x6d\xb7\x64\x92\xb6\x4b\x64\x92\x49\x00\x24\x92\x49\x24'\ 63 | b'\x00\x00\x02\x49\x2d\x90\x00\x00\x92\xdb\x6d\xb7\x64\x92\xb6\x4b'\ 64 | b'\x64\x92\x49\x00\x24\x92\x49\x24\x00\x00\x02\x49\x2d\x90\x00\x00'\ 65 | b'\x92\xdb\x6d\x4a\xd4\x92\xb6\x4b\x64\x92\x49\x00\x24\x90\x09\x24'\ 66 | b'\x92\x40\x92\x4b\x6d\xb4\x00\x00\x92\xdb\x6d\x4a\xd4\x92\xb6\x4b'\ 67 | b'\x64\x92\x49\x00\x24\x90\x09\x24\x92\x40\x92\x4b\x6d\xb4\x00\x00'\ 68 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\x90\x09\x00\x24\x92\x49\x00'\ 69 | b'\x00\x24\x92\x4b\x6d\x90\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 70 | b'\x6d\x90\x09\x00\x24\x92\x49\x00\x00\x24\x92\x4b\x6d\x90\x00\x00'\ 71 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\x92\x49\x24\x00\x92\x40\x92'\ 72 | b'\x49\x24\x92\xdb\x6d\xb4\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 73 | b'\x6d\x92\x49\x24\x00\x92\x40\x92\x49\x24\x92\xdb\x6d\xb4\x00\x00'\ 74 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\x90\x09\x24\x90\x00\x24\x92'\ 75 | b'\x49\x24\xb6\xdb\x6d\x90\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 76 | b'\x6d\x90\x09\x24\x90\x00\x24\x92\x49\x24\xb6\xdb\x6d\x90\x00\x00'\ 77 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\xb6\x40\x00\x92\x49\x24\x92'\ 78 | b'\x4b\x6d\xb6\xdb\x64\x00\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 79 | b'\x6d\xb6\x40\x00\x92\x49\x24\x92\x4b\x6d\xb6\xdb\x64\x00\x00\x00'\ 80 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xd9\x24\x92\x49\x24\xb6'\ 81 | b'\xdb\x6d\xb6\xd9\x00\x00\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 82 | b'\x6d\xb6\xd9\x24\x92\x49\x24\xb6\xdb\x6d\xb6\xd9\x00\x00\x00\x00'\ 83 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6'\ 84 | b'\xdb\x6d\x92\x40\x00\x00\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 85 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92\x40\x00\x00\x00\x00'\ 86 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6'\ 87 | b'\xd9\x24\x00\x00\x00\x00\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 88 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00\x00\x00\x00\x00\x00'\ 89 | b'\x02\x4b\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92'\ 90 | b'\x40\x00\x00\x00\x00\x00\x00\x00\x02\x4b\x6d\xb6\xdb\x6d\xb6\x4b'\ 91 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92\x40\x00\x00\x00\x00\x00\x00\x00'\ 92 | b'\x00\x09\x2d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00'\ 93 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x2d\xb6\xdb\x6d\xb6\x4b'\ 94 | b'\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 95 | b'\x00\x00\x24\x92\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x64\x92\x40\x00\x00'\ 96 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92\xdb\x6d\xb6\x4b'\ 97 | b'\x6d\xb6\xdb\x64\x92\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 98 | b'\x00\x00\x00\x02\x49\x2d\xb6\x4b\x6d\x92\x49\x00\x00\x00\x00\x00'\ 99 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x49\x2d\xb6\x4b'\ 100 | b'\x6d\x92\x49\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 101 | b'\x00\x00\x00\x00\x00\x24\x92\x49\x24\x00\x00\x00\x00\x00\x00\x00'\ 102 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92\x49'\ 103 | b'\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' 104 | BITMAP = memoryview(_bitmap) 105 | -------------------------------------------------------------------------------- /examples/M5CORE2/toasters/t2.py: -------------------------------------------------------------------------------- 1 | HEIGHT = 64 2 | WIDTH = 64 3 | COLORS = 8 4 | BITS = 12288 5 | BPP = 3 6 | PALETTE = [0x0000,0xffff,0xb6b5,0x00b0,0x6d6b,0x4082,0x494a,0x2000] 7 | _bitmap =\ 8 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 9 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 10 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 11 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 12 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 13 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 14 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 15 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 16 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 17 | b'\x00\x00\x00\x00\x00\x00\x00\x02\x49\x00\x00\x00\x49\x24\x92\x00'\ 18 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02'\ 19 | b'\x49\x00\x00\x00\x49\x24\x92\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 20 | b'\x00\x00\x00\x00\x00\x00\x24\x92\x49\x01\x24\x92\x49\x24\x92\x49'\ 21 | b'\x24\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92'\ 22 | b'\x49\x01\x24\x92\x49\x24\x92\x49\x24\x80\x00\x00\x00\x00\x00\x00'\ 23 | b'\x00\x00\x00\x00\x00\x09\x24\x04\x92\x49\x20\x00\x01\xb6\xdb\x6d'\ 24 | b'\x24\x92\x48\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x24\x04'\ 25 | b'\x92\x49\x20\x00\x01\xb6\xdb\x6d\x24\x92\x48\x00\x00\x00\x00\x00'\ 26 | b'\x00\x00\x00\x00\x02\x49\x49\x24\x80\x00\x06\xdb\x6d\x24\x92\x49'\ 27 | b'\x24\x92\x49\x24\x80\x00\x00\x00\x00\x00\x00\x00\x02\x49\x49\x24'\ 28 | b'\x80\x00\x06\xdb\x6d\x24\x92\x49\x24\x92\x49\x24\x80\x00\x00\x00'\ 29 | b'\x00\x00\x00\x00\x94\x92\x48\x00\x00\x6d\xb4\x92\x49\x20\x00\x01'\ 30 | b'\xb6\xdb\x6d\x24\xa4\x00\x00\x00\x00\x00\x00\x00\x94\x92\x48\x00'\ 31 | b'\x00\x6d\xb4\x92\x49\x20\x00\x01\xb6\xdb\x6d\x24\xa4\x00\x00\x00'\ 32 | b'\x00\x00\x00\x49\x24\x80\x00\x06\xdb\x49\x24\x80\x00\x06\xdb\x6d'\ 33 | b'\x24\x92\x49\x24\xa4\x90\x00\x00\x00\x00\x00\x49\x24\x80\x00\x06'\ 34 | b'\xdb\x49\x24\x80\x00\x06\xdb\x6d\x24\x92\x49\x24\xa4\x90\x00\x00'\ 35 | b'\x00\x00\x12\x48\x00\x00\x6d\xb4\x92\x48\x00\x00\x6d\xb4\x92\x49'\ 36 | b'\x24\x80\x00\x00\x24\x90\x00\x00\x00\x00\x12\x48\x00\x00\x6d\xb4'\ 37 | b'\x92\x48\x00\x00\x6d\xb4\x92\x49\x24\x80\x00\x00\x24\x90\x00\x00'\ 38 | b'\x00\x04\x92\x00\x00\x1b\x49\x24\x80\x00\x06\xdb\x49\x24\xa4\x90'\ 39 | b'\x00\x24\x92\x49\x00\x90\x00\x00\x00\x04\x92\x00\x00\x1b\x49\x24'\ 40 | b'\x80\x00\x06\xdb\x49\x24\xa4\x90\x00\x24\x92\x49\x00\x90\x00\x00'\ 41 | b'\x01\x24\x80\x00\x06\xd2\x48\x00\x00\x6d\xb4\x92\x4a\x49\x24\x92'\ 42 | b'\x49\x24\x92\x49\x24\x90\x00\x00\x01\x24\x80\x00\x06\xd2\x48\x00'\ 43 | b'\x00\x6d\xb4\x92\x4a\x49\x24\x92\x49\x24\x92\x49\x24\x90\x00\x00'\ 44 | b'\x01\x24\x92\x49\xb4\x92\x00\x00\x1b\x49\x24\xa4\x92\x49\x24\x90'\ 45 | b'\x00\x00\x00\x00\x00\x90\x00\x00\x01\x24\x92\x49\xb4\x92\x00\x00'\ 46 | b'\x1b\x49\x24\xa4\x92\x49\x24\x90\x00\x00\x00\x00\x00\x90\x00\x00'\ 47 | b'\x92\xdb\x52\x49\x24\x80\x00\x06\xd2\x4b\x69\x24\x92\x49\x00\x00'\ 48 | b'\x92\x49\x24\x92\x49\x00\x00\x00\x92\xdb\x52\x49\x24\x80\x00\x06'\ 49 | b'\xd2\x4b\x69\x24\x92\x49\x00\x00\x92\x49\x24\x92\x49\x00\x00\x00'\ 50 | b'\x92\xdb\x6d\xb5\x24\x92\x49\xb4\x92\xda\x49\x24\x92\x40\x09\x24'\ 51 | b'\x92\x49\x00\x92\x49\x24\x92\x49\x92\xdb\x6d\xb5\x24\x92\x49\xb4'\ 52 | b'\x92\xda\x49\x24\x92\x40\x09\x24\x92\x49\x00\x92\x49\x24\x92\x49'\ 53 | b'\x92\xd4\x92\xb6\xdb\x52\x49\x24\xb6\x92\x49\x24\x90\x02\x49\x24'\ 54 | b'\x92\x49\x24\x90\x09\x00\x90\x00\x92\xd4\x92\xb6\xdb\x52\x49\x24'\ 55 | b'\xb6\x92\x49\x24\x90\x02\x49\x24\x92\x49\x24\x90\x09\x00\x90\x00'\ 56 | b'\x92\xd4\xb6\x49\x2b\x6d\xb6\x49\x36\x92\x49\x24\x00\x92\x49\x24'\ 57 | b'\x92\x40\x24\x92\x49\x24\x92\x49\x92\xd4\xb6\x49\x2b\x6d\xb6\x49'\ 58 | b'\x36\x92\x49\x24\x00\x92\x49\x24\x92\x40\x24\x92\x49\x24\x92\x49'\ 59 | b'\x92\xd4\xb6\xdb\x64\x92\xb6\x4b\x64\x92\x49\x24\x00\x92\x49\x24'\ 60 | b'\x92\x49\x24\x02\x40\x00\x92\x40\x92\xd4\xb6\xdb\x64\x92\xb6\x4b'\ 61 | b'\x64\x92\x49\x24\x00\x92\x49\x24\x92\x49\x24\x02\x40\x00\x92\x40'\ 62 | b'\x92\xdb\x6d\xb7\x64\x92\xb6\x4b\x64\x92\x49\x00\x24\x92\x49\x24'\ 63 | b'\x90\x09\x24\x92\x49\x24\x00\x00\x92\xdb\x6d\xb7\x64\x92\xb6\x4b'\ 64 | b'\x64\x92\x49\x00\x24\x92\x49\x24\x90\x09\x24\x92\x49\x24\x00\x00'\ 65 | b'\x92\xdb\x6d\x4a\xd4\x92\xb6\x4b\x64\x92\x49\x00\x24\x90\x09\x00'\ 66 | b'\x92\x49\x24\x90\x2d\xb4\x00\x00\x92\xdb\x6d\x4a\xd4\x92\xb6\x4b'\ 67 | b'\x64\x92\x49\x00\x24\x90\x09\x00\x92\x49\x24\x90\x2d\xb4\x00\x00'\ 68 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\x90\x09\x00\x24\x92\x49\x00'\ 69 | b'\x00\x00\x00\x00\x2d\x90\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 70 | b'\x6d\x90\x09\x00\x24\x92\x49\x00\x00\x00\x00\x00\x2d\x90\x00\x00'\ 71 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\x92\x49\x24\x00\x92\x40\x92'\ 72 | b'\x49\x24\x92\xdb\x6d\xb4\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 73 | b'\x6d\x92\x49\x24\x00\x92\x40\x92\x49\x24\x92\xdb\x6d\xb4\x00\x00'\ 74 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\x90\x09\x24\x90\x00\x24\x92'\ 75 | b'\x49\x24\xb6\xdb\x6d\x90\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 76 | b'\x6d\x90\x09\x24\x90\x00\x24\x92\x49\x24\xb6\xdb\x6d\x90\x00\x00'\ 77 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\xb6\x40\x00\x92\x49\x24\x92'\ 78 | b'\x4b\x6d\xb6\xdb\x64\x00\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 79 | b'\x6d\xb6\x40\x00\x92\x49\x24\x92\x4b\x6d\xb6\xdb\x64\x00\x00\x00'\ 80 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xd9\x24\x92\x49\x24\xb6'\ 81 | b'\xdb\x6d\xb6\xd9\x00\x00\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 82 | b'\x6d\xb6\xd9\x24\x92\x49\x24\xb6\xdb\x6d\xb6\xd9\x00\x00\x00\x00'\ 83 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6'\ 84 | b'\xdb\x6d\x92\x40\x00\x00\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 85 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92\x40\x00\x00\x00\x00'\ 86 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6'\ 87 | b'\xd9\x24\x00\x00\x00\x00\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 88 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00\x00\x00\x00\x00\x00'\ 89 | b'\x02\x4b\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92'\ 90 | b'\x40\x00\x00\x00\x00\x00\x00\x00\x02\x4b\x6d\xb6\xdb\x6d\xb6\x4b'\ 91 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92\x40\x00\x00\x00\x00\x00\x00\x00'\ 92 | b'\x00\x09\x2d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00'\ 93 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x2d\xb6\xdb\x6d\xb6\x4b'\ 94 | b'\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 95 | b'\x00\x00\x24\x92\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x64\x92\x40\x00\x00'\ 96 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92\xdb\x6d\xb6\x4b'\ 97 | b'\x6d\xb6\xdb\x64\x92\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 98 | b'\x00\x00\x00\x02\x49\x2d\xb6\x4b\x6d\x92\x49\x00\x00\x00\x00\x00'\ 99 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x49\x2d\xb6\x4b'\ 100 | b'\x6d\x92\x49\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 101 | b'\x00\x00\x00\x00\x00\x24\x92\x49\x24\x00\x00\x00\x00\x00\x00\x00'\ 102 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92\x49'\ 103 | b'\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' 104 | BITMAP = memoryview(_bitmap) 105 | -------------------------------------------------------------------------------- /examples/M5CORE2/toasters/t3.py: -------------------------------------------------------------------------------- 1 | HEIGHT = 64 2 | WIDTH = 64 3 | COLORS = 8 4 | BITS = 12288 5 | BPP = 3 6 | PALETTE = [0x0000,0xb6b5,0x00b0,0x6d6b,0x4082,0x494a,0xffff,0x2000] 7 | _bitmap =\ 8 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 9 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 10 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 11 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 12 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 13 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 14 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 15 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 16 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 17 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92\x49\x00'\ 18 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 19 | b'\x00\x00\x00\x00\x24\x92\x49\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 20 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x92\x49\x24\x92\x49\x24'\ 21 | b'\x92\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 22 | b'\x00\x00\x92\x49\x24\x92\x49\x24\x92\x40\x00\x00\x00\x00\x00\x00'\ 23 | b'\x00\x00\x00\x00\x00\x00\x00\x02\x49\x24\x90\x00\x01\x24\x92\x48'\ 24 | b'\x92\x49\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02'\ 25 | b'\x49\x24\x90\x00\x01\x24\x92\x48\x92\x49\x24\x00\x00\x00\x00\x00'\ 26 | b'\x00\x00\x00\x00\x00\x00\x24\x92\x40\x00\x04\x92\x48\x92\x49\x24'\ 27 | b'\x92\x49\x24\x92\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92'\ 28 | b'\x40\x00\x04\x92\x48\x92\x49\x24\x92\x49\x24\x92\x40\x00\x00\x00'\ 29 | b'\x00\x00\x00\x00\x02\x49\x24\x00\x00\x49\x22\x49\x24\x90\x00\x01'\ 30 | b'\x24\x92\x48\x92\x5b\x00\x00\x00\x00\x00\x00\x00\x02\x49\x24\x00'\ 31 | b'\x00\x49\x22\x49\x24\x90\x00\x01\x24\x92\x48\x92\x5b\x00\x00\x00'\ 32 | b'\x00\x00\x00\x24\x92\x40\x00\x04\x92\x24\x92\x40\x00\x04\x92\x48'\ 33 | b'\x92\x49\x24\x92\x5b\x6c\x00\x00\x00\x00\x00\x24\x92\x40\x00\x04'\ 34 | b'\x92\x24\x92\x40\x00\x04\x92\x48\x92\x49\x24\x92\x5b\x6c\x00\x00'\ 35 | b'\x00\x00\x09\x24\x00\x00\x49\x22\x49\x24\x00\x00\x49\x22\x49\x24'\ 36 | b'\x96\xc0\x00\x00\x1b\x6c\x00\x00\x00\x00\x09\x24\x00\x00\x49\x22'\ 37 | b'\x49\x24\x00\x00\x49\x22\x49\x24\x96\xc0\x00\x00\x1b\x6c\x00\x00'\ 38 | b'\x00\x02\x49\x00\x00\x12\x24\x92\x40\x00\x04\x92\x24\x92\x5b\x6c'\ 39 | b'\x00\x1b\x6d\xb6\xc0\x6c\x00\x00\x00\x02\x49\x00\x00\x12\x24\x92'\ 40 | b'\x40\x00\x04\x92\x24\x92\x5b\x6c\x00\x1b\x6d\xb6\xc0\x6c\x00\x00'\ 41 | b'\x00\x92\x40\x00\x04\x89\x24\x00\x00\x49\x22\x49\x25\xb6\xdb\x6d'\ 42 | b'\xb6\xdb\x6d\xb6\xdb\x6c\x00\x00\x00\x92\x40\x00\x04\x89\x24\x00'\ 43 | b'\x00\x49\x22\x49\x25\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6c\x00\x00'\ 44 | b'\x00\x92\x49\x25\x22\x49\x00\x00\x12\x24\x92\x5b\x6d\xb6\xdb\x6d'\ 45 | b'\xb6\xdb\x6d\xb6\xdb\x6c\x00\x00\x00\x92\x49\x25\x22\x49\x00\x00'\ 46 | b'\x12\x24\x92\x5b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6c\x00\x00'\ 47 | b'\x6e\x49\x09\x24\x92\x40\x00\x04\x89\x26\xd6\xdb\x6d\xb6\xdb\x6d'\ 48 | b'\xb6\xdb\x6d\xb6\xdb\x00\x00\x00\x6e\x49\x09\x24\x92\x40\x00\x04'\ 49 | b'\x89\x26\xd6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x00\x00\x00'\ 50 | b'\x6e\x49\x24\x90\x92\x49\x25\x22\x49\xb5\xb6\xdb\x6d\xb6\xdb\x6d'\ 51 | b'\xb6\xdb\x6d\xb6\xc0\x6c\x00\x00\x6e\x49\x24\x90\x92\x49\x25\x22'\ 52 | b'\x49\xb5\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xc0\x6c\x00\x00'\ 53 | b'\x6e\x42\x49\x92\x49\x09\x24\x92\x6d\x6d\xb6\xdb\x6d\xb6\xdb\x6d'\ 54 | b'\xb6\xdb\x6d\xb6\xc0\x00\x00\x00\x6e\x42\x49\x92\x49\x09\x24\x92'\ 55 | b'\x6d\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xc0\x00\x00\x00'\ 56 | b'\x6e\x42\x6d\x24\x99\x24\x91\xb6\xed\x6d\xb6\xdb\x6c\x00\x1b\x6d'\ 57 | b'\xb6\xdb\x6c\x00\x00\x6c\x00\x00\x6e\x42\x6d\x24\x99\x24\x91\xb6'\ 58 | b'\xed\x6d\xb6\xdb\x6c\x00\x1b\x6d\xb6\xdb\x6c\x00\x00\x6c\x00\x00'\ 59 | b'\x6e\x42\x6d\xb6\xd2\x49\x91\xb9\x1b\x6d\xb6\xdb\x03\x6d\x80\x00'\ 60 | b'\x00\x00\x00\x0d\xb6\x03\x6d\x80\x6e\x42\x6d\xb6\xd2\x49\x91\xb9'\ 61 | b'\x1b\x6d\xb6\xdb\x03\x6d\x80\x00\x00\x00\x00\x0d\xb6\x03\x6d\x80'\ 62 | b'\x6e\x49\x24\x92\xd2\x49\x91\xb9\x1b\x6d\xb6\xc0\xdb\x6d\xb6\xd8'\ 63 | b'\x0d\xb6\x03\x6d\x80\xdb\x60\x36\x6e\x49\x24\x92\xd2\x49\x91\xb9'\ 64 | b'\x1b\x6d\xb6\xc0\xdb\x6d\xb6\xd8\x0d\xb6\x03\x6d\x80\xdb\x60\x36'\ 65 | b'\x6e\x49\x24\x26\x42\x49\x91\xb9\x1b\x6d\xb6\xc0\xdb\x6d\xb6\x03'\ 66 | b'\x6d\x80\xdb\x60\x36\xd8\x0d\xb6\x6e\x49\x24\x26\x42\x49\x91\xb9'\ 67 | b'\x1b\x6d\xb6\xc0\xdb\x6d\xb6\x03\x6d\x80\xdb\x60\x36\xd8\x0d\xb6'\ 68 | b'\x6e\x49\x24\x92\x49\x24\x91\xb9\x24\x6c\x06\xc0\xdb\x6d\xb6\xdb'\ 69 | b'\x60\x36\xd8\x0d\xb6\x03\x6d\x80\x6e\x49\x24\x92\x49\x24\x91\xb9'\ 70 | b'\x24\x6c\x06\xc0\xdb\x6d\xb6\xdb\x60\x36\xd8\x0d\xb6\x03\x6d\x80'\ 71 | b'\x6e\x49\x24\x26\x49\x24\x91\xb9\x24\x6d\xb6\xdb\x03\x6d\xb6\xdb'\ 72 | b'\x6d\xb6\xdb\x6d\x80\xdb\x6d\x80\x6e\x49\x24\x26\x49\x24\x91\xb9'\ 73 | b'\x24\x6d\xb6\xdb\x03\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x80\xdb\x6d\x80'\ 74 | b'\x6e\x49\x24\x92\x49\x24\x91\xb9\x24\x6c\x06\xdb\x6c\x0d\xb6\xdb'\ 75 | b'\x6d\x80\xdb\x6d\xb6\xdb\x60\x00\x6e\x49\x24\x92\x49\x24\x91\xb9'\ 76 | b'\x24\x6c\x06\xdb\x6c\x0d\xb6\xdb\x6d\x80\xdb\x6d\xb6\xdb\x60\x00'\ 77 | b'\x6e\x49\x24\x26\x49\x24\x91\xb9\x24\x91\xb0\x00\x6d\xb0\x36\xdb'\ 78 | b'\x6d\xb6\xd8\x0d\xb6\xdb\x60\x00\x6e\x49\x24\x26\x49\x24\x91\xb9'\ 79 | b'\x24\x91\xb0\x00\x6d\xb0\x36\xdb\x6d\xb6\xd8\x0d\xb6\xdb\x60\x00'\ 80 | b'\x6e\x49\x24\x92\x49\x24\x91\xb9\x24\x92\x46\xdb\x6d\xb6\xc0\xdb'\ 81 | b'\x6d\xb6\xdb\x6d\xb6\xd8\x00\x00\x6e\x49\x24\x92\x49\x24\x91\xb9'\ 82 | b'\x24\x92\x46\xdb\x6d\xb6\xc0\xdb\x6d\xb6\xdb\x6d\xb6\xd8\x00\x00'\ 83 | b'\x6e\x49\x24\x26\x49\x24\x91\xb9\x24\x92\x49\x24\x92\x49\x24\x03'\ 84 | b'\x6d\xb6\xdb\x6d\xb6\x00\x00\x00\x6e\x49\x24\x26\x49\x24\x91\xb9'\ 85 | b'\x24\x92\x49\x24\x92\x49\x24\x03\x6d\xb6\xdb\x6d\xb6\x00\x00\x00'\ 86 | b'\x6e\x49\x24\x92\x49\x24\x91\xb9\x24\x92\x49\x24\x92\x49\x24\x90'\ 87 | b'\x0d\xb6\xdb\x6d\x80\x00\x00\x00\x6e\x49\x24\x92\x49\x24\x91\xb9'\ 88 | b'\x24\x92\x49\x24\x92\x49\x24\x90\x0d\xb6\xdb\x6d\x80\x00\x00\x00'\ 89 | b'\x01\xb9\x24\x92\x49\x24\x91\xb9\x24\x92\x49\x24\x92\x49\x24\x6d'\ 90 | b'\xb0\x00\xdb\x60\x00\x00\x00\x00\x01\xb9\x24\x92\x49\x24\x91\xb9'\ 91 | b'\x24\x92\x49\x24\x92\x49\x24\x6d\xb0\x00\xdb\x60\x00\x00\x00\x00'\ 92 | b'\x00\x06\xe4\x92\x49\x24\x91\xb9\x24\x92\x49\x24\x92\x46\xdb\x00'\ 93 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xe4\x92\x49\x24\x91\xb9'\ 94 | b'\x24\x92\x49\x24\x92\x46\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 95 | b'\x00\x00\x1b\x6e\x49\x24\x91\xb9\x24\x92\x49\x1b\x6d\xb0\x00\x00'\ 96 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1b\x6e\x49\x24\x91\xb9'\ 97 | b'\x24\x92\x49\x1b\x6d\xb0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 98 | b'\x00\x00\x00\x01\xb6\xe4\x91\xb9\x24\x6d\xb6\xc0\x00\x00\x00\x00'\ 99 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xb6\xe4\x91\xb9'\ 100 | b'\x24\x6d\xb6\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 101 | b'\x00\x00\x00\x00\x00\x1b\x6d\xb6\xdb\x00\x00\x00\x00\x00\x00\x00'\ 102 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1b\x6d\xb6'\ 103 | b'\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' 104 | BITMAP = memoryview(_bitmap) 105 | -------------------------------------------------------------------------------- /examples/M5CORE2/toasters/t4.py: -------------------------------------------------------------------------------- 1 | HEIGHT = 64 2 | WIDTH = 64 3 | COLORS = 8 4 | BITS = 12288 5 | BPP = 3 6 | PALETTE = [0x0000,0xffff,0xb6b5,0x00b0,0x6d6b,0x4082,0x494a,0x2000] 7 | _bitmap =\ 8 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 9 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 10 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 11 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 12 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 13 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 14 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 15 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 16 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 17 | b'\x00\x00\x00\x00\x00\x00\x00\x02\x49\x00\x00\x00\x49\x24\x92\x00'\ 18 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02'\ 19 | b'\x49\x00\x00\x00\x49\x24\x92\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 20 | b'\x00\x00\x00\x00\x00\x00\x24\x92\x49\x01\x24\x92\x49\x24\x92\x49'\ 21 | b'\x24\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92'\ 22 | b'\x49\x01\x24\x92\x49\x24\x92\x49\x24\x80\x00\x00\x00\x00\x00\x00'\ 23 | b'\x00\x00\x00\x00\x00\x09\x24\x04\x92\x49\x20\x00\x01\xb6\xdb\x6d'\ 24 | b'\x24\x92\x48\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x24\x04'\ 25 | b'\x92\x49\x20\x00\x01\xb6\xdb\x6d\x24\x92\x48\x00\x00\x00\x00\x00'\ 26 | b'\x00\x00\x00\x00\x02\x49\x49\x24\x80\x00\x06\xdb\x6d\x24\x92\x49'\ 27 | b'\x24\x92\x49\x24\x80\x00\x00\x00\x00\x00\x00\x00\x02\x49\x49\x24'\ 28 | b'\x80\x00\x06\xdb\x6d\x24\x92\x49\x24\x92\x49\x24\x80\x00\x00\x00'\ 29 | b'\x00\x00\x00\x00\x94\x92\x48\x00\x00\x6d\xb4\x92\x49\x20\x00\x01'\ 30 | b'\xb6\xdb\x6d\x24\xa4\x00\x00\x00\x00\x00\x00\x00\x94\x92\x48\x00'\ 31 | b'\x00\x6d\xb4\x92\x49\x20\x00\x01\xb6\xdb\x6d\x24\xa4\x00\x00\x00'\ 32 | b'\x00\x00\x00\x49\x24\x80\x00\x06\xdb\x49\x24\x80\x00\x06\xdb\x6d'\ 33 | b'\x24\x92\x49\x24\xa4\x90\x00\x00\x00\x00\x00\x49\x24\x80\x00\x06'\ 34 | b'\xdb\x49\x24\x80\x00\x06\xdb\x6d\x24\x92\x49\x24\xa4\x90\x00\x00'\ 35 | b'\x00\x00\x12\x48\x00\x00\x6d\xb4\x92\x48\x00\x00\x6d\xb4\x92\x49'\ 36 | b'\x29\x00\x00\x00\x24\x90\x00\x00\x00\x00\x12\x48\x00\x00\x6d\xb4'\ 37 | b'\x92\x48\x00\x00\x6d\xb4\x92\x49\x29\x00\x00\x00\x24\x90\x00\x00'\ 38 | b'\x00\x04\x92\x00\x00\x1b\x49\x24\x80\x00\x06\xdb\x49\x24\xa4\x90'\ 39 | b'\x00\x24\x92\x49\x00\x90\x00\x00\x00\x04\x92\x00\x00\x1b\x49\x24'\ 40 | b'\x80\x00\x06\xdb\x49\x24\xa4\x90\x00\x24\x92\x49\x00\x90\x00\x00'\ 41 | b'\x01\x24\x80\x00\x06\xd2\x48\x00\x00\x6d\xb4\x92\x4a\x49\x24\x92'\ 42 | b'\x49\x24\x92\x49\x24\x90\x00\x00\x01\x24\x80\x00\x06\xd2\x48\x00'\ 43 | b'\x00\x6d\xb4\x92\x4a\x49\x24\x92\x49\x24\x92\x49\x24\x90\x00\x00'\ 44 | b'\x01\x24\x92\x49\xb4\x92\x00\x00\x1b\x49\x24\xa4\x92\x49\x24\x90'\ 45 | b'\x00\x00\x00\x00\x00\x90\x00\x00\x01\x24\x92\x49\xb4\x92\x00\x00'\ 46 | b'\x1b\x49\x24\xa4\x92\x49\x24\x90\x00\x00\x00\x00\x00\x90\x00\x00'\ 47 | b'\x92\xdb\x52\x49\x24\x80\x00\x06\xd2\x4b\x69\x24\x92\x49\x00\x00'\ 48 | b'\x92\x49\x24\x92\x49\x00\x00\x00\x92\xdb\x52\x49\x24\x80\x00\x06'\ 49 | b'\xd2\x4b\x69\x24\x92\x49\x00\x00\x92\x49\x24\x92\x49\x00\x00\x00'\ 50 | b'\x92\xdb\x6d\xb5\x24\x92\x49\xb4\x92\xda\x49\x24\x92\x40\x09\x24'\ 51 | b'\x92\x49\x00\x92\x49\x24\x92\x49\x92\xdb\x6d\xb5\x24\x92\x49\xb4'\ 52 | b'\x92\xda\x49\x24\x92\x40\x09\x24\x92\x49\x00\x92\x49\x24\x92\x49'\ 53 | b'\x92\xd4\x92\xb6\xdb\x52\x49\x24\xb6\x92\x49\x24\x90\x02\x49\x24'\ 54 | b'\x92\x49\x24\x90\x09\x00\x90\x00\x92\xd4\x92\xb6\xdb\x52\x49\x24'\ 55 | b'\xb6\x92\x49\x24\x90\x02\x49\x24\x92\x49\x24\x90\x09\x00\x90\x00'\ 56 | b'\x92\xd4\xb6\x49\x2b\x6d\xb6\x49\x36\x92\x49\x24\x00\x92\x49\x24'\ 57 | b'\x92\x40\x24\x92\x49\x24\x92\x49\x92\xd4\xb6\x49\x2b\x6d\xb6\x49'\ 58 | b'\x36\x92\x49\x24\x00\x92\x49\x24\x92\x40\x24\x92\x49\x24\x92\x49'\ 59 | b'\x92\xd4\xb6\xdb\x64\x92\xb6\x4b\x64\x92\x49\x24\x00\x92\x49\x24'\ 60 | b'\x92\x49\x24\x02\x40\x00\x92\x40\x92\xd4\xb6\xdb\x64\x92\xb6\x4b'\ 61 | b'\x64\x92\x49\x24\x00\x92\x49\x24\x92\x49\x24\x02\x40\x00\x92\x40'\ 62 | b'\x92\xdb\x6d\xb7\x64\x92\xb6\x4b\x64\x92\x49\x00\x24\x92\x49\x24'\ 63 | b'\x90\x09\x24\x92\x49\x24\x00\x00\x92\xdb\x6d\xb7\x64\x92\xb6\x4b'\ 64 | b'\x64\x92\x49\x00\x24\x92\x49\x24\x90\x09\x24\x92\x49\x24\x00\x00'\ 65 | b'\x92\xdb\x6d\x4a\xd4\x92\xb6\x4b\x64\x92\x49\x00\x24\x90\x09\x00'\ 66 | b'\x92\x49\x00\x90\x2d\xb4\x00\x00\x92\xdb\x6d\x4a\xd4\x92\xb6\x4b'\ 67 | b'\x64\x92\x49\x00\x24\x90\x09\x00\x92\x49\x00\x90\x2d\xb4\x00\x00'\ 68 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\x90\x09\x00\x24\x92\x49\x00'\ 69 | b'\x00\x00\x00\x00\x2d\x90\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 70 | b'\x6d\x90\x09\x00\x24\x92\x49\x00\x00\x00\x00\x00\x2d\x90\x00\x00'\ 71 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\x92\x49\x24\x00\x92\x40\x92'\ 72 | b'\x49\x24\x92\xdb\x6d\xb4\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 73 | b'\x6d\x92\x49\x24\x00\x92\x40\x92\x49\x24\x92\xdb\x6d\xb4\x00\x00'\ 74 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\x90\x09\x24\x90\x00\x24\x92'\ 75 | b'\x49\x24\xb6\xdb\x6d\x90\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 76 | b'\x6d\x90\x09\x24\x90\x00\x24\x92\x49\x24\xb6\xdb\x6d\x90\x00\x00'\ 77 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\xb6\x40\x00\x92\x49\x24\x92'\ 78 | b'\x4b\x6d\xb6\xdb\x64\x00\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 79 | b'\x6d\xb6\x40\x00\x92\x49\x24\x92\x4b\x6d\xb6\xdb\x64\x00\x00\x00'\ 80 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xd9\x24\x92\x49\x24\xb6'\ 81 | b'\xdb\x6d\xb6\xd9\x00\x00\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 82 | b'\x6d\xb6\xd9\x24\x92\x49\x24\xb6\xdb\x6d\xb6\xd9\x00\x00\x00\x00'\ 83 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6'\ 84 | b'\xdb\x6d\x92\x40\x00\x00\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 85 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92\x40\x00\x00\x00\x00'\ 86 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6'\ 87 | b'\xd9\x24\x00\x00\x00\x00\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 88 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00\x00\x00\x00\x00\x00'\ 89 | b'\x02\x4b\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92'\ 90 | b'\x40\x00\x00\x00\x00\x00\x00\x00\x02\x4b\x6d\xb6\xdb\x6d\xb6\x4b'\ 91 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92\x40\x00\x00\x00\x00\x00\x00\x00'\ 92 | b'\x00\x09\x2d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00'\ 93 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x2d\xb6\xdb\x6d\xb6\x4b'\ 94 | b'\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 95 | b'\x00\x00\x24\x92\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x64\x92\x40\x00\x00'\ 96 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92\xdb\x6d\xb6\x4b'\ 97 | b'\x6d\xb6\xdb\x64\x92\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 98 | b'\x00\x00\x00\x02\x49\x2d\xb6\x4b\x6d\x92\x49\x00\x00\x00\x00\x00'\ 99 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x49\x2d\xb6\x4b'\ 100 | b'\x6d\x92\x49\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 101 | b'\x00\x00\x00\x00\x00\x24\x92\x49\x24\x00\x00\x00\x00\x00\x00\x00'\ 102 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92\x49'\ 103 | b'\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' 104 | BITMAP = memoryview(_bitmap) 105 | -------------------------------------------------------------------------------- /examples/M5CORE2/toasters/t5.py: -------------------------------------------------------------------------------- 1 | HEIGHT = 64 2 | WIDTH = 64 3 | COLORS = 8 4 | BITS = 12288 5 | BPP = 3 6 | PALETTE = [0x0000,0x4049,0x609b,0x4082,0xe0ff,0xffff,0x2000,0x2000] 7 | _bitmap =\ 8 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 9 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 10 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 11 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 12 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 13 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 14 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 15 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 16 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 17 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 18 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 19 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 20 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 21 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 22 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 23 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 24 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 25 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 26 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 27 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 28 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 29 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 30 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 31 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 32 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 33 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 34 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 35 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 36 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 37 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 38 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x49\x24\x92\x40\x00'\ 39 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 40 | b'\x00\x00\x02\x49\x24\x92\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 41 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x94\x92\x49\x24\x89\x24'\ 42 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 43 | b'\x00\x24\x94\x92\x49\x24\x89\x24\x00\x00\x00\x00\x00\x00\x00\x00'\ 44 | b'\x00\x00\x00\x00\x00\x00\x00\x02\x49\x49\x24\x92\x49\x24\x9b\x48'\ 45 | b'\x92\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02'\ 46 | b'\x49\x49\x24\x92\x49\x24\x9b\x48\x92\x40\x00\x00\x00\x00\x00\x00'\ 47 | b'\x00\x00\x00\x00\x00\x00\x24\x94\x92\x49\x24\x9b\x49\x24\x92\x49'\ 48 | b'\x24\x89\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x94'\ 49 | b'\x92\x49\x24\x9b\x49\x24\x92\x49\x24\x89\x00\x00\x00\x00\x00\x00'\ 50 | b'\x00\x00\x00\x00\x02\x49\x49\x24\x92\x6d\x24\x92\x49\x24\x92\x6d'\ 51 | b'\x24\x92\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x49\x49\x24'\ 52 | b'\x92\x6d\x24\x92\x49\x24\x92\x6d\x24\x92\x24\x00\x00\x00\x00\x00'\ 53 | b'\x00\x00\x00\x24\x94\x92\x49\x24\x9b\x49\x24\x92\x49\x26\xd2\x49'\ 54 | b'\x24\x92\x48\x92\x40\x00\x00\x00\x00\x00\x00\x24\x94\x92\x49\x24'\ 55 | b'\x9b\x49\x24\x92\x49\x26\xd2\x49\x24\x92\x48\x92\x40\x00\x00\x00'\ 56 | b'\x00\x02\x49\x49\x24\x92\x49\x26\xdb\x49\x24\x9b\x4a\x44\x9b\x91'\ 57 | b'\x24\x92\x49\x24\x89\x00\x00\x00\x00\x02\x49\x49\x24\x92\x49\x26'\ 58 | b'\xdb\x49\x24\x9b\x4a\x44\x9b\x91\x24\x92\x49\x24\x89\x00\x00\x00'\ 59 | b'\x00\x94\x92\x49\x24\x92\x49\x29\x12\x91\x29\x1b\x49\x24\x92\x6d'\ 60 | b'\x24\x92\x49\x24\x92\x24\x00\x00\x00\x94\x92\x49\x24\x92\x49\x29'\ 61 | b'\x12\x91\x29\x1b\x49\x24\x92\x6d\x24\x92\x49\x24\x92\x24\x00\x00'\ 62 | b'\x6c\x94\x9b\x49\x26\xd2\x49\x24\x92\x49\xb4\xa4\x49\xb4\x92\x49'\ 63 | b'\xb4\x92\x49\x24\x92\x48\x90\x00\x6c\x94\x9b\x49\x26\xd2\x49\x24'\ 64 | b'\x92\x49\xb4\xa4\x49\xb4\x92\x49\xb4\x92\x49\x24\x92\x48\x90\x00'\ 65 | b'\x6d\xb2\x52\x49\x24\x92\x49\xb4\x92\x49\x24\x9b\x49\xb4\x92\x49'\ 66 | b'\xb4\x92\x49\x24\x92\x49\x22\x40\x6d\xb2\x52\x49\x24\x92\x49\xb4'\ 67 | b'\x92\x49\x24\x9b\x49\xb4\x92\x49\xb4\x92\x49\x24\x92\x49\x22\x40'\ 68 | b'\x6d\xb6\xc9\x25\x24\x92\x6d\x26\xd2\x49\x24\x9b\x6d\x24\x92\x49'\ 69 | b'\xb6\xd2\x49\x24\x92\x49\x22\x49\x6d\xb6\xc9\x25\x24\x92\x6d\x26'\ 70 | b'\xd2\x49\x24\x9b\x6d\x24\x92\x49\xb6\xd2\x49\x24\x92\x49\x22\x49'\ 71 | b'\x6d\xb6\xdb\x6c\x96\xd2\x49\x24\x92\x49\x29\x12\x6d\xb4\xa4\x49'\ 72 | b'\x24\x92\x49\xb4\x92\x24\x96\xdb\x6d\xb6\xdb\x6c\x96\xd2\x49\x24'\ 73 | b'\x92\x49\x29\x12\x6d\xb4\xa4\x49\x24\x92\x49\xb4\x92\x24\x96\xdb'\ 74 | b'\x01\xb6\xdb\x6d\xb6\xc9\x25\x24\x92\x49\x24\x92\x49\xb4\x92\x49'\ 75 | b'\x24\x92\x49\x24\x89\x6d\xb6\xdb\x01\xb6\xdb\x6d\xb6\xc9\x25\x24'\ 76 | b'\x92\x49\x24\x92\x49\xb4\x92\x49\x24\x92\x49\x24\x89\x6d\xb6\xdb'\ 77 | b'\x00\x06\xdb\x6d\xb6\xdb\x6c\x92\x52\x49\x24\x92\x49\x24\x92\x49'\ 78 | b'\x24\x92\x24\x92\x5b\x6d\xb6\xdb\x00\x06\xdb\x6d\xb6\xdb\x6c\x92'\ 79 | b'\x52\x49\x24\x92\x49\x24\x92\x49\x24\x92\x24\x92\x5b\x6d\xb6\xdb'\ 80 | b'\x00\x00\x1b\x6d\xb6\xdb\x6d\xb6\xc9\x25\x26\xd2\x49\x24\x92\x49'\ 81 | b'\xb2\x49\x6d\xb6\xdb\x6d\xb6\xdb\x00\x00\x1b\x6d\xb6\xdb\x6d\xb6'\ 82 | b'\xc9\x25\x26\xd2\x49\x24\x92\x49\xb2\x49\x6d\xb6\xdb\x6d\xb6\xdb'\ 83 | b'\x00\x00\x00\x01\xb6\xdb\x6d\xb6\xdb\x6c\x94\x92\x49\x24\x89\x24'\ 84 | b'\x96\xdb\x6d\xb6\xdb\x6d\xb0\x00\x00\x00\x00\x01\xb6\xdb\x6d\xb6'\ 85 | b'\xdb\x6c\x94\x92\x49\x24\x89\x24\x96\xdb\x6d\xb6\xdb\x6d\xb0\x00'\ 86 | b'\x00\x00\x00\x00\x00\x1b\x6d\xb6\xdb\x6d\xb2\x49\x24\x92\x5b\x6d'\ 87 | b'\xb6\xdb\x6d\xb6\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x1b\x6d\xb6'\ 88 | b'\xdb\x6d\xb2\x49\x24\x92\x5b\x6d\xb6\xdb\x6d\xb6\xdb\x00\x00\x00'\ 89 | b'\x00\x00\x00\x00\x00\x00\x01\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6d'\ 90 | b'\xb6\xdb\x6d\xb6\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xb6'\ 91 | b'\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xc0\x00\x00\x00'\ 92 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x1b\x6d\xb6\xdb\x6d\xb6\xdb\x6d'\ 93 | b'\xb6\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 94 | b'\x1b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x00\x00\x00\x00\x00\x00'\ 95 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6d\xb6\xdb\x6d\xb6\xdb\x6d'\ 96 | b'\xb0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 97 | b'\x00\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb0\x00\x00\x00\x00\x00\x00\x00'\ 98 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xdb\x6d\xb6\xc0\x00'\ 99 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 100 | b'\x00\x00\x06\xdb\x6d\xb6\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 101 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 102 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 103 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' 104 | BITMAP = memoryview(_bitmap) 105 | -------------------------------------------------------------------------------- /examples/M5CORE2/toasters/toasters.py: -------------------------------------------------------------------------------- 1 | ''' 2 | toasters.py 3 | 4 | An example using bitmap to draw sprites on the 5 | M5Stack Core Display. 6 | 7 | youtube video: https://youtu.be/0uWsjKQmCpU 8 | 9 | spritesheet from CircuitPython_Flying_Toasters 10 | https://learn.adafruit.com/circuitpython-sprite-animation-pendant-mario-clouds-flying-toasters 11 | ''' 12 | 13 | import time 14 | import random 15 | from machine import Pin, SPI 16 | import ili9342c 17 | import axp202c 18 | import t1 19 | import t2 20 | import t3 21 | import t4 22 | import t5 23 | 24 | TOASTERS = [t1, t2, t3, t4] 25 | TOAST = [t5] 26 | 27 | 28 | class toast(): 29 | ''' 30 | toast class to keep track of a sprites locaton and step 31 | ''' 32 | def __init__(self, sprites, x, y): 33 | self.sprites = sprites 34 | self.steps = len(sprites) 35 | self.x = x 36 | self.y = y 37 | self.step = random.randint(0, self.steps-1) 38 | self.speed = random.randint(2, 5) 39 | 40 | def move(self): 41 | if self.x <= 0: 42 | self.speed = random.randint(2, 5) 43 | self.x = 320-64 44 | 45 | self.step += 1 46 | self.step %= self.steps 47 | self.x -= self.speed 48 | 49 | 50 | def main(): 51 | ''' 52 | Draw and move sprite 53 | ''' 54 | try: 55 | # Turn display power 56 | axp = axp202c.PMU(address=0x34) 57 | axp.enablePower(axp202c.AXP192_LDO2) 58 | # Set backlight voltage 59 | axp.setDC3Voltage(3000) 60 | 61 | spi = SPI( 62 | 2, 63 | baudrate=60000000, 64 | sck=Pin(18), 65 | mosi=Pin(23)) 66 | 67 | # initialize display 68 | 69 | tft = ili9342c.ILI9342C( 70 | spi, 71 | 320, 72 | 240, 73 | reset=Pin(33, Pin.OUT), 74 | cs=Pin(5, Pin.OUT), 75 | dc=Pin(15, Pin.OUT), 76 | rotation=0) 77 | 78 | # enable display and clear screen 79 | tft.init() 80 | tft.fill(ili9342c.BLACK) 81 | 82 | # create toast spites in random positions 83 | sprites = [ 84 | toast(TOASTERS, 320-64, 0), 85 | toast(TOAST, 320-64*2, 80), 86 | toast(TOASTERS, 320-64*4, 160) 87 | ] 88 | 89 | # move and draw sprites 90 | while True: 91 | for man in sprites: 92 | bitmap = man.sprites[man.step] 93 | tft.fill_rect( 94 | man.x+bitmap.WIDTH-man.speed, 95 | man.y, 96 | man.speed, 97 | bitmap.HEIGHT, 98 | ili9342c.BLACK) 99 | 100 | man.move() 101 | 102 | if man.x > 0: 103 | tft.bitmap(bitmap, man.x, man.y) 104 | else: 105 | tft.fill_rect( 106 | 0, 107 | man.y, 108 | bitmap.WIDTH, 109 | bitmap.HEIGHT, 110 | ili9342c.BLACK) 111 | 112 | finally: 113 | # shutdown spi 114 | if 'spi' in locals(): 115 | spi.deinit() 116 | 117 | 118 | main() -------------------------------------------------------------------------------- /examples/M5STACK/bbbunny/bbbunny.py: -------------------------------------------------------------------------------- 1 | ''' 2 | jpegtest.py 3 | 4 | Draw a full screen jpg using the slower but less memory intensive method of blitting 5 | each Minimum Coded Unit (MCU) block. Usually 8×8pixels but can be other multiples of 8. 6 | 7 | bigbuckbunny.jpg (c) copyright 2008, Blender Foundation / www.bigbuckbunny.org 8 | ''' 9 | 10 | import gc 11 | import time 12 | import random 13 | from machine import Pin, SPI 14 | import ili9342c 15 | 16 | gc.enable() 17 | gc.collect() 18 | 19 | 20 | def main(): 21 | ''' 22 | Decode and draw the jpg on the display 23 | ''' 24 | try: 25 | 26 | # initialize display 27 | 28 | tft = ili9342c.ILI9342C( 29 | SPI(2, baudrate=60000000, sck=Pin(18), mosi=Pin(23)), 30 | 320, 31 | 240, 32 | reset=Pin(33, Pin.OUT), 33 | cs=Pin(14, Pin.OUT), 34 | dc=Pin(27, Pin.OUT), 35 | backlight=Pin(32, Pin.OUT), 36 | rotation=0) 37 | 38 | # enable display and clear screen 39 | tft.init() 40 | 41 | # display jpg 42 | tft.jpg("bigbuckbunny.jpg", 0, 0, ili9342c.SLOW) 43 | 44 | finally: 45 | # shutdown spi 46 | if 'spi' in locals(): 47 | spi.deinit() 48 | 49 | main() 50 | -------------------------------------------------------------------------------- /examples/M5STACK/bbbunny/bigbuckbunny.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/examples/M5STACK/bbbunny/bigbuckbunny.jpg -------------------------------------------------------------------------------- /examples/M5STACK/bitarray.py: -------------------------------------------------------------------------------- 1 | ''' 2 | bitarray.py 3 | 4 | An example using map_bitarray_to_rgb565 to draw sprites on the 5 | M5Stack Core Display. 6 | 7 | ''' 8 | 9 | import time 10 | import random 11 | from machine import Pin, SPI 12 | import ili9342c 13 | 14 | SPRITES = 100 15 | 16 | SPRITE_WIDTH = 16 17 | SPRITE_HEIGHT = 16 18 | SPRITE_STEPS = 3 19 | SPRITE_BITMAPS = [ 20 | bytearray([ 21 | 0b00000000, 0b00000000, 22 | 0b00000001, 0b11110000, 23 | 0b00000111, 0b11110000, 24 | 0b00001111, 0b11100000, 25 | 0b00001111, 0b11000000, 26 | 0b00011111, 0b10000000, 27 | 0b00011111, 0b00000000, 28 | 0b00011110, 0b00000000, 29 | 0b00011111, 0b00000000, 30 | 0b00011111, 0b10000000, 31 | 0b00001111, 0b11000000, 32 | 0b00001111, 0b11100000, 33 | 0b00000111, 0b11110000, 34 | 0b00000001, 0b11110000, 35 | 0b00000000, 0b00000000, 36 | 0b00000000, 0b00000000]), 37 | 38 | bytearray([ 39 | 0b00000000, 0b00000000, 40 | 0b00000011, 0b11100000, 41 | 0b00001111, 0b11111000, 42 | 0b00011111, 0b11111100, 43 | 0b00011111, 0b11111100, 44 | 0b00111111, 0b11110000, 45 | 0b00111111, 0b10000000, 46 | 0b00111100, 0b00000000, 47 | 0b00111111, 0b10000000, 48 | 0b00111111, 0b11110000, 49 | 0b00011111, 0b11111100, 50 | 0b00011111, 0b11111100, 51 | 0b00001111, 0b11111000, 52 | 0b00000011, 0b11100000, 53 | 0b00000000, 0b00000000, 54 | 0b00000000, 0b00000000]), 55 | 56 | bytearray([ 57 | 0b00000000, 0b00000000, 58 | 0b00000111, 0b11000000, 59 | 0b00011111, 0b11110000, 60 | 0b00111111, 0b11111000, 61 | 0b00111111, 0b11111000, 62 | 0b01111111, 0b11111100, 63 | 0b01111111, 0b11111100, 64 | 0b01111111, 0b11111100, 65 | 0b01111111, 0b11111100, 66 | 0b01111111, 0b11111100, 67 | 0b00111111, 0b11111000, 68 | 0b00111111, 0b11111000, 69 | 0b00011111, 0b11110000, 70 | 0b00000111, 0b11000000, 71 | 0b00000000, 0b00000000, 72 | 0b00000000, 0b00000000]), 73 | 74 | bytearray([ 75 | 0b00000000, 0b00000000, 76 | 0b00000000, 0b00000000, 77 | 0b00000000, 0b00000000, 78 | 0b00000000, 0b00000000, 79 | 0b00000000, 0b00000000, 80 | 0b00000000, 0b00000000, 81 | 0b00000000, 0b00000000, 82 | 0b00000000, 0b00000000, 83 | 0b00000000, 0b00000000, 84 | 0b00000000, 0b00000000, 85 | 0b00000000, 0b00000000, 86 | 0b00000000, 0b00000000, 87 | 0b00000000, 0b00000000, 88 | 0b00000000, 0b00000000, 89 | 0b00000000, 0b00000000, 90 | 0b00000000, 0b00000000])] 91 | 92 | 93 | class pacman(): 94 | ''' 95 | pacman class to keep track of a sprites locaton and step 96 | ''' 97 | def __init__(self, x, y, step): 98 | self.x = x 99 | self.y = y 100 | self.step = step 101 | 102 | def move(self): 103 | self.step += 1 104 | self.step %= SPRITE_STEPS 105 | self.x += 1 106 | if self.x == 302: 107 | self.step = SPRITE_STEPS 108 | 109 | self.x %= 303 110 | 111 | def main(): 112 | ''' 113 | Draw on screen using map_bitarray_to_rgb565 114 | ''' 115 | try: 116 | 117 | # initialize display 118 | 119 | tft = ili9342c.ILI9342C( 120 | SPI( 121 | 2, 122 | baudrate=60000000, 123 | polarity=1, 124 | phase=1, 125 | sck=Pin(18), 126 | mosi=Pin(23)), 127 | 320, 128 | 240, 129 | reset=Pin(33, Pin.OUT), 130 | cs=Pin(14, Pin.OUT), 131 | dc=Pin(27, Pin.OUT), 132 | backlight=Pin(32, Pin.OUT), 133 | rotation=0, 134 | buffer_size=16*16*2) 135 | 136 | # enable display and clear screen 137 | tft.init() 138 | tft.fill(ili9342c.BLACK) 139 | time.sleep(1) 140 | 141 | sprite = bytearray(512) 142 | 143 | # create pacman spites in random positions 144 | sprites = [] 145 | for man in range(SPRITES): 146 | sprites.append( 147 | pacman( 148 | random.randint(0, tft.width()-SPRITE_WIDTH), 149 | random.randint(0, tft.height()-SPRITE_HEIGHT), 150 | random.randint(0, SPRITE_STEPS-1) 151 | ) 152 | ) 153 | 154 | # move and draw sprites 155 | while True: 156 | for man in sprites: 157 | # move the sprite 158 | man.move() 159 | 160 | # convert bitmap into rgb565 blitable buffer 161 | 162 | tft.map_bitarray_to_rgb565( 163 | SPRITE_BITMAPS[man.step], 164 | sprite, 165 | SPRITE_WIDTH, 166 | ili9342c.YELLOW, 167 | ili9342c.BLACK) 168 | 169 | # blit the buffer to the display 170 | tft.blit_buffer( 171 | sprite, 172 | man.x, 173 | man.y, 174 | SPRITE_WIDTH, 175 | SPRITE_HEIGHT) 176 | 177 | time.sleep(0.1) 178 | 179 | finally: 180 | # shutdown spi 181 | if 'spi' in locals(): 182 | spi.deinit() 183 | 184 | main() 185 | -------------------------------------------------------------------------------- /examples/M5STACK/fonts.py: -------------------------------------------------------------------------------- 1 | """ 2 | fonts.py 3 | 4 | Pages through all characters of four fonts on the M5Stack Display. 5 | 6 | """ 7 | import utime 8 | import random 9 | from machine import Pin, SPI 10 | import ili9342c 11 | 12 | import vga1_8x8 as font1 13 | import vga1_8x16 as font2 14 | import vga1_bold_16x16 as font3 15 | import vga1_bold_16x32 as font4 16 | 17 | 18 | def main(): 19 | tft = ili9342c.ILI9342C( 20 | SPI( 21 | 2, 22 | baudrate=60000000, 23 | polarity=1, 24 | phase=1, 25 | sck=Pin(18), 26 | mosi=Pin(23)), 27 | 320, 28 | 240, 29 | reset=Pin(33, Pin.OUT), 30 | cs=Pin(14, Pin.OUT), 31 | dc=Pin(27, Pin.OUT), 32 | backlight=Pin(32, Pin.OUT), 33 | rotation=0, 34 | buffer_size=16*32*2) 35 | 36 | tft.init() 37 | tft.fill(ili9342c.BLACK) 38 | utime.sleep(1) 39 | 40 | while True: 41 | for font in (font1, font2, font3, font4): 42 | tft.fill(ili9342c.BLUE) 43 | line = 0 44 | col = 0 45 | for char in range(font.FIRST, font.LAST): 46 | 47 | tft.text( 48 | font, 49 | chr(char), 50 | col, 51 | line, 52 | ili9342c.WHITE, 53 | ili9342c.BLUE) 54 | 55 | col += font.WIDTH 56 | if col > tft.width() - font.WIDTH: 57 | col = 0 58 | line += font.HEIGHT 59 | 60 | if line > tft.height()-font.HEIGHT: 61 | utime.sleep(3) 62 | tft.fill(ili9342c.BLUE) 63 | line = 0 64 | col = 0 65 | 66 | utime.sleep(3) 67 | main() 68 | -------------------------------------------------------------------------------- /examples/M5STACK/hello.py: -------------------------------------------------------------------------------- 1 | """ 2 | hello.py 3 | 4 | Writes "Hello!" in random colors at random locations on a 5 | M5Stack core display. 6 | 7 | """ 8 | import time 9 | import random 10 | from machine import Pin, SPI 11 | 12 | import ili9342c 13 | import vga1_bold_16x32 as font 14 | 15 | 16 | def main(): 17 | tft = ili9342c.ILI9342C( 18 | SPI(2, baudrate=60000000, sck=Pin(18), mosi=Pin(23)), 19 | 320, 20 | 240, 21 | reset=Pin(33, Pin.OUT), 22 | cs=Pin(14, Pin.OUT), 23 | dc=Pin(27, Pin.OUT), 24 | backlight=Pin(32, Pin.OUT), 25 | rotation=0, 26 | buffer_size=16*32*2) 27 | 28 | tft.init() 29 | tft.fill(ili9342c.BLACK) 30 | time.sleep(1) 31 | 32 | while True: 33 | for rotation in range(4): 34 | tft.rotation(rotation) 35 | tft.fill(0) 36 | col_max = tft.width() - font.WIDTH*6 37 | row_max = tft.height() - font.HEIGHT 38 | 39 | for _ in range(1000): 40 | tft.text( 41 | font, 42 | "Hello!", 43 | random.randint(0, col_max), 44 | random.randint(0, row_max), 45 | ili9342c.color565( 46 | random.getrandbits(8), 47 | random.getrandbits(8), 48 | random.getrandbits(8)), 49 | ili9342c.color565( 50 | random.getrandbits(8), 51 | random.getrandbits(8), 52 | random.getrandbits(8)) 53 | ) 54 | 55 | 56 | main() 57 | -------------------------------------------------------------------------------- /examples/M5STACK/hershey.py: -------------------------------------------------------------------------------- 1 | ''' 2 | hershey.py 3 | Draw greetings on display cycling thru hershey fonts and colors 4 | ''' 5 | 6 | import sys 7 | import utime 8 | from machine import SPI, Pin 9 | import ili9342c 10 | import random 11 | 12 | # Load several frozen fonts from flash 13 | 14 | import gotheng 15 | import greeks 16 | import italicc 17 | import italiccs 18 | import meteo 19 | import music 20 | import romanc 21 | import romancs 22 | import romand 23 | import romanp 24 | import romans 25 | import romant 26 | import scriptc 27 | import scripts 28 | 29 | 30 | def cycle(p): 31 | ''' 32 | return the next item in a list 33 | ''' 34 | try: 35 | len(p) 36 | except TypeError: 37 | cache = [] 38 | for i in p: 39 | yield i 40 | cache.append(i) 41 | p = cache 42 | while p: 43 | yield from p 44 | 45 | 46 | COLORS = cycle([0xe000, 0xece0, 0xe7e0, 0x5e0, 0x00d3, 0x7030]) 47 | 48 | FONTS = cycle([ 49 | gotheng, greeks, italicc, italiccs, meteo, music, romanc, 50 | romancs, romand, romanp, romans, romant, scriptc, scripts]) 51 | 52 | GREETINGS = cycle([ 53 | "bonjour", "buenas noches", "buenos dias", 54 | "good day", "good morning", "hey", 55 | "hi-ya", "hi", "how are you", "how goes it", 56 | "howdy-do", "howdy", "shalom", "welcome", 57 | "what's happening", "what's up"]) 58 | 59 | 60 | def main(): 61 | ''' 62 | Draw greetings on display cycling thru hershey fonts and colors 63 | ''' 64 | try: 65 | tft = ili9342c.ILI9342C( 66 | SPI(2, baudrate=60000000, sck=Pin(18), mosi=Pin(23)), 67 | 320, 68 | 240, 69 | reset=Pin(33, Pin.OUT), 70 | cs=Pin(14, Pin.OUT), 71 | dc=Pin(27, Pin.OUT), 72 | backlight=Pin(32, Pin.OUT), 73 | rotation=0) 74 | 75 | tft.init() 76 | tft.fill(ili9342c.BLACK) 77 | height = tft.height() 78 | width = tft.width() 79 | row = 0 80 | 81 | while True: 82 | row += 32 83 | color = next(COLORS) 84 | tft.fill_rect(0, row-16, width, 32, ili9342c.BLACK) 85 | tft.draw(next(FONTS), next(GREETINGS), 0, row, color) 86 | 87 | if row > 192: 88 | row = 0 89 | 90 | utime.sleep(0.25) 91 | 92 | finally: 93 | # shutdown spi 94 | if 'spi' in locals(): 95 | spi.deinit() 96 | 97 | main() 98 | -------------------------------------------------------------------------------- /examples/M5STACK/mono_fonts/mono_fonts.py: -------------------------------------------------------------------------------- 1 | """ 2 | mono_fonts.py for monofont2bitmap converter and bitmap method. 3 | """ 4 | 5 | import time 6 | from machine import Pin, SPI 7 | import ili9342c 8 | import axp202c 9 | 10 | import inconsolata_16 as font_16 11 | import inconsolata_32 as font_32 12 | import inconsolata_64 as font_64 13 | 14 | 15 | def main(): 16 | fast = False 17 | 18 | def display_font(font): 19 | tft.fill(ili9342c.BLUE) 20 | column = 0 21 | row = 0 22 | for char in font.MAP: 23 | tft.bitmap(font, column, row, font.MAP.index(char)) 24 | column += font.WIDTH 25 | if column >= tft.width() - font.WIDTH: 26 | row += font.HEIGHT 27 | column = 0 28 | 29 | if row > tft.height() - font.HEIGHT: 30 | row = 0 31 | 32 | if not fast: 33 | time.sleep(0.05) 34 | 35 | tft = ili9342c.ILI9342C( 36 | SPI(2, baudrate=60000000, sck=Pin(18), mosi=Pin(23)), 37 | 320, 38 | 240, 39 | reset=Pin(33, Pin.OUT), 40 | cs=Pin(14, Pin.OUT), 41 | dc=Pin(27, Pin.OUT), 42 | backlight=Pin(32, Pin.OUT), 43 | rotation=0, 44 | buffer_size=66*32*2) 45 | 46 | tft.init() 47 | 48 | while True: 49 | for font in [font_16, font_32, font_64]: 50 | display_font(font) 51 | 52 | fast = not fast 53 | 54 | 55 | main() 56 | -------------------------------------------------------------------------------- /examples/M5STACK/noto_fonts.py: -------------------------------------------------------------------------------- 1 | """ 2 | noto_fonts Writes the names of three Noto fonts centered on the display 3 | using the font. The fonts were converted from True Type fonts using 4 | the font2bitmap utility. 5 | """ 6 | 7 | from machine import Pin, SPI 8 | import ili9342c 9 | 10 | import NotoSans_32 as noto_sans 11 | import NotoSerif_32 as noto_serif 12 | import NotoSansMono_32 as noto_mono 13 | 14 | 15 | def main(): 16 | 17 | def center(font, s, row, color=ili9342c.WHITE): 18 | screen = tft.width() # get screen width 19 | width = tft.write_len(font, s) # get the width of the string 20 | if width and width < screen: # if the string < display 21 | col = tft.width() // 2 - width // 2 # find the column to center 22 | else: # otherwise 23 | col = 0 # left justify 24 | 25 | tft.write(font, s, col, row, color) # and write the string 26 | 27 | tft = ili9342c.ILI9342C( 28 | SPI(2, baudrate=60000000, sck=Pin(18), mosi=Pin(23)), 29 | 320, 30 | 240, 31 | reset=Pin(33, Pin.OUT), 32 | cs=Pin(14, Pin.OUT), 33 | dc=Pin(27, Pin.OUT), 34 | backlight=Pin(32, Pin.OUT), 35 | rotation=0, 36 | buffer_size=16*32*2) 37 | 38 | tft.init() 39 | tft.fill(ili9342c.BLACK) 40 | 41 | # center the name of the first font, using the font 42 | row = 16 43 | center(noto_sans, "NotoSans", row, ili9342c.RED) 44 | row += noto_sans.HEIGHT 45 | 46 | # center the name of the second font, using the font 47 | center(noto_serif, "NotoSerif", row, ili9342c.GREEN) 48 | row += noto_serif.HEIGHT 49 | 50 | # center the name of the third font, using the font 51 | center(noto_mono, "NotoSansMono", row, ili9342c.BLUE) 52 | row += noto_mono.HEIGHT 53 | 54 | 55 | main() 56 | -------------------------------------------------------------------------------- /examples/M5STACK/prop_fonts/chango.py: -------------------------------------------------------------------------------- 1 | """ 2 | chango.py test for font2bitmap converter. 3 | """ 4 | 5 | from machine import Pin, SPI 6 | import ili9342c 7 | 8 | import chango_16 as font_16 9 | import chango_32 as font_32 10 | import chango_64 as font_64 11 | 12 | 13 | def main(): 14 | 15 | try: 16 | 17 | spi = SPI(2, baudrate=60000000, sck=Pin(18), mosi=Pin(23)) 18 | 19 | # initialize display 20 | tft = ili9342c.ILI9342C( 21 | spi, 22 | 320, 23 | 240, 24 | reset=Pin(33, Pin.OUT), 25 | cs=Pin(14, Pin.OUT), 26 | dc=Pin(27, Pin.OUT), 27 | backlight=Pin(32, Pin.OUT), 28 | rotation=0, 29 | buffer_size=64*64*2) 30 | 31 | # enable display and clear screen 32 | tft.init() 33 | tft.fill(ili9342c.BLACK) 34 | 35 | row = 0 36 | tft.write(font_16, "abcdefghijklmnopqrstuvwxyz", 0, row) 37 | row += font_16.HEIGHT 38 | 39 | tft.write(font_32, "abcdefghijklm", 0, row) 40 | row += font_32.HEIGHT 41 | 42 | tft.write(font_32, "nopqrstuvwxy", 0, row) 43 | row += font_32.HEIGHT 44 | 45 | tft.write(font_64, "abcdef", 0, row) 46 | row += font_64.HEIGHT 47 | 48 | tft.write(font_64, "ghijkl", 0, row) 49 | 50 | finally: 51 | # shutdown spi 52 | if 'spi' in locals(): 53 | spi.deinit() 54 | 55 | 56 | main() 57 | -------------------------------------------------------------------------------- /examples/M5STACK/rot.py: -------------------------------------------------------------------------------- 1 | """ 2 | fonts.py 3 | 4 | Pages through all characters of four fonts on the M5Stack Display. 5 | 6 | """ 7 | import utime 8 | import random 9 | from machine import Pin, SPI 10 | import ili9342c 11 | import vga1_bold_16x32 as font 12 | 13 | 14 | def main(): 15 | tft = ili9342c.ILI9342C( 16 | SPI( 17 | 2, 18 | baudrate=60000000, 19 | polarity=1, 20 | phase=1, 21 | sck=Pin(18), 22 | mosi=Pin(23)), 23 | 320, 24 | 240, 25 | reset=Pin(33, Pin.OUT), 26 | cs=Pin(14, Pin.OUT), 27 | dc=Pin(27, Pin.OUT), 28 | backlight=Pin(32, Pin.OUT), 29 | rotation=0, 30 | buffer_size=16*32*2) 31 | 32 | tft.init() 33 | tft.fill(ili9342c.BLACK) 34 | utime.sleep(1) 35 | 36 | while True: 37 | for rot in range(8): 38 | if rot in [0, 4]: 39 | tft.fill(ili9342c.BLACK) 40 | 41 | tft.rotation(rot) 42 | s = "Rot {}".format(rot) 43 | tft.text( 44 | font, 45 | s, 46 | 0, 47 | 0, 48 | ili9342c.WHITE) 49 | 50 | utime.sleep(3) 51 | 52 | 53 | main() 54 | -------------------------------------------------------------------------------- /examples/M5STACK/scroll.py: -------------------------------------------------------------------------------- 1 | """ 2 | scroll.py 3 | 4 | Smoothly scroll all characters in a font up the M5Stack Core Display. 5 | Fonts heights must be even multiples of the screen height 6 | (i.e. 8 or 16 pixels high). 7 | 8 | """ 9 | 10 | import utime 11 | import random 12 | from machine import Pin, SPI 13 | 14 | import ili9342c 15 | import vga1_bold_16x16 as font 16 | 17 | 18 | def cycle(p): 19 | try: 20 | len(p) 21 | except TypeError: 22 | cache = [] 23 | for i in p: 24 | yield i 25 | cache.append(i) 26 | p = cache 27 | while p: 28 | yield from p 29 | 30 | 31 | def main(): 32 | tft = ili9342c.ILI9342C( 33 | SPI(2, baudrate=60000000, sck=Pin(18), mosi=Pin(23)), 34 | 320, 35 | 240, 36 | reset=Pin(33, Pin.OUT), 37 | cs=Pin(14, Pin.OUT), 38 | dc=Pin(27, Pin.OUT), 39 | backlight=Pin(32, Pin.OUT), 40 | rotation=0, 41 | buffer_size=16*16*2) 42 | 43 | colors = cycle([0xe000, 0xece0, 0xe7e0, 0x5e0, 0x00d3, 0x7030]) 44 | foreground = next(colors) 45 | background = ili9342c.BLACK 46 | 47 | tft.init() 48 | tft.fill(background) 49 | utime.sleep(1) 50 | 51 | height = tft.height() 52 | width = tft.width() 53 | last_line = height - font.HEIGHT 54 | 55 | tfa = 0 # top free area 56 | tfb = 0 # bottom free area 57 | tft.vscrdef(tfa, height, tfb) 58 | 59 | scroll = 0 60 | character = 0 61 | 62 | while True: 63 | # clear top line before scrolling off display 64 | tft.fill_rect(0, scroll, width, 1, background) 65 | 66 | # Write new line when we have scrolled the height of a character 67 | if scroll % font.HEIGHT == 0: 68 | line = (scroll + last_line) % height 69 | 70 | # write character hex value as a string 71 | tft.text( 72 | font, 73 | 'x{:02x}'.format(character), 74 | 16, 75 | line, 76 | foreground, 77 | background) 78 | 79 | # write character using a integer (could be > 0x7f) 80 | tft.text( 81 | font, 82 | character, 83 | 90, 84 | line, 85 | foreground, 86 | background) 87 | 88 | # change color for next line 89 | foreground = next(colors) 90 | 91 | # next character with rollover at 256 92 | character += 1 93 | character %= 256 94 | 95 | # scroll the screen up 1 row 96 | tft.vscsad(scroll+tfa) 97 | scroll += 1 98 | scroll %= height 99 | 100 | utime.sleep(0.01) 101 | 102 | main() 103 | -------------------------------------------------------------------------------- /examples/M5STACK/toasters/t1.py: -------------------------------------------------------------------------------- 1 | HEIGHT = 64 2 | WIDTH = 64 3 | COLORS = 8 4 | BITS = 12288 5 | BPP = 3 6 | PALETTE = [0x0000,0xffff,0xb6b5,0x00b0,0x6d6b,0x4082,0x494a,0x2000] 7 | _bitmap =\ 8 | b'\x00\x00\x00\x00\x00\x00\x00\x02\x49\x24\x00\x00\x00\x00\x00\x00'\ 9 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02'\ 10 | b'\x49\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 11 | b'\x00\x00\x00\x00\x00\x00\x24\x92\x40\x00\x90\x00\x00\x00\x00\x00'\ 12 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92'\ 13 | b'\x40\x00\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 14 | b'\x00\x00\x00\x00\x00\x09\x24\x90\x00\x24\x90\x00\x00\x00\x00\x00'\ 15 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x24\x90'\ 16 | b'\x00\x24\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 17 | b'\x00\x00\x00\x00\x02\x49\x00\x92\x49\x00\x02\x40\x49\x24\x92\x00'\ 18 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x49\x00\x92'\ 19 | b'\x49\x00\x02\x40\x49\x24\x92\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 20 | b'\x00\x00\x00\x00\x92\x49\x24\x92\x40\x01\x24\x92\x49\x24\x92\x49'\ 21 | b'\x24\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x92\x49\x24\x92'\ 22 | b'\x40\x01\x24\x92\x49\x24\x92\x49\x24\x80\x00\x00\x00\x00\x00\x00'\ 23 | b'\x00\x00\x00\x00\x92\x49\x24\x04\x92\x49\x20\x00\x01\xb6\xdb\x6d'\ 24 | b'\x24\x92\x48\x00\x00\x00\x00\x00\x00\x00\x00\x00\x92\x49\x24\x04'\ 25 | b'\x92\x49\x20\x00\x01\xb6\xdb\x6d\x24\x92\x48\x00\x00\x00\x00\x00'\ 26 | b'\x00\x00\x00\x24\x92\x49\x49\x24\x80\x00\x06\xdb\x6d\x24\x92\x49'\ 27 | b'\x24\x92\x49\x24\x80\x00\x00\x00\x00\x00\x00\x24\x92\x49\x49\x24'\ 28 | b'\x80\x00\x06\xdb\x6d\x24\x92\x49\x24\x92\x49\x24\x80\x00\x00\x00'\ 29 | b'\x00\x00\x00\x24\x94\x92\x48\x00\x00\x6d\xb4\x92\x49\x20\x00\x01'\ 30 | b'\xb6\xdb\x6d\x24\xa4\x00\x00\x00\x00\x00\x00\x24\x94\x92\x48\x00'\ 31 | b'\x00\x6d\xb4\x92\x49\x20\x00\x01\xb6\xdb\x6d\x24\xa4\x00\x00\x00'\ 32 | b'\x00\x00\x09\x49\x24\x80\x00\x06\xdb\x49\x24\x80\x00\x06\xdb\x6d'\ 33 | b'\x24\x92\x00\x00\x00\x90\x00\x00\x00\x00\x09\x49\x24\x80\x00\x06'\ 34 | b'\xdb\x49\x24\x80\x00\x06\xdb\x6d\x24\x92\x00\x00\x00\x90\x00\x00'\ 35 | b'\x00\x00\x12\x48\x00\x00\x6d\xb4\x92\x48\x00\x00\x6d\xb4\x92\x48'\ 36 | b'\x00\x00\x24\x92\x49\x24\x92\x49\x00\x00\x12\x48\x00\x00\x6d\xb4'\ 37 | b'\x92\x48\x00\x00\x6d\xb4\x92\x48\x00\x00\x24\x92\x49\x24\x92\x49'\ 38 | b'\x00\x04\x92\x00\x00\x1b\x49\x24\x80\x00\x06\xdb\x49\x24\xa4\x00'\ 39 | b'\x92\x49\x24\x90\x09\x00\x90\x00\x00\x04\x92\x00\x00\x1b\x49\x24'\ 40 | b'\x80\x00\x06\xdb\x49\x24\xa4\x00\x92\x49\x24\x90\x09\x00\x90\x00'\ 41 | b'\x01\x24\x80\x00\x06\xd2\x48\x00\x00\x6d\xb4\x92\x4a\x49\x00\x24'\ 42 | b'\x92\x40\x24\x92\x49\x24\x92\x49\x01\x24\x80\x00\x06\xd2\x48\x00'\ 43 | b'\x00\x6d\xb4\x92\x4a\x49\x00\x24\x92\x40\x24\x92\x49\x24\x92\x49'\ 44 | b'\x01\x24\x92\x49\xb4\x92\x00\x00\x1b\x49\x24\xa4\x92\x40\x09\x24'\ 45 | b'\x92\x49\x24\x02\x40\x24\x00\x00\x01\x24\x92\x49\xb4\x92\x00\x00'\ 46 | b'\x1b\x49\x24\xa4\x92\x40\x09\x24\x92\x49\x24\x02\x40\x24\x00\x00'\ 47 | b'\x92\xdb\x52\x49\x24\x80\x00\x06\xd2\x4b\x69\x24\x92\x40\x09\x24'\ 48 | b'\x90\x09\x24\x92\x49\x24\x92\x40\x92\xdb\x52\x49\x24\x80\x00\x06'\ 49 | b'\xd2\x4b\x69\x24\x92\x40\x09\x24\x90\x09\x24\x92\x49\x24\x92\x40'\ 50 | b'\x92\xdb\x6d\xb5\x24\x92\x49\xb4\x92\xda\x49\x24\x90\x02\x49\x24'\ 51 | b'\x92\x49\x00\x90\x09\x00\x00\x00\x92\xdb\x6d\xb5\x24\x92\x49\xb4'\ 52 | b'\x92\xda\x49\x24\x90\x02\x49\x24\x92\x49\x00\x90\x09\x00\x00\x00'\ 53 | b'\x92\xd4\x92\xb6\xdb\x52\x49\x24\xb6\x92\x49\x24\x90\x02\x49\x24'\ 54 | b'\x02\x49\x24\x92\x49\x24\x00\x00\x92\xd4\x92\xb6\xdb\x52\x49\x24'\ 55 | b'\xb6\x92\x49\x24\x90\x02\x49\x24\x02\x49\x24\x92\x49\x24\x00\x00'\ 56 | b'\x92\xd4\xb6\x49\x2b\x6d\xb6\x49\x36\x92\x49\x24\x00\x92\x49\x24'\ 57 | b'\x92\x40\x00\x00\x00\x00\x00\x00\x92\xd4\xb6\x49\x2b\x6d\xb6\x49'\ 58 | b'\x36\x92\x49\x24\x00\x92\x49\x24\x92\x40\x00\x00\x00\x00\x00\x00'\ 59 | b'\x92\xd4\xb6\xdb\x64\x92\xb6\x4b\x64\x92\x49\x24\x00\x92\x40\x24'\ 60 | b'\x92\x49\x24\x09\x2d\xb4\x00\x00\x92\xd4\xb6\xdb\x64\x92\xb6\x4b'\ 61 | b'\x64\x92\x49\x24\x00\x92\x40\x24\x92\x49\x24\x09\x2d\xb4\x00\x00'\ 62 | b'\x92\xdb\x6d\xb7\x64\x92\xb6\x4b\x64\x92\x49\x00\x24\x92\x49\x24'\ 63 | b'\x00\x00\x02\x49\x2d\x90\x00\x00\x92\xdb\x6d\xb7\x64\x92\xb6\x4b'\ 64 | b'\x64\x92\x49\x00\x24\x92\x49\x24\x00\x00\x02\x49\x2d\x90\x00\x00'\ 65 | b'\x92\xdb\x6d\x4a\xd4\x92\xb6\x4b\x64\x92\x49\x00\x24\x90\x09\x24'\ 66 | b'\x92\x40\x92\x4b\x6d\xb4\x00\x00\x92\xdb\x6d\x4a\xd4\x92\xb6\x4b'\ 67 | b'\x64\x92\x49\x00\x24\x90\x09\x24\x92\x40\x92\x4b\x6d\xb4\x00\x00'\ 68 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\x90\x09\x00\x24\x92\x49\x00'\ 69 | b'\x00\x24\x92\x4b\x6d\x90\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 70 | b'\x6d\x90\x09\x00\x24\x92\x49\x00\x00\x24\x92\x4b\x6d\x90\x00\x00'\ 71 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\x92\x49\x24\x00\x92\x40\x92'\ 72 | b'\x49\x24\x92\xdb\x6d\xb4\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 73 | b'\x6d\x92\x49\x24\x00\x92\x40\x92\x49\x24\x92\xdb\x6d\xb4\x00\x00'\ 74 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\x90\x09\x24\x90\x00\x24\x92'\ 75 | b'\x49\x24\xb6\xdb\x6d\x90\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 76 | b'\x6d\x90\x09\x24\x90\x00\x24\x92\x49\x24\xb6\xdb\x6d\x90\x00\x00'\ 77 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\xb6\x40\x00\x92\x49\x24\x92'\ 78 | b'\x4b\x6d\xb6\xdb\x64\x00\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 79 | b'\x6d\xb6\x40\x00\x92\x49\x24\x92\x4b\x6d\xb6\xdb\x64\x00\x00\x00'\ 80 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xd9\x24\x92\x49\x24\xb6'\ 81 | b'\xdb\x6d\xb6\xd9\x00\x00\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 82 | b'\x6d\xb6\xd9\x24\x92\x49\x24\xb6\xdb\x6d\xb6\xd9\x00\x00\x00\x00'\ 83 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6'\ 84 | b'\xdb\x6d\x92\x40\x00\x00\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 85 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92\x40\x00\x00\x00\x00'\ 86 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6'\ 87 | b'\xd9\x24\x00\x00\x00\x00\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 88 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00\x00\x00\x00\x00\x00'\ 89 | b'\x02\x4b\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92'\ 90 | b'\x40\x00\x00\x00\x00\x00\x00\x00\x02\x4b\x6d\xb6\xdb\x6d\xb6\x4b'\ 91 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92\x40\x00\x00\x00\x00\x00\x00\x00'\ 92 | b'\x00\x09\x2d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00'\ 93 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x2d\xb6\xdb\x6d\xb6\x4b'\ 94 | b'\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 95 | b'\x00\x00\x24\x92\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x64\x92\x40\x00\x00'\ 96 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92\xdb\x6d\xb6\x4b'\ 97 | b'\x6d\xb6\xdb\x64\x92\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 98 | b'\x00\x00\x00\x02\x49\x2d\xb6\x4b\x6d\x92\x49\x00\x00\x00\x00\x00'\ 99 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x49\x2d\xb6\x4b'\ 100 | b'\x6d\x92\x49\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 101 | b'\x00\x00\x00\x00\x00\x24\x92\x49\x24\x00\x00\x00\x00\x00\x00\x00'\ 102 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92\x49'\ 103 | b'\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' 104 | BITMAP = memoryview(_bitmap) 105 | -------------------------------------------------------------------------------- /examples/M5STACK/toasters/t2.py: -------------------------------------------------------------------------------- 1 | HEIGHT = 64 2 | WIDTH = 64 3 | COLORS = 8 4 | BITS = 12288 5 | BPP = 3 6 | PALETTE = [0x0000,0xffff,0xb6b5,0x00b0,0x6d6b,0x4082,0x494a,0x2000] 7 | _bitmap =\ 8 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 9 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 10 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 11 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 12 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 13 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 14 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 15 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 16 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 17 | b'\x00\x00\x00\x00\x00\x00\x00\x02\x49\x00\x00\x00\x49\x24\x92\x00'\ 18 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02'\ 19 | b'\x49\x00\x00\x00\x49\x24\x92\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 20 | b'\x00\x00\x00\x00\x00\x00\x24\x92\x49\x01\x24\x92\x49\x24\x92\x49'\ 21 | b'\x24\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92'\ 22 | b'\x49\x01\x24\x92\x49\x24\x92\x49\x24\x80\x00\x00\x00\x00\x00\x00'\ 23 | b'\x00\x00\x00\x00\x00\x09\x24\x04\x92\x49\x20\x00\x01\xb6\xdb\x6d'\ 24 | b'\x24\x92\x48\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x24\x04'\ 25 | b'\x92\x49\x20\x00\x01\xb6\xdb\x6d\x24\x92\x48\x00\x00\x00\x00\x00'\ 26 | b'\x00\x00\x00\x00\x02\x49\x49\x24\x80\x00\x06\xdb\x6d\x24\x92\x49'\ 27 | b'\x24\x92\x49\x24\x80\x00\x00\x00\x00\x00\x00\x00\x02\x49\x49\x24'\ 28 | b'\x80\x00\x06\xdb\x6d\x24\x92\x49\x24\x92\x49\x24\x80\x00\x00\x00'\ 29 | b'\x00\x00\x00\x00\x94\x92\x48\x00\x00\x6d\xb4\x92\x49\x20\x00\x01'\ 30 | b'\xb6\xdb\x6d\x24\xa4\x00\x00\x00\x00\x00\x00\x00\x94\x92\x48\x00'\ 31 | b'\x00\x6d\xb4\x92\x49\x20\x00\x01\xb6\xdb\x6d\x24\xa4\x00\x00\x00'\ 32 | b'\x00\x00\x00\x49\x24\x80\x00\x06\xdb\x49\x24\x80\x00\x06\xdb\x6d'\ 33 | b'\x24\x92\x49\x24\xa4\x90\x00\x00\x00\x00\x00\x49\x24\x80\x00\x06'\ 34 | b'\xdb\x49\x24\x80\x00\x06\xdb\x6d\x24\x92\x49\x24\xa4\x90\x00\x00'\ 35 | b'\x00\x00\x12\x48\x00\x00\x6d\xb4\x92\x48\x00\x00\x6d\xb4\x92\x49'\ 36 | b'\x24\x80\x00\x00\x24\x90\x00\x00\x00\x00\x12\x48\x00\x00\x6d\xb4'\ 37 | b'\x92\x48\x00\x00\x6d\xb4\x92\x49\x24\x80\x00\x00\x24\x90\x00\x00'\ 38 | b'\x00\x04\x92\x00\x00\x1b\x49\x24\x80\x00\x06\xdb\x49\x24\xa4\x90'\ 39 | b'\x00\x24\x92\x49\x00\x90\x00\x00\x00\x04\x92\x00\x00\x1b\x49\x24'\ 40 | b'\x80\x00\x06\xdb\x49\x24\xa4\x90\x00\x24\x92\x49\x00\x90\x00\x00'\ 41 | b'\x01\x24\x80\x00\x06\xd2\x48\x00\x00\x6d\xb4\x92\x4a\x49\x24\x92'\ 42 | b'\x49\x24\x92\x49\x24\x90\x00\x00\x01\x24\x80\x00\x06\xd2\x48\x00'\ 43 | b'\x00\x6d\xb4\x92\x4a\x49\x24\x92\x49\x24\x92\x49\x24\x90\x00\x00'\ 44 | b'\x01\x24\x92\x49\xb4\x92\x00\x00\x1b\x49\x24\xa4\x92\x49\x24\x90'\ 45 | b'\x00\x00\x00\x00\x00\x90\x00\x00\x01\x24\x92\x49\xb4\x92\x00\x00'\ 46 | b'\x1b\x49\x24\xa4\x92\x49\x24\x90\x00\x00\x00\x00\x00\x90\x00\x00'\ 47 | b'\x92\xdb\x52\x49\x24\x80\x00\x06\xd2\x4b\x69\x24\x92\x49\x00\x00'\ 48 | b'\x92\x49\x24\x92\x49\x00\x00\x00\x92\xdb\x52\x49\x24\x80\x00\x06'\ 49 | b'\xd2\x4b\x69\x24\x92\x49\x00\x00\x92\x49\x24\x92\x49\x00\x00\x00'\ 50 | b'\x92\xdb\x6d\xb5\x24\x92\x49\xb4\x92\xda\x49\x24\x92\x40\x09\x24'\ 51 | b'\x92\x49\x00\x92\x49\x24\x92\x49\x92\xdb\x6d\xb5\x24\x92\x49\xb4'\ 52 | b'\x92\xda\x49\x24\x92\x40\x09\x24\x92\x49\x00\x92\x49\x24\x92\x49'\ 53 | b'\x92\xd4\x92\xb6\xdb\x52\x49\x24\xb6\x92\x49\x24\x90\x02\x49\x24'\ 54 | b'\x92\x49\x24\x90\x09\x00\x90\x00\x92\xd4\x92\xb6\xdb\x52\x49\x24'\ 55 | b'\xb6\x92\x49\x24\x90\x02\x49\x24\x92\x49\x24\x90\x09\x00\x90\x00'\ 56 | b'\x92\xd4\xb6\x49\x2b\x6d\xb6\x49\x36\x92\x49\x24\x00\x92\x49\x24'\ 57 | b'\x92\x40\x24\x92\x49\x24\x92\x49\x92\xd4\xb6\x49\x2b\x6d\xb6\x49'\ 58 | b'\x36\x92\x49\x24\x00\x92\x49\x24\x92\x40\x24\x92\x49\x24\x92\x49'\ 59 | b'\x92\xd4\xb6\xdb\x64\x92\xb6\x4b\x64\x92\x49\x24\x00\x92\x49\x24'\ 60 | b'\x92\x49\x24\x02\x40\x00\x92\x40\x92\xd4\xb6\xdb\x64\x92\xb6\x4b'\ 61 | b'\x64\x92\x49\x24\x00\x92\x49\x24\x92\x49\x24\x02\x40\x00\x92\x40'\ 62 | b'\x92\xdb\x6d\xb7\x64\x92\xb6\x4b\x64\x92\x49\x00\x24\x92\x49\x24'\ 63 | b'\x90\x09\x24\x92\x49\x24\x00\x00\x92\xdb\x6d\xb7\x64\x92\xb6\x4b'\ 64 | b'\x64\x92\x49\x00\x24\x92\x49\x24\x90\x09\x24\x92\x49\x24\x00\x00'\ 65 | b'\x92\xdb\x6d\x4a\xd4\x92\xb6\x4b\x64\x92\x49\x00\x24\x90\x09\x00'\ 66 | b'\x92\x49\x24\x90\x2d\xb4\x00\x00\x92\xdb\x6d\x4a\xd4\x92\xb6\x4b'\ 67 | b'\x64\x92\x49\x00\x24\x90\x09\x00\x92\x49\x24\x90\x2d\xb4\x00\x00'\ 68 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\x90\x09\x00\x24\x92\x49\x00'\ 69 | b'\x00\x00\x00\x00\x2d\x90\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 70 | b'\x6d\x90\x09\x00\x24\x92\x49\x00\x00\x00\x00\x00\x2d\x90\x00\x00'\ 71 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\x92\x49\x24\x00\x92\x40\x92'\ 72 | b'\x49\x24\x92\xdb\x6d\xb4\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 73 | b'\x6d\x92\x49\x24\x00\x92\x40\x92\x49\x24\x92\xdb\x6d\xb4\x00\x00'\ 74 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\x90\x09\x24\x90\x00\x24\x92'\ 75 | b'\x49\x24\xb6\xdb\x6d\x90\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 76 | b'\x6d\x90\x09\x24\x90\x00\x24\x92\x49\x24\xb6\xdb\x6d\x90\x00\x00'\ 77 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\xb6\x40\x00\x92\x49\x24\x92'\ 78 | b'\x4b\x6d\xb6\xdb\x64\x00\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 79 | b'\x6d\xb6\x40\x00\x92\x49\x24\x92\x4b\x6d\xb6\xdb\x64\x00\x00\x00'\ 80 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xd9\x24\x92\x49\x24\xb6'\ 81 | b'\xdb\x6d\xb6\xd9\x00\x00\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 82 | b'\x6d\xb6\xd9\x24\x92\x49\x24\xb6\xdb\x6d\xb6\xd9\x00\x00\x00\x00'\ 83 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6'\ 84 | b'\xdb\x6d\x92\x40\x00\x00\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 85 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92\x40\x00\x00\x00\x00'\ 86 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6'\ 87 | b'\xd9\x24\x00\x00\x00\x00\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 88 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00\x00\x00\x00\x00\x00'\ 89 | b'\x02\x4b\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92'\ 90 | b'\x40\x00\x00\x00\x00\x00\x00\x00\x02\x4b\x6d\xb6\xdb\x6d\xb6\x4b'\ 91 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92\x40\x00\x00\x00\x00\x00\x00\x00'\ 92 | b'\x00\x09\x2d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00'\ 93 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x2d\xb6\xdb\x6d\xb6\x4b'\ 94 | b'\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 95 | b'\x00\x00\x24\x92\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x64\x92\x40\x00\x00'\ 96 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92\xdb\x6d\xb6\x4b'\ 97 | b'\x6d\xb6\xdb\x64\x92\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 98 | b'\x00\x00\x00\x02\x49\x2d\xb6\x4b\x6d\x92\x49\x00\x00\x00\x00\x00'\ 99 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x49\x2d\xb6\x4b'\ 100 | b'\x6d\x92\x49\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 101 | b'\x00\x00\x00\x00\x00\x24\x92\x49\x24\x00\x00\x00\x00\x00\x00\x00'\ 102 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92\x49'\ 103 | b'\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' 104 | BITMAP = memoryview(_bitmap) 105 | -------------------------------------------------------------------------------- /examples/M5STACK/toasters/t3.py: -------------------------------------------------------------------------------- 1 | HEIGHT = 64 2 | WIDTH = 64 3 | COLORS = 8 4 | BITS = 12288 5 | BPP = 3 6 | PALETTE = [0x0000,0xb6b5,0x00b0,0x6d6b,0x4082,0x494a,0xffff,0x2000] 7 | _bitmap =\ 8 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 9 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 10 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 11 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 12 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 13 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 14 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 15 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 16 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 17 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92\x49\x00'\ 18 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 19 | b'\x00\x00\x00\x00\x24\x92\x49\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 20 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x92\x49\x24\x92\x49\x24'\ 21 | b'\x92\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 22 | b'\x00\x00\x92\x49\x24\x92\x49\x24\x92\x40\x00\x00\x00\x00\x00\x00'\ 23 | b'\x00\x00\x00\x00\x00\x00\x00\x02\x49\x24\x90\x00\x01\x24\x92\x48'\ 24 | b'\x92\x49\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02'\ 25 | b'\x49\x24\x90\x00\x01\x24\x92\x48\x92\x49\x24\x00\x00\x00\x00\x00'\ 26 | b'\x00\x00\x00\x00\x00\x00\x24\x92\x40\x00\x04\x92\x48\x92\x49\x24'\ 27 | b'\x92\x49\x24\x92\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92'\ 28 | b'\x40\x00\x04\x92\x48\x92\x49\x24\x92\x49\x24\x92\x40\x00\x00\x00'\ 29 | b'\x00\x00\x00\x00\x02\x49\x24\x00\x00\x49\x22\x49\x24\x90\x00\x01'\ 30 | b'\x24\x92\x48\x92\x5b\x00\x00\x00\x00\x00\x00\x00\x02\x49\x24\x00'\ 31 | b'\x00\x49\x22\x49\x24\x90\x00\x01\x24\x92\x48\x92\x5b\x00\x00\x00'\ 32 | b'\x00\x00\x00\x24\x92\x40\x00\x04\x92\x24\x92\x40\x00\x04\x92\x48'\ 33 | b'\x92\x49\x24\x92\x5b\x6c\x00\x00\x00\x00\x00\x24\x92\x40\x00\x04'\ 34 | b'\x92\x24\x92\x40\x00\x04\x92\x48\x92\x49\x24\x92\x5b\x6c\x00\x00'\ 35 | b'\x00\x00\x09\x24\x00\x00\x49\x22\x49\x24\x00\x00\x49\x22\x49\x24'\ 36 | b'\x96\xc0\x00\x00\x1b\x6c\x00\x00\x00\x00\x09\x24\x00\x00\x49\x22'\ 37 | b'\x49\x24\x00\x00\x49\x22\x49\x24\x96\xc0\x00\x00\x1b\x6c\x00\x00'\ 38 | b'\x00\x02\x49\x00\x00\x12\x24\x92\x40\x00\x04\x92\x24\x92\x5b\x6c'\ 39 | b'\x00\x1b\x6d\xb6\xc0\x6c\x00\x00\x00\x02\x49\x00\x00\x12\x24\x92'\ 40 | b'\x40\x00\x04\x92\x24\x92\x5b\x6c\x00\x1b\x6d\xb6\xc0\x6c\x00\x00'\ 41 | b'\x00\x92\x40\x00\x04\x89\x24\x00\x00\x49\x22\x49\x25\xb6\xdb\x6d'\ 42 | b'\xb6\xdb\x6d\xb6\xdb\x6c\x00\x00\x00\x92\x40\x00\x04\x89\x24\x00'\ 43 | b'\x00\x49\x22\x49\x25\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6c\x00\x00'\ 44 | b'\x00\x92\x49\x25\x22\x49\x00\x00\x12\x24\x92\x5b\x6d\xb6\xdb\x6d'\ 45 | b'\xb6\xdb\x6d\xb6\xdb\x6c\x00\x00\x00\x92\x49\x25\x22\x49\x00\x00'\ 46 | b'\x12\x24\x92\x5b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6c\x00\x00'\ 47 | b'\x6e\x49\x09\x24\x92\x40\x00\x04\x89\x26\xd6\xdb\x6d\xb6\xdb\x6d'\ 48 | b'\xb6\xdb\x6d\xb6\xdb\x00\x00\x00\x6e\x49\x09\x24\x92\x40\x00\x04'\ 49 | b'\x89\x26\xd6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x00\x00\x00'\ 50 | b'\x6e\x49\x24\x90\x92\x49\x25\x22\x49\xb5\xb6\xdb\x6d\xb6\xdb\x6d'\ 51 | b'\xb6\xdb\x6d\xb6\xc0\x6c\x00\x00\x6e\x49\x24\x90\x92\x49\x25\x22'\ 52 | b'\x49\xb5\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xc0\x6c\x00\x00'\ 53 | b'\x6e\x42\x49\x92\x49\x09\x24\x92\x6d\x6d\xb6\xdb\x6d\xb6\xdb\x6d'\ 54 | b'\xb6\xdb\x6d\xb6\xc0\x00\x00\x00\x6e\x42\x49\x92\x49\x09\x24\x92'\ 55 | b'\x6d\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xc0\x00\x00\x00'\ 56 | b'\x6e\x42\x6d\x24\x99\x24\x91\xb6\xed\x6d\xb6\xdb\x6c\x00\x1b\x6d'\ 57 | b'\xb6\xdb\x6c\x00\x00\x6c\x00\x00\x6e\x42\x6d\x24\x99\x24\x91\xb6'\ 58 | b'\xed\x6d\xb6\xdb\x6c\x00\x1b\x6d\xb6\xdb\x6c\x00\x00\x6c\x00\x00'\ 59 | b'\x6e\x42\x6d\xb6\xd2\x49\x91\xb9\x1b\x6d\xb6\xdb\x03\x6d\x80\x00'\ 60 | b'\x00\x00\x00\x0d\xb6\x03\x6d\x80\x6e\x42\x6d\xb6\xd2\x49\x91\xb9'\ 61 | b'\x1b\x6d\xb6\xdb\x03\x6d\x80\x00\x00\x00\x00\x0d\xb6\x03\x6d\x80'\ 62 | b'\x6e\x49\x24\x92\xd2\x49\x91\xb9\x1b\x6d\xb6\xc0\xdb\x6d\xb6\xd8'\ 63 | b'\x0d\xb6\x03\x6d\x80\xdb\x60\x36\x6e\x49\x24\x92\xd2\x49\x91\xb9'\ 64 | b'\x1b\x6d\xb6\xc0\xdb\x6d\xb6\xd8\x0d\xb6\x03\x6d\x80\xdb\x60\x36'\ 65 | b'\x6e\x49\x24\x26\x42\x49\x91\xb9\x1b\x6d\xb6\xc0\xdb\x6d\xb6\x03'\ 66 | b'\x6d\x80\xdb\x60\x36\xd8\x0d\xb6\x6e\x49\x24\x26\x42\x49\x91\xb9'\ 67 | b'\x1b\x6d\xb6\xc0\xdb\x6d\xb6\x03\x6d\x80\xdb\x60\x36\xd8\x0d\xb6'\ 68 | b'\x6e\x49\x24\x92\x49\x24\x91\xb9\x24\x6c\x06\xc0\xdb\x6d\xb6\xdb'\ 69 | b'\x60\x36\xd8\x0d\xb6\x03\x6d\x80\x6e\x49\x24\x92\x49\x24\x91\xb9'\ 70 | b'\x24\x6c\x06\xc0\xdb\x6d\xb6\xdb\x60\x36\xd8\x0d\xb6\x03\x6d\x80'\ 71 | b'\x6e\x49\x24\x26\x49\x24\x91\xb9\x24\x6d\xb6\xdb\x03\x6d\xb6\xdb'\ 72 | b'\x6d\xb6\xdb\x6d\x80\xdb\x6d\x80\x6e\x49\x24\x26\x49\x24\x91\xb9'\ 73 | b'\x24\x6d\xb6\xdb\x03\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x80\xdb\x6d\x80'\ 74 | b'\x6e\x49\x24\x92\x49\x24\x91\xb9\x24\x6c\x06\xdb\x6c\x0d\xb6\xdb'\ 75 | b'\x6d\x80\xdb\x6d\xb6\xdb\x60\x00\x6e\x49\x24\x92\x49\x24\x91\xb9'\ 76 | b'\x24\x6c\x06\xdb\x6c\x0d\xb6\xdb\x6d\x80\xdb\x6d\xb6\xdb\x60\x00'\ 77 | b'\x6e\x49\x24\x26\x49\x24\x91\xb9\x24\x91\xb0\x00\x6d\xb0\x36\xdb'\ 78 | b'\x6d\xb6\xd8\x0d\xb6\xdb\x60\x00\x6e\x49\x24\x26\x49\x24\x91\xb9'\ 79 | b'\x24\x91\xb0\x00\x6d\xb0\x36\xdb\x6d\xb6\xd8\x0d\xb6\xdb\x60\x00'\ 80 | b'\x6e\x49\x24\x92\x49\x24\x91\xb9\x24\x92\x46\xdb\x6d\xb6\xc0\xdb'\ 81 | b'\x6d\xb6\xdb\x6d\xb6\xd8\x00\x00\x6e\x49\x24\x92\x49\x24\x91\xb9'\ 82 | b'\x24\x92\x46\xdb\x6d\xb6\xc0\xdb\x6d\xb6\xdb\x6d\xb6\xd8\x00\x00'\ 83 | b'\x6e\x49\x24\x26\x49\x24\x91\xb9\x24\x92\x49\x24\x92\x49\x24\x03'\ 84 | b'\x6d\xb6\xdb\x6d\xb6\x00\x00\x00\x6e\x49\x24\x26\x49\x24\x91\xb9'\ 85 | b'\x24\x92\x49\x24\x92\x49\x24\x03\x6d\xb6\xdb\x6d\xb6\x00\x00\x00'\ 86 | b'\x6e\x49\x24\x92\x49\x24\x91\xb9\x24\x92\x49\x24\x92\x49\x24\x90'\ 87 | b'\x0d\xb6\xdb\x6d\x80\x00\x00\x00\x6e\x49\x24\x92\x49\x24\x91\xb9'\ 88 | b'\x24\x92\x49\x24\x92\x49\x24\x90\x0d\xb6\xdb\x6d\x80\x00\x00\x00'\ 89 | b'\x01\xb9\x24\x92\x49\x24\x91\xb9\x24\x92\x49\x24\x92\x49\x24\x6d'\ 90 | b'\xb0\x00\xdb\x60\x00\x00\x00\x00\x01\xb9\x24\x92\x49\x24\x91\xb9'\ 91 | b'\x24\x92\x49\x24\x92\x49\x24\x6d\xb0\x00\xdb\x60\x00\x00\x00\x00'\ 92 | b'\x00\x06\xe4\x92\x49\x24\x91\xb9\x24\x92\x49\x24\x92\x46\xdb\x00'\ 93 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xe4\x92\x49\x24\x91\xb9'\ 94 | b'\x24\x92\x49\x24\x92\x46\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 95 | b'\x00\x00\x1b\x6e\x49\x24\x91\xb9\x24\x92\x49\x1b\x6d\xb0\x00\x00'\ 96 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1b\x6e\x49\x24\x91\xb9'\ 97 | b'\x24\x92\x49\x1b\x6d\xb0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 98 | b'\x00\x00\x00\x01\xb6\xe4\x91\xb9\x24\x6d\xb6\xc0\x00\x00\x00\x00'\ 99 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xb6\xe4\x91\xb9'\ 100 | b'\x24\x6d\xb6\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 101 | b'\x00\x00\x00\x00\x00\x1b\x6d\xb6\xdb\x00\x00\x00\x00\x00\x00\x00'\ 102 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1b\x6d\xb6'\ 103 | b'\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' 104 | BITMAP = memoryview(_bitmap) 105 | -------------------------------------------------------------------------------- /examples/M5STACK/toasters/t4.py: -------------------------------------------------------------------------------- 1 | HEIGHT = 64 2 | WIDTH = 64 3 | COLORS = 8 4 | BITS = 12288 5 | BPP = 3 6 | PALETTE = [0x0000,0xffff,0xb6b5,0x00b0,0x6d6b,0x4082,0x494a,0x2000] 7 | _bitmap =\ 8 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 9 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 10 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 11 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 12 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 13 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 14 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 15 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 16 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 17 | b'\x00\x00\x00\x00\x00\x00\x00\x02\x49\x00\x00\x00\x49\x24\x92\x00'\ 18 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02'\ 19 | b'\x49\x00\x00\x00\x49\x24\x92\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 20 | b'\x00\x00\x00\x00\x00\x00\x24\x92\x49\x01\x24\x92\x49\x24\x92\x49'\ 21 | b'\x24\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92'\ 22 | b'\x49\x01\x24\x92\x49\x24\x92\x49\x24\x80\x00\x00\x00\x00\x00\x00'\ 23 | b'\x00\x00\x00\x00\x00\x09\x24\x04\x92\x49\x20\x00\x01\xb6\xdb\x6d'\ 24 | b'\x24\x92\x48\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x24\x04'\ 25 | b'\x92\x49\x20\x00\x01\xb6\xdb\x6d\x24\x92\x48\x00\x00\x00\x00\x00'\ 26 | b'\x00\x00\x00\x00\x02\x49\x49\x24\x80\x00\x06\xdb\x6d\x24\x92\x49'\ 27 | b'\x24\x92\x49\x24\x80\x00\x00\x00\x00\x00\x00\x00\x02\x49\x49\x24'\ 28 | b'\x80\x00\x06\xdb\x6d\x24\x92\x49\x24\x92\x49\x24\x80\x00\x00\x00'\ 29 | b'\x00\x00\x00\x00\x94\x92\x48\x00\x00\x6d\xb4\x92\x49\x20\x00\x01'\ 30 | b'\xb6\xdb\x6d\x24\xa4\x00\x00\x00\x00\x00\x00\x00\x94\x92\x48\x00'\ 31 | b'\x00\x6d\xb4\x92\x49\x20\x00\x01\xb6\xdb\x6d\x24\xa4\x00\x00\x00'\ 32 | b'\x00\x00\x00\x49\x24\x80\x00\x06\xdb\x49\x24\x80\x00\x06\xdb\x6d'\ 33 | b'\x24\x92\x49\x24\xa4\x90\x00\x00\x00\x00\x00\x49\x24\x80\x00\x06'\ 34 | b'\xdb\x49\x24\x80\x00\x06\xdb\x6d\x24\x92\x49\x24\xa4\x90\x00\x00'\ 35 | b'\x00\x00\x12\x48\x00\x00\x6d\xb4\x92\x48\x00\x00\x6d\xb4\x92\x49'\ 36 | b'\x29\x00\x00\x00\x24\x90\x00\x00\x00\x00\x12\x48\x00\x00\x6d\xb4'\ 37 | b'\x92\x48\x00\x00\x6d\xb4\x92\x49\x29\x00\x00\x00\x24\x90\x00\x00'\ 38 | b'\x00\x04\x92\x00\x00\x1b\x49\x24\x80\x00\x06\xdb\x49\x24\xa4\x90'\ 39 | b'\x00\x24\x92\x49\x00\x90\x00\x00\x00\x04\x92\x00\x00\x1b\x49\x24'\ 40 | b'\x80\x00\x06\xdb\x49\x24\xa4\x90\x00\x24\x92\x49\x00\x90\x00\x00'\ 41 | b'\x01\x24\x80\x00\x06\xd2\x48\x00\x00\x6d\xb4\x92\x4a\x49\x24\x92'\ 42 | b'\x49\x24\x92\x49\x24\x90\x00\x00\x01\x24\x80\x00\x06\xd2\x48\x00'\ 43 | b'\x00\x6d\xb4\x92\x4a\x49\x24\x92\x49\x24\x92\x49\x24\x90\x00\x00'\ 44 | b'\x01\x24\x92\x49\xb4\x92\x00\x00\x1b\x49\x24\xa4\x92\x49\x24\x90'\ 45 | b'\x00\x00\x00\x00\x00\x90\x00\x00\x01\x24\x92\x49\xb4\x92\x00\x00'\ 46 | b'\x1b\x49\x24\xa4\x92\x49\x24\x90\x00\x00\x00\x00\x00\x90\x00\x00'\ 47 | b'\x92\xdb\x52\x49\x24\x80\x00\x06\xd2\x4b\x69\x24\x92\x49\x00\x00'\ 48 | b'\x92\x49\x24\x92\x49\x00\x00\x00\x92\xdb\x52\x49\x24\x80\x00\x06'\ 49 | b'\xd2\x4b\x69\x24\x92\x49\x00\x00\x92\x49\x24\x92\x49\x00\x00\x00'\ 50 | b'\x92\xdb\x6d\xb5\x24\x92\x49\xb4\x92\xda\x49\x24\x92\x40\x09\x24'\ 51 | b'\x92\x49\x00\x92\x49\x24\x92\x49\x92\xdb\x6d\xb5\x24\x92\x49\xb4'\ 52 | b'\x92\xda\x49\x24\x92\x40\x09\x24\x92\x49\x00\x92\x49\x24\x92\x49'\ 53 | b'\x92\xd4\x92\xb6\xdb\x52\x49\x24\xb6\x92\x49\x24\x90\x02\x49\x24'\ 54 | b'\x92\x49\x24\x90\x09\x00\x90\x00\x92\xd4\x92\xb6\xdb\x52\x49\x24'\ 55 | b'\xb6\x92\x49\x24\x90\x02\x49\x24\x92\x49\x24\x90\x09\x00\x90\x00'\ 56 | b'\x92\xd4\xb6\x49\x2b\x6d\xb6\x49\x36\x92\x49\x24\x00\x92\x49\x24'\ 57 | b'\x92\x40\x24\x92\x49\x24\x92\x49\x92\xd4\xb6\x49\x2b\x6d\xb6\x49'\ 58 | b'\x36\x92\x49\x24\x00\x92\x49\x24\x92\x40\x24\x92\x49\x24\x92\x49'\ 59 | b'\x92\xd4\xb6\xdb\x64\x92\xb6\x4b\x64\x92\x49\x24\x00\x92\x49\x24'\ 60 | b'\x92\x49\x24\x02\x40\x00\x92\x40\x92\xd4\xb6\xdb\x64\x92\xb6\x4b'\ 61 | b'\x64\x92\x49\x24\x00\x92\x49\x24\x92\x49\x24\x02\x40\x00\x92\x40'\ 62 | b'\x92\xdb\x6d\xb7\x64\x92\xb6\x4b\x64\x92\x49\x00\x24\x92\x49\x24'\ 63 | b'\x90\x09\x24\x92\x49\x24\x00\x00\x92\xdb\x6d\xb7\x64\x92\xb6\x4b'\ 64 | b'\x64\x92\x49\x00\x24\x92\x49\x24\x90\x09\x24\x92\x49\x24\x00\x00'\ 65 | b'\x92\xdb\x6d\x4a\xd4\x92\xb6\x4b\x64\x92\x49\x00\x24\x90\x09\x00'\ 66 | b'\x92\x49\x00\x90\x2d\xb4\x00\x00\x92\xdb\x6d\x4a\xd4\x92\xb6\x4b'\ 67 | b'\x64\x92\x49\x00\x24\x90\x09\x00\x92\x49\x00\x90\x2d\xb4\x00\x00'\ 68 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\x90\x09\x00\x24\x92\x49\x00'\ 69 | b'\x00\x00\x00\x00\x2d\x90\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 70 | b'\x6d\x90\x09\x00\x24\x92\x49\x00\x00\x00\x00\x00\x2d\x90\x00\x00'\ 71 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\x92\x49\x24\x00\x92\x40\x92'\ 72 | b'\x49\x24\x92\xdb\x6d\xb4\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 73 | b'\x6d\x92\x49\x24\x00\x92\x40\x92\x49\x24\x92\xdb\x6d\xb4\x00\x00'\ 74 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\x90\x09\x24\x90\x00\x24\x92'\ 75 | b'\x49\x24\xb6\xdb\x6d\x90\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 76 | b'\x6d\x90\x09\x24\x90\x00\x24\x92\x49\x24\xb6\xdb\x6d\x90\x00\x00'\ 77 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\xb6\x40\x00\x92\x49\x24\x92'\ 78 | b'\x4b\x6d\xb6\xdb\x64\x00\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 79 | b'\x6d\xb6\x40\x00\x92\x49\x24\x92\x4b\x6d\xb6\xdb\x64\x00\x00\x00'\ 80 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xd9\x24\x92\x49\x24\xb6'\ 81 | b'\xdb\x6d\xb6\xd9\x00\x00\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 82 | b'\x6d\xb6\xd9\x24\x92\x49\x24\xb6\xdb\x6d\xb6\xd9\x00\x00\x00\x00'\ 83 | b'\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6'\ 84 | b'\xdb\x6d\x92\x40\x00\x00\x00\x00\x92\xdb\x6d\x4a\xdb\x6d\xb6\x4b'\ 85 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92\x40\x00\x00\x00\x00'\ 86 | b'\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6'\ 87 | b'\xd9\x24\x00\x00\x00\x00\x00\x00\x92\xdb\x6d\xb6\xdb\x6d\xb6\x4b'\ 88 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00\x00\x00\x00\x00\x00'\ 89 | b'\x02\x4b\x6d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92'\ 90 | b'\x40\x00\x00\x00\x00\x00\x00\x00\x02\x4b\x6d\xb6\xdb\x6d\xb6\x4b'\ 91 | b'\x6d\xb6\xdb\x6d\xb6\xdb\x6d\x92\x40\x00\x00\x00\x00\x00\x00\x00'\ 92 | b'\x00\x09\x2d\xb6\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00'\ 93 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x2d\xb6\xdb\x6d\xb6\x4b'\ 94 | b'\x6d\xb6\xdb\x6d\xb6\xd9\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 95 | b'\x00\x00\x24\x92\xdb\x6d\xb6\x4b\x6d\xb6\xdb\x64\x92\x40\x00\x00'\ 96 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92\xdb\x6d\xb6\x4b'\ 97 | b'\x6d\xb6\xdb\x64\x92\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 98 | b'\x00\x00\x00\x02\x49\x2d\xb6\x4b\x6d\x92\x49\x00\x00\x00\x00\x00'\ 99 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x49\x2d\xb6\x4b'\ 100 | b'\x6d\x92\x49\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 101 | b'\x00\x00\x00\x00\x00\x24\x92\x49\x24\x00\x00\x00\x00\x00\x00\x00'\ 102 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x92\x49'\ 103 | b'\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' 104 | BITMAP = memoryview(_bitmap) 105 | -------------------------------------------------------------------------------- /examples/M5STACK/toasters/toasters.py: -------------------------------------------------------------------------------- 1 | ''' 2 | toasters.py 3 | 4 | An example using bitmap to draw sprites on the 5 | M5Stack Core Display. 6 | 7 | youtube video: https://youtu.be/0uWsjKQmCpU 8 | 9 | spritesheet from CircuitPython_Flying_Toasters 10 | https://learn.adafruit.com/circuitpython-sprite-animation-pendant-mario-clouds-flying-toasters 11 | ''' 12 | 13 | import time 14 | import random 15 | from machine import Pin, SPI 16 | import ili9342c 17 | import t1,t2,t3,t4,t5 18 | 19 | TOASTERS = [t1, t2, t3, t4] 20 | TOAST = [t5] 21 | 22 | 23 | class toast(): 24 | ''' 25 | toast class to keep track of a sprites locaton and step 26 | ''' 27 | def __init__(self, sprites, x, y): 28 | self.sprites = sprites 29 | self.steps = len(sprites) 30 | self.x = x 31 | self.y = y 32 | self.step = random.randint(0, self.steps-1) 33 | self.speed = random.randint(2, 5) 34 | 35 | def move(self): 36 | if self.x <= 0: 37 | self.speed = random.randint(2, 5) 38 | self.x = 320-64 39 | 40 | self.step += 1 41 | self.step %= self.steps 42 | self.x -= self.speed 43 | 44 | 45 | def main(): 46 | ''' 47 | Draw and move sprite 48 | ''' 49 | try: 50 | 51 | spi = SPI(2, baudrate=60000000, sck=Pin(18), mosi=Pin(23)) 52 | 53 | # initialize display 54 | 55 | tft = ili9342c.ILI9342C( 56 | spi, 57 | 320, 58 | 240, 59 | reset=Pin(33, Pin.OUT), 60 | cs=Pin(14, Pin.OUT), 61 | dc=Pin(27, Pin.OUT), 62 | backlight=Pin(32, Pin.OUT), 63 | rotation=0, 64 | buffer_size=64*64*2) 65 | 66 | # enable display and clear screen 67 | tft.init() 68 | tft.fill(ili9342c.BLACK) 69 | 70 | # create toast spites in random positions 71 | sprites = [ 72 | toast(TOASTERS, 320-64, 0), 73 | toast(TOAST, 320-64*2, 80), 74 | toast(TOASTERS, 320-64*4, 160)] 75 | 76 | # move and draw sprites 77 | while True: 78 | for man in sprites: 79 | bitmap = man.sprites[man.step] 80 | tft.fill_rect( 81 | man.x+bitmap.WIDTH-man.speed, 82 | man.y, 83 | man.speed, 84 | bitmap.HEIGHT, 85 | ili9342c.BLACK) 86 | 87 | man.move() 88 | 89 | if man.x > 0: 90 | tft.bitmap(bitmap, man.x, man.y) 91 | else: 92 | tft.fill_rect( 93 | 0, 94 | man.y, 95 | bitmap.WIDTH, 96 | bitmap.HEIGHT, 97 | ili9342c.BLACK) 98 | 99 | time.sleep(0.05) 100 | 101 | finally: 102 | # shutdown spi 103 | if 'spi' in locals(): 104 | spi.deinit() 105 | 106 | 107 | main() 108 | -------------------------------------------------------------------------------- /firmware/GENERIC-ili9342/firmware.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/firmware/GENERIC-ili9342/firmware.bin -------------------------------------------------------------------------------- /firmware/GENERIC_SPIRAM-ili9342/firmware.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/firmware/GENERIC_SPIRAM-ili9342/firmware.bin -------------------------------------------------------------------------------- /firmware/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-2023 Damien P. George 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- 24 | 25 | Unless specified otherwise (see below), the above license and copyright applies 26 | to all files in this repository. 27 | 28 | Individual files may include additional copyright holders. 29 | 30 | The various ports of MicroPython may include third-party software that is 31 | licensed under different terms. These licenses are summarised in the tree 32 | below, please refer to these files and directories for further license and 33 | copyright information. Note that (L)GPL-licensed code listed below is only 34 | used during the build process and is not part of the compiled source code. 35 | 36 | / (MIT) 37 | /drivers 38 | /cc3100 (BSD-3-clause) 39 | /lib 40 | /asf4 (Apache-2.0) 41 | /axtls (BSD-3-clause) 42 | /config 43 | /scripts 44 | /config (GPL-2.0-or-later) 45 | /Rules.mak (GPL-2.0) 46 | /berkeley-db-1xx (BSD-4-clause) 47 | /btstack (See btstack/LICENSE) 48 | /cmsis (BSD-3-clause) 49 | /crypto-algorithms (NONE) 50 | /libhydrogen (ISC) 51 | /littlefs (BSD-3-clause) 52 | /lwip (BSD-3-clause) 53 | /mynewt-nimble (Apache-2.0) 54 | /nrfx (BSD-3-clause) 55 | /nxp_driver (BSD-3-Clause) 56 | /oofatfs (BSD-1-clause) 57 | /pico-sdk (BSD-3-clause) 58 | /re15 (BSD-3-clause) 59 | /stm32lib (BSD-3-clause) 60 | /tinytest (BSD-3-clause) 61 | /tinyusb (MIT) 62 | /uzlib (Zlib) 63 | /wiznet5k (MIT) 64 | /logo (uses OFL-1.1) 65 | /ports 66 | /cc3200 67 | /hal (BSD-3-clause) 68 | /simplelink (BSD-3-clause) 69 | /FreeRTOS (GPL-2.0 with FreeRTOS exception) 70 | /esp32 71 | /ppp_set_auth.* (Apache-2.0) 72 | /rp2 73 | /mutex_extra.c (BSD-3-clause) 74 | /stm32 75 | /usbd*.c (MCD-ST Liberty SW License Agreement V2) 76 | /stm32_it.* (MIT + BSD-3-clause) 77 | /system_stm32*.c (MIT + BSD-3-clause) 78 | /boards 79 | /startup_stm32*.s (BSD-3-clause) 80 | /*/stm32*.h (BSD-3-clause) 81 | /usbdev (MCD-ST Liberty SW License Agreement V2) 82 | /usbhost (MCD-ST Liberty SW License Agreement V2) 83 | /zephyr 84 | /src (Apache-2.0) 85 | /tools 86 | /dfu.py (LGPL-3.0-only) 87 | -------------------------------------------------------------------------------- /firmware/M5CORE2/firmware.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/firmware/M5CORE2/firmware.bin -------------------------------------------------------------------------------- /firmware/M5STACK_16M/firmware.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/firmware/M5STACK_16M/firmware.bin -------------------------------------------------------------------------------- /firmware/M5STACK_4M/firmware.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/firmware/M5STACK_4M/firmware.bin -------------------------------------------------------------------------------- /fonts/bitmap/README.md: -------------------------------------------------------------------------------- 1 | # Included Font Files 2 | 3 | Frozen font files are included in the firmware. 4 | 5 | ## Bit mapped fonts for use with Text method 6 | 7 | The font_from_romfont utility can convert fonts from the font-bin directory of 8 | spacerace's https://github.com/spacerace/romfont repo. 9 | 10 | ### 128 Character Bit Mapped Fonts 11 | 12 | Frozen | Font | Example 13 | ------ | ------------------------------------------------------ | ----------------------------- 14 | Yes | [vga1_8x8.py](/fonts/bitmap/vga1_8x8.py) | ![Image](/docs/vga1_8x8.png) 15 | Yes | [vga1_16x16.py](/fonts/bitmap/vga1_16x16.py) | ![Image](/docs/vga1_16x16.png) 16 | Yes | [vga1_16x32.py](/fonts/bitmap/vga1_16x32.py) | ![Image](/docs/vga1_16x32.png) 17 | Yes | [vga1_bold_16x16.py](/fonts/bitmap/vga1_bold_16x16.py) | ![Image](/docs/vga1_bold_16x16.png) 18 | Yes | [vga1_bold_16x32.py](/fonts/bitmap/vga1_bold_16x32.py) | ![Image](/docs/vga1_bold_16x32.png) 19 | 20 | 21 | ### 256 Character Bit Mapped Fonts 22 | 23 | Frozen | Font | Example 24 | ------ | ------------------------------------------------------ | -------------------------- 25 | No | [vga2_8x8.py](/fonts/bitmap/vga2_8x8.py) | ![Image](/docs/vga2_8x8.png) 26 | No | [vga2_8x16.py](/fonts/bitmap/vga2_8x16.py) | ![Image](/docs/vga2_8x16.png) 27 | No | [vga2_16x16.py](/fonts/bitmap/vga2_16x16.py) | ![Image](/docs/vga2_16x16.png) 28 | No | [vga2_16x32.py](/fonts/bitmap/vga2_16x32.py) | ![Image](/docs/vga2_16x32.png) 29 | No | [vga2_bold_16x16.py](/fonts/bitmap/vga2_bold_16x16.py) | ![Image](/docs/vga2_bold_16x16.png) 30 | No | [vga2_bold_16x32.py](/fonts/bitmap/vga2_bold_16x32.py) | ![Image](/docs/vga2_bold_16x32.png) 31 | 32 | -------------------------------------------------------------------------------- /fonts/bitmap/vga1_8x16.py: -------------------------------------------------------------------------------- 1 | """converted from vga_8x16.bin """ 2 | WIDTH = 8 3 | HEIGHT = 16 4 | FIRST = 0x20 5 | LAST = 0x7f 6 | _FONT =\ 7 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 8 | b'\x00\x00\x18\x3c\x3c\x3c\x18\x18\x18\x00\x18\x18\x00\x00\x00\x00'\ 9 | b'\x00\x66\x66\x66\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 10 | b'\x00\x00\x00\x6c\x6c\xfe\x6c\x6c\x6c\xfe\x6c\x6c\x00\x00\x00\x00'\ 11 | b'\x18\x18\x7c\xc6\xc2\xc0\x7c\x06\x06\x86\xc6\x7c\x18\x18\x00\x00'\ 12 | b'\x00\x00\x00\x00\xc2\xc6\x0c\x18\x30\x60\xc6\x86\x00\x00\x00\x00'\ 13 | b'\x00\x00\x38\x6c\x6c\x38\x76\xdc\xcc\xcc\xcc\x76\x00\x00\x00\x00'\ 14 | b'\x00\x30\x30\x30\x60\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 15 | b'\x00\x00\x0c\x18\x30\x30\x30\x30\x30\x30\x18\x0c\x00\x00\x00\x00'\ 16 | b'\x00\x00\x30\x18\x0c\x0c\x0c\x0c\x0c\x0c\x18\x30\x00\x00\x00\x00'\ 17 | b'\x00\x00\x00\x00\x00\x66\x3c\xff\x3c\x66\x00\x00\x00\x00\x00\x00'\ 18 | b'\x00\x00\x00\x00\x00\x18\x18\x7e\x18\x18\x00\x00\x00\x00\x00\x00'\ 19 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x18\x18\x30\x00\x00\x00'\ 20 | b'\x00\x00\x00\x00\x00\x00\x00\xfe\x00\x00\x00\x00\x00\x00\x00\x00'\ 21 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x18\x00\x00\x00\x00'\ 22 | b'\x00\x00\x00\x00\x02\x06\x0c\x18\x30\x60\xc0\x80\x00\x00\x00\x00'\ 23 | b'\x00\x00\x38\x6c\xc6\xc6\xd6\xd6\xc6\xc6\x6c\x38\x00\x00\x00\x00'\ 24 | b'\x00\x00\x18\x38\x78\x18\x18\x18\x18\x18\x18\x7e\x00\x00\x00\x00'\ 25 | b'\x00\x00\x7c\xc6\x06\x0c\x18\x30\x60\xc0\xc6\xfe\x00\x00\x00\x00'\ 26 | b'\x00\x00\x7c\xc6\x06\x06\x3c\x06\x06\x06\xc6\x7c\x00\x00\x00\x00'\ 27 | b'\x00\x00\x0c\x1c\x3c\x6c\xcc\xfe\x0c\x0c\x0c\x1e\x00\x00\x00\x00'\ 28 | b'\x00\x00\xfe\xc0\xc0\xc0\xfc\x06\x06\x06\xc6\x7c\x00\x00\x00\x00'\ 29 | b'\x00\x00\x38\x60\xc0\xc0\xfc\xc6\xc6\xc6\xc6\x7c\x00\x00\x00\x00'\ 30 | b'\x00\x00\xfe\xc6\x06\x06\x0c\x18\x30\x30\x30\x30\x00\x00\x00\x00'\ 31 | b'\x00\x00\x7c\xc6\xc6\xc6\x7c\xc6\xc6\xc6\xc6\x7c\x00\x00\x00\x00'\ 32 | b'\x00\x00\x7c\xc6\xc6\xc6\x7e\x06\x06\x06\x0c\x78\x00\x00\x00\x00'\ 33 | b'\x00\x00\x00\x00\x18\x18\x00\x00\x00\x18\x18\x00\x00\x00\x00\x00'\ 34 | b'\x00\x00\x00\x00\x18\x18\x00\x00\x00\x18\x18\x30\x00\x00\x00\x00'\ 35 | b'\x00\x00\x00\x06\x0c\x18\x30\x60\x30\x18\x0c\x06\x00\x00\x00\x00'\ 36 | b'\x00\x00\x00\x00\x00\x7e\x00\x00\x7e\x00\x00\x00\x00\x00\x00\x00'\ 37 | b'\x00\x00\x00\x60\x30\x18\x0c\x06\x0c\x18\x30\x60\x00\x00\x00\x00'\ 38 | b'\x00\x00\x7c\xc6\xc6\x0c\x18\x18\x18\x00\x18\x18\x00\x00\x00\x00'\ 39 | b'\x00\x00\x00\x7c\xc6\xc6\xde\xde\xde\xdc\xc0\x7c\x00\x00\x00\x00'\ 40 | b'\x00\x00\x10\x38\x6c\xc6\xc6\xfe\xc6\xc6\xc6\xc6\x00\x00\x00\x00'\ 41 | b'\x00\x00\xfc\x66\x66\x66\x7c\x66\x66\x66\x66\xfc\x00\x00\x00\x00'\ 42 | b'\x00\x00\x3c\x66\xc2\xc0\xc0\xc0\xc0\xc2\x66\x3c\x00\x00\x00\x00'\ 43 | b'\x00\x00\xf8\x6c\x66\x66\x66\x66\x66\x66\x6c\xf8\x00\x00\x00\x00'\ 44 | b'\x00\x00\xfe\x66\x62\x68\x78\x68\x60\x62\x66\xfe\x00\x00\x00\x00'\ 45 | b'\x00\x00\xfe\x66\x62\x68\x78\x68\x60\x60\x60\xf0\x00\x00\x00\x00'\ 46 | b'\x00\x00\x3c\x66\xc2\xc0\xc0\xde\xc6\xc6\x66\x3a\x00\x00\x00\x00'\ 47 | b'\x00\x00\xc6\xc6\xc6\xc6\xfe\xc6\xc6\xc6\xc6\xc6\x00\x00\x00\x00'\ 48 | b'\x00\x00\x3c\x18\x18\x18\x18\x18\x18\x18\x18\x3c\x00\x00\x00\x00'\ 49 | b'\x00\x00\x1e\x0c\x0c\x0c\x0c\x0c\xcc\xcc\xcc\x78\x00\x00\x00\x00'\ 50 | b'\x00\x00\xe6\x66\x66\x6c\x78\x78\x6c\x66\x66\xe6\x00\x00\x00\x00'\ 51 | b'\x00\x00\xf0\x60\x60\x60\x60\x60\x60\x62\x66\xfe\x00\x00\x00\x00'\ 52 | b'\x00\x00\xc6\xee\xfe\xfe\xd6\xc6\xc6\xc6\xc6\xc6\x00\x00\x00\x00'\ 53 | b'\x00\x00\xc6\xe6\xf6\xfe\xde\xce\xc6\xc6\xc6\xc6\x00\x00\x00\x00'\ 54 | b'\x00\x00\x7c\xc6\xc6\xc6\xc6\xc6\xc6\xc6\xc6\x7c\x00\x00\x00\x00'\ 55 | b'\x00\x00\xfc\x66\x66\x66\x7c\x60\x60\x60\x60\xf0\x00\x00\x00\x00'\ 56 | b'\x00\x00\x7c\xc6\xc6\xc6\xc6\xc6\xc6\xd6\xde\x7c\x0c\x0e\x00\x00'\ 57 | b'\x00\x00\xfc\x66\x66\x66\x7c\x6c\x66\x66\x66\xe6\x00\x00\x00\x00'\ 58 | b'\x00\x00\x7c\xc6\xc6\x60\x38\x0c\x06\xc6\xc6\x7c\x00\x00\x00\x00'\ 59 | b'\x00\x00\x7e\x7e\x5a\x18\x18\x18\x18\x18\x18\x3c\x00\x00\x00\x00'\ 60 | b'\x00\x00\xc6\xc6\xc6\xc6\xc6\xc6\xc6\xc6\xc6\x7c\x00\x00\x00\x00'\ 61 | b'\x00\x00\xc6\xc6\xc6\xc6\xc6\xc6\xc6\x6c\x38\x10\x00\x00\x00\x00'\ 62 | b'\x00\x00\xc6\xc6\xc6\xc6\xd6\xd6\xd6\xfe\xee\x6c\x00\x00\x00\x00'\ 63 | b'\x00\x00\xc6\xc6\x6c\x7c\x38\x38\x7c\x6c\xc6\xc6\x00\x00\x00\x00'\ 64 | b'\x00\x00\x66\x66\x66\x66\x3c\x18\x18\x18\x18\x3c\x00\x00\x00\x00'\ 65 | b'\x00\x00\xfe\xc6\x86\x0c\x18\x30\x60\xc2\xc6\xfe\x00\x00\x00\x00'\ 66 | b'\x00\x00\x3c\x30\x30\x30\x30\x30\x30\x30\x30\x3c\x00\x00\x00\x00'\ 67 | b'\x00\x00\x00\x80\xc0\xe0\x70\x38\x1c\x0e\x06\x02\x00\x00\x00\x00'\ 68 | b'\x00\x00\x3c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x3c\x00\x00\x00\x00'\ 69 | b'\x10\x38\x6c\xc6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 70 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\x00'\ 71 | b'\x00\x30\x18\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 72 | b'\x00\x00\x00\x00\x00\x78\x0c\x7c\xcc\xcc\xcc\x76\x00\x00\x00\x00'\ 73 | b'\x00\x00\xe0\x60\x60\x78\x6c\x66\x66\x66\x66\x7c\x00\x00\x00\x00'\ 74 | b'\x00\x00\x00\x00\x00\x7c\xc6\xc0\xc0\xc0\xc6\x7c\x00\x00\x00\x00'\ 75 | b'\x00\x00\x1c\x0c\x0c\x3c\x6c\xcc\xcc\xcc\xcc\x76\x00\x00\x00\x00'\ 76 | b'\x00\x00\x00\x00\x00\x7c\xc6\xfe\xc0\xc0\xc6\x7c\x00\x00\x00\x00'\ 77 | b'\x00\x00\x1c\x36\x32\x30\x78\x30\x30\x30\x30\x78\x00\x00\x00\x00'\ 78 | b'\x00\x00\x00\x00\x00\x76\xcc\xcc\xcc\xcc\xcc\x7c\x0c\xcc\x78\x00'\ 79 | b'\x00\x00\xe0\x60\x60\x6c\x76\x66\x66\x66\x66\xe6\x00\x00\x00\x00'\ 80 | b'\x00\x00\x18\x18\x00\x38\x18\x18\x18\x18\x18\x3c\x00\x00\x00\x00'\ 81 | b'\x00\x00\x06\x06\x00\x0e\x06\x06\x06\x06\x06\x06\x66\x66\x3c\x00'\ 82 | b'\x00\x00\xe0\x60\x60\x66\x6c\x78\x78\x6c\x66\xe6\x00\x00\x00\x00'\ 83 | b'\x00\x00\x38\x18\x18\x18\x18\x18\x18\x18\x18\x3c\x00\x00\x00\x00'\ 84 | b'\x00\x00\x00\x00\x00\xec\xfe\xd6\xd6\xd6\xd6\xc6\x00\x00\x00\x00'\ 85 | b'\x00\x00\x00\x00\x00\xdc\x66\x66\x66\x66\x66\x66\x00\x00\x00\x00'\ 86 | b'\x00\x00\x00\x00\x00\x7c\xc6\xc6\xc6\xc6\xc6\x7c\x00\x00\x00\x00'\ 87 | b'\x00\x00\x00\x00\x00\xdc\x66\x66\x66\x66\x66\x7c\x60\x60\xf0\x00'\ 88 | b'\x00\x00\x00\x00\x00\x76\xcc\xcc\xcc\xcc\xcc\x7c\x0c\x0c\x1e\x00'\ 89 | b'\x00\x00\x00\x00\x00\xdc\x76\x66\x60\x60\x60\xf0\x00\x00\x00\x00'\ 90 | b'\x00\x00\x00\x00\x00\x7c\xc6\x60\x38\x0c\xc6\x7c\x00\x00\x00\x00'\ 91 | b'\x00\x00\x10\x30\x30\xfc\x30\x30\x30\x30\x36\x1c\x00\x00\x00\x00'\ 92 | b'\x00\x00\x00\x00\x00\xcc\xcc\xcc\xcc\xcc\xcc\x76\x00\x00\x00\x00'\ 93 | b'\x00\x00\x00\x00\x00\xc6\xc6\xc6\xc6\xc6\x6c\x38\x00\x00\x00\x00'\ 94 | b'\x00\x00\x00\x00\x00\xc6\xc6\xd6\xd6\xd6\xfe\x6c\x00\x00\x00\x00'\ 95 | b'\x00\x00\x00\x00\x00\xc6\x6c\x38\x38\x38\x6c\xc6\x00\x00\x00\x00'\ 96 | b'\x00\x00\x00\x00\x00\xc6\xc6\xc6\xc6\xc6\xc6\x7e\x06\x0c\xf8\x00'\ 97 | b'\x00\x00\x00\x00\x00\xfe\xcc\x18\x30\x60\xc6\xfe\x00\x00\x00\x00'\ 98 | b'\x00\x00\x0e\x18\x18\x18\x70\x18\x18\x18\x18\x0e\x00\x00\x00\x00'\ 99 | b'\x00\x00\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x00\x00\x00\x00'\ 100 | b'\x00\x00\x70\x18\x18\x18\x0e\x18\x18\x18\x18\x70\x00\x00\x00\x00'\ 101 | b'\x00\x76\xdc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 102 | b'\x00\x00\x00\x00\x10\x38\x6c\xc6\xc6\xc6\xfe\x00\x00\x00\x00\x00'\ 103 | 104 | FONT = memoryview(_FONT) 105 | -------------------------------------------------------------------------------- /fonts/bitmap/vga1_8x8.py: -------------------------------------------------------------------------------- 1 | """converted from vga_8x8.bin """ 2 | WIDTH = 8 3 | HEIGHT = 8 4 | FIRST = 0x20 5 | LAST = 0x7f 6 | _FONT =\ 7 | b'\x00\x00\x00\x00\x00\x00\x00\x00'\ 8 | b'\x18\x3c\x3c\x18\x18\x00\x18\x00'\ 9 | b'\x66\x66\x24\x00\x00\x00\x00\x00'\ 10 | b'\x6c\x6c\xfe\x6c\xfe\x6c\x6c\x00'\ 11 | b'\x18\x3e\x60\x3c\x06\x7c\x18\x00'\ 12 | b'\x00\xc6\xcc\x18\x30\x66\xc6\x00'\ 13 | b'\x38\x6c\x38\x76\xdc\xcc\x76\x00'\ 14 | b'\x18\x18\x30\x00\x00\x00\x00\x00'\ 15 | b'\x0c\x18\x30\x30\x30\x18\x0c\x00'\ 16 | b'\x30\x18\x0c\x0c\x0c\x18\x30\x00'\ 17 | b'\x00\x66\x3c\xff\x3c\x66\x00\x00'\ 18 | b'\x00\x18\x18\x7e\x18\x18\x00\x00'\ 19 | b'\x00\x00\x00\x00\x00\x18\x18\x30'\ 20 | b'\x00\x00\x00\x7e\x00\x00\x00\x00'\ 21 | b'\x00\x00\x00\x00\x00\x18\x18\x00'\ 22 | b'\x06\x0c\x18\x30\x60\xc0\x80\x00'\ 23 | b'\x38\x6c\xc6\xd6\xc6\x6c\x38\x00'\ 24 | b'\x18\x38\x18\x18\x18\x18\x7e\x00'\ 25 | b'\x7c\xc6\x06\x1c\x30\x66\xfe\x00'\ 26 | b'\x7c\xc6\x06\x3c\x06\xc6\x7c\x00'\ 27 | b'\x1c\x3c\x6c\xcc\xfe\x0c\x1e\x00'\ 28 | b'\xfe\xc0\xc0\xfc\x06\xc6\x7c\x00'\ 29 | b'\x38\x60\xc0\xfc\xc6\xc6\x7c\x00'\ 30 | b'\xfe\xc6\x0c\x18\x30\x30\x30\x00'\ 31 | b'\x7c\xc6\xc6\x7c\xc6\xc6\x7c\x00'\ 32 | b'\x7c\xc6\xc6\x7e\x06\x0c\x78\x00'\ 33 | b'\x00\x18\x18\x00\x00\x18\x18\x00'\ 34 | b'\x00\x18\x18\x00\x00\x18\x18\x30'\ 35 | b'\x06\x0c\x18\x30\x18\x0c\x06\x00'\ 36 | b'\x00\x00\x7e\x00\x00\x7e\x00\x00'\ 37 | b'\x60\x30\x18\x0c\x18\x30\x60\x00'\ 38 | b'\x7c\xc6\x0c\x18\x18\x00\x18\x00'\ 39 | b'\x7c\xc6\xde\xde\xde\xc0\x78\x00'\ 40 | b'\x38\x6c\xc6\xfe\xc6\xc6\xc6\x00'\ 41 | b'\xfc\x66\x66\x7c\x66\x66\xfc\x00'\ 42 | b'\x3c\x66\xc0\xc0\xc0\x66\x3c\x00'\ 43 | b'\xf8\x6c\x66\x66\x66\x6c\xf8\x00'\ 44 | b'\xfe\x62\x68\x78\x68\x62\xfe\x00'\ 45 | b'\xfe\x62\x68\x78\x68\x60\xf0\x00'\ 46 | b'\x3c\x66\xc0\xc0\xce\x66\x3a\x00'\ 47 | b'\xc6\xc6\xc6\xfe\xc6\xc6\xc6\x00'\ 48 | b'\x3c\x18\x18\x18\x18\x18\x3c\x00'\ 49 | b'\x1e\x0c\x0c\x0c\xcc\xcc\x78\x00'\ 50 | b'\xe6\x66\x6c\x78\x6c\x66\xe6\x00'\ 51 | b'\xf0\x60\x60\x60\x62\x66\xfe\x00'\ 52 | b'\xc6\xee\xfe\xfe\xd6\xc6\xc6\x00'\ 53 | b'\xc6\xe6\xf6\xde\xce\xc6\xc6\x00'\ 54 | b'\x7c\xc6\xc6\xc6\xc6\xc6\x7c\x00'\ 55 | b'\xfc\x66\x66\x7c\x60\x60\xf0\x00'\ 56 | b'\x7c\xc6\xc6\xc6\xc6\xce\x7c\x0e'\ 57 | b'\xfc\x66\x66\x7c\x6c\x66\xe6\x00'\ 58 | b'\x3c\x66\x30\x18\x0c\x66\x3c\x00'\ 59 | b'\x7e\x7e\x5a\x18\x18\x18\x3c\x00'\ 60 | b'\xc6\xc6\xc6\xc6\xc6\xc6\x7c\x00'\ 61 | b'\xc6\xc6\xc6\xc6\xc6\x6c\x38\x00'\ 62 | b'\xc6\xc6\xc6\xd6\xd6\xfe\x6c\x00'\ 63 | b'\xc6\xc6\x6c\x38\x6c\xc6\xc6\x00'\ 64 | b'\x66\x66\x66\x3c\x18\x18\x3c\x00'\ 65 | b'\xfe\xc6\x8c\x18\x32\x66\xfe\x00'\ 66 | b'\x3c\x30\x30\x30\x30\x30\x3c\x00'\ 67 | b'\xc0\x60\x30\x18\x0c\x06\x02\x00'\ 68 | b'\x3c\x0c\x0c\x0c\x0c\x0c\x3c\x00'\ 69 | b'\x10\x38\x6c\xc6\x00\x00\x00\x00'\ 70 | b'\x00\x00\x00\x00\x00\x00\x00\xff'\ 71 | b'\x30\x18\x0c\x00\x00\x00\x00\x00'\ 72 | b'\x00\x00\x78\x0c\x7c\xcc\x76\x00'\ 73 | b'\xe0\x60\x7c\x66\x66\x66\xdc\x00'\ 74 | b'\x00\x00\x7c\xc6\xc0\xc6\x7c\x00'\ 75 | b'\x1c\x0c\x7c\xcc\xcc\xcc\x76\x00'\ 76 | b'\x00\x00\x7c\xc6\xfe\xc0\x7c\x00'\ 77 | b'\x3c\x66\x60\xf8\x60\x60\xf0\x00'\ 78 | b'\x00\x00\x76\xcc\xcc\x7c\x0c\xf8'\ 79 | b'\xe0\x60\x6c\x76\x66\x66\xe6\x00'\ 80 | b'\x18\x00\x38\x18\x18\x18\x3c\x00'\ 81 | b'\x06\x00\x06\x06\x06\x66\x66\x3c'\ 82 | b'\xe0\x60\x66\x6c\x78\x6c\xe6\x00'\ 83 | b'\x38\x18\x18\x18\x18\x18\x3c\x00'\ 84 | b'\x00\x00\xec\xfe\xd6\xd6\xd6\x00'\ 85 | b'\x00\x00\xdc\x66\x66\x66\x66\x00'\ 86 | b'\x00\x00\x7c\xc6\xc6\xc6\x7c\x00'\ 87 | b'\x00\x00\xdc\x66\x66\x7c\x60\xf0'\ 88 | b'\x00\x00\x76\xcc\xcc\x7c\x0c\x1e'\ 89 | b'\x00\x00\xdc\x76\x60\x60\xf0\x00'\ 90 | b'\x00\x00\x7e\xc0\x7c\x06\xfc\x00'\ 91 | b'\x30\x30\xfc\x30\x30\x36\x1c\x00'\ 92 | b'\x00\x00\xcc\xcc\xcc\xcc\x76\x00'\ 93 | b'\x00\x00\xc6\xc6\xc6\x6c\x38\x00'\ 94 | b'\x00\x00\xc6\xd6\xd6\xfe\x6c\x00'\ 95 | b'\x00\x00\xc6\x6c\x38\x6c\xc6\x00'\ 96 | b'\x00\x00\xc6\xc6\xc6\x7e\x06\xfc'\ 97 | b'\x00\x00\x7e\x4c\x18\x32\x7e\x00'\ 98 | b'\x0e\x18\x18\x70\x18\x18\x0e\x00'\ 99 | b'\x18\x18\x18\x18\x18\x18\x18\x00'\ 100 | b'\x70\x18\x18\x0e\x18\x18\x70\x00'\ 101 | b'\x76\xdc\x00\x00\x00\x00\x00\x00'\ 102 | b'\x00\x10\x38\x6c\xc6\xc6\xfe\x00'\ 103 | 104 | FONT = memoryview(_FONT) 105 | -------------------------------------------------------------------------------- /fonts/truetype/Chango-OFL.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Fontstage (info@fontstage.com), 2 | with Reserved Font Names, "Chango" 3 | 4 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 5 | This license is copied below, and is also available with a FAQ at: 6 | http://scripts.sil.org/OFL 7 | 8 | 9 | ----------------------------------------------------------- 10 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 11 | ----------------------------------------------------------- 12 | 13 | PREAMBLE 14 | The goals of the Open Font License (OFL) are to stimulate worldwide 15 | development of collaborative font projects, to support the font creation 16 | efforts of academic and linguistic communities, and to provide a free and 17 | open framework in which fonts may be shared and improved in partnership 18 | with others. 19 | 20 | The OFL allows the licensed fonts to be used, studied, modified and 21 | redistributed freely as long as they are not sold by themselves. The 22 | fonts, including any derivative works, can be bundled, embedded, 23 | redistributed and/or sold with any software provided that any reserved 24 | names are not used by derivative works. The fonts and derivatives, 25 | however, cannot be released under any other type of license. The 26 | requirement for fonts to remain under this license does not apply 27 | to any document created using the fonts or their derivatives. 28 | 29 | DEFINITIONS 30 | "Font Software" refers to the set of files released by the Copyright 31 | Holder(s) under this license and clearly marked as such. This may 32 | include source files, build scripts and documentation. 33 | 34 | "Reserved Font Name" refers to any names specified as such after the 35 | copyright statement(s). 36 | 37 | "Original Version" refers to the collection of Font Software components as 38 | distributed by the Copyright Holder(s). 39 | 40 | "Modified Version" refers to any derivative made by adding to, deleting, 41 | or substituting -- in part or in whole -- any of the components of the 42 | Original Version, by changing formats or by porting the Font Software to a 43 | new environment. 44 | 45 | "Author" refers to any designer, engineer, programmer, technical 46 | writer or other person who contributed to the Font Software. 47 | 48 | PERMISSION & CONDITIONS 49 | Permission is hereby granted, free of charge, to any person obtaining 50 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 51 | redistribute, and sell modified and unmodified copies of the Font 52 | Software, subject to the following conditions: 53 | 54 | 1) Neither the Font Software nor any of its individual components, 55 | in Original or Modified Versions, may be sold by itself. 56 | 57 | 2) Original or Modified Versions of the Font Software may be bundled, 58 | redistributed and/or sold with any software, provided that each copy 59 | contains the above copyright notice and this license. These can be 60 | included either as stand-alone text files, human-readable headers or 61 | in the appropriate machine-readable metadata fields within text or 62 | binary files as long as those fields can be easily viewed by the user. 63 | 64 | 3) No Modified Version of the Font Software may use the Reserved Font 65 | Name(s) unless explicit written permission is granted by the corresponding 66 | Copyright Holder. This restriction only applies to the primary font name as 67 | presented to the users. 68 | 69 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 70 | Software shall not be used to promote, endorse or advertise any 71 | Modified Version, except to acknowledge the contribution(s) of the 72 | Copyright Holder(s) and the Author(s) or with their explicit written 73 | permission. 74 | 75 | 5) The Font Software, modified or unmodified, in part or in whole, 76 | must be distributed entirely under this license, and must not be 77 | distributed under any other license. The requirement for fonts to 78 | remain under this license does not apply to any document created 79 | using the Font Software. 80 | 81 | TERMINATION 82 | This license becomes null and void if any of the above conditions are 83 | not met. 84 | 85 | DISCLAIMER 86 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 87 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 88 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 89 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 90 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 91 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 92 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 93 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 94 | OTHER DEALINGS IN THE FONT SOFTWARE. 95 | -------------------------------------------------------------------------------- /fonts/truetype/Chango-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/fonts/truetype/Chango-Regular.ttf -------------------------------------------------------------------------------- /fonts/truetype/LibreFranklin-OFL.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Impallari Type (www.impallari.com) 2 | 3 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 4 | This license is copied below, and is also available with a FAQ at: 5 | http://scripts.sil.org/OFL 6 | 7 | 8 | ----------------------------------------------------------- 9 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 10 | ----------------------------------------------------------- 11 | 12 | PREAMBLE 13 | The goals of the Open Font License (OFL) are to stimulate worldwide 14 | development of collaborative font projects, to support the font creation 15 | efforts of academic and linguistic communities, and to provide a free and 16 | open framework in which fonts may be shared and improved in partnership 17 | with others. 18 | 19 | The OFL allows the licensed fonts to be used, studied, modified and 20 | redistributed freely as long as they are not sold by themselves. The 21 | fonts, including any derivative works, can be bundled, embedded, 22 | redistributed and/or sold with any software provided that any reserved 23 | names are not used by derivative works. The fonts and derivatives, 24 | however, cannot be released under any other type of license. The 25 | requirement for fonts to remain under this license does not apply 26 | to any document created using the fonts or their derivatives. 27 | 28 | DEFINITIONS 29 | "Font Software" refers to the set of files released by the Copyright 30 | Holder(s) under this license and clearly marked as such. This may 31 | include source files, build scripts and documentation. 32 | 33 | "Reserved Font Name" refers to any names specified as such after the 34 | copyright statement(s). 35 | 36 | "Original Version" refers to the collection of Font Software components as 37 | distributed by the Copyright Holder(s). 38 | 39 | "Modified Version" refers to any derivative made by adding to, deleting, 40 | or substituting -- in part or in whole -- any of the components of the 41 | Original Version, by changing formats or by porting the Font Software to a 42 | new environment. 43 | 44 | "Author" refers to any designer, engineer, programmer, technical 45 | writer or other person who contributed to the Font Software. 46 | 47 | PERMISSION & CONDITIONS 48 | Permission is hereby granted, free of charge, to any person obtaining 49 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 50 | redistribute, and sell modified and unmodified copies of the Font 51 | Software, subject to the following conditions: 52 | 53 | 1) Neither the Font Software nor any of its individual components, 54 | in Original or Modified Versions, may be sold by itself. 55 | 56 | 2) Original or Modified Versions of the Font Software may be bundled, 57 | redistributed and/or sold with any software, provided that each copy 58 | contains the above copyright notice and this license. These can be 59 | included either as stand-alone text files, human-readable headers or 60 | in the appropriate machine-readable metadata fields within text or 61 | binary files as long as those fields can be easily viewed by the user. 62 | 63 | 3) No Modified Version of the Font Software may use the Reserved Font 64 | Name(s) unless explicit written permission is granted by the corresponding 65 | Copyright Holder. This restriction only applies to the primary font name as 66 | presented to the users. 67 | 68 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 69 | Software shall not be used to promote, endorse or advertise any 70 | Modified Version, except to acknowledge the contribution(s) of the 71 | Copyright Holder(s) and the Author(s) or with their explicit written 72 | permission. 73 | 74 | 5) The Font Software, modified or unmodified, in part or in whole, 75 | must be distributed entirely under this license, and must not be 76 | distributed under any other license. The requirement for fonts to 77 | remain under this license does not apply to any document created 78 | using the Font Software. 79 | 80 | TERMINATION 81 | This license becomes null and void if any of the above conditions are 82 | not met. 83 | 84 | DISCLAIMER 85 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 86 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 87 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 88 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 89 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 90 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 91 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 92 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 93 | OTHER DEALINGS IN THE FONT SOFTWARE. 94 | -------------------------------------------------------------------------------- /fonts/truetype/LibreFranklin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/fonts/truetype/LibreFranklin.ttf -------------------------------------------------------------------------------- /fonts/truetype/README.md: -------------------------------------------------------------------------------- 1 | # SIL Open Font License fonts 2 | 3 | Here are a few of the SIL Open Font Licensed fonts I used for testing the 4 | `monofont2bitmap` and `font2bitmap` utilies. 5 | 6 | ## Proportional fonts 7 | 8 | These are suitable for use with `font2bitmap` utility and the drivers `write` 9 | method. 10 | 11 | - Chango-Regular.ttf 12 | - LibreFranklin.ttf 13 | 14 | ## Monospaced fonts 15 | 16 | This font is suitable for use with `font2bitmap` utility and the drivers `write` 17 | method. It can also be used with the `monofont2bitmap` utility and the drivers 18 | `bitmap` method. 19 | 20 | - inconsolata-700.ttf 21 | 22 | -------------------------------------------------------------------------------- /fonts/truetype/inconsolata-700.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/fonts/truetype/inconsolata-700.ttf -------------------------------------------------------------------------------- /fonts/truetype/inconsolata-OFL.txt: -------------------------------------------------------------------------------- 1 | Copyright 2006 The Inconsolata Project Authors (https://github.com/cyrealtype/Inconsolata) 2 | 3 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 4 | This license is copied below, and is also available with a FAQ at: 5 | http://scripts.sil.org/OFL 6 | 7 | 8 | ----------------------------------------------------------- 9 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 10 | ----------------------------------------------------------- 11 | 12 | PREAMBLE 13 | The goals of the Open Font License (OFL) are to stimulate worldwide 14 | development of collaborative font projects, to support the font creation 15 | efforts of academic and linguistic communities, and to provide a free and 16 | open framework in which fonts may be shared and improved in partnership 17 | with others. 18 | 19 | The OFL allows the licensed fonts to be used, studied, modified and 20 | redistributed freely as long as they are not sold by themselves. The 21 | fonts, including any derivative works, can be bundled, embedded, 22 | redistributed and/or sold with any software provided that any reserved 23 | names are not used by derivative works. The fonts and derivatives, 24 | however, cannot be released under any other type of license. The 25 | requirement for fonts to remain under this license does not apply 26 | to any document created using the fonts or their derivatives. 27 | 28 | DEFINITIONS 29 | "Font Software" refers to the set of files released by the Copyright 30 | Holder(s) under this license and clearly marked as such. This may 31 | include source files, build scripts and documentation. 32 | 33 | "Reserved Font Name" refers to any names specified as such after the 34 | copyright statement(s). 35 | 36 | "Original Version" refers to the collection of Font Software components as 37 | distributed by the Copyright Holder(s). 38 | 39 | "Modified Version" refers to any derivative made by adding to, deleting, 40 | or substituting -- in part or in whole -- any of the components of the 41 | Original Version, by changing formats or by porting the Font Software to a 42 | new environment. 43 | 44 | "Author" refers to any designer, engineer, programmer, technical 45 | writer or other person who contributed to the Font Software. 46 | 47 | PERMISSION & CONDITIONS 48 | Permission is hereby granted, free of charge, to any person obtaining 49 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 50 | redistribute, and sell modified and unmodified copies of the Font 51 | Software, subject to the following conditions: 52 | 53 | 1) Neither the Font Software nor any of its individual components, 54 | in Original or Modified Versions, may be sold by itself. 55 | 56 | 2) Original or Modified Versions of the Font Software may be bundled, 57 | redistributed and/or sold with any software, provided that each copy 58 | contains the above copyright notice and this license. These can be 59 | included either as stand-alone text files, human-readable headers or 60 | in the appropriate machine-readable metadata fields within text or 61 | binary files as long as those fields can be easily viewed by the user. 62 | 63 | 3) No Modified Version of the Font Software may use the Reserved Font 64 | Name(s) unless explicit written permission is granted by the corresponding 65 | Copyright Holder. This restriction only applies to the primary font name as 66 | presented to the users. 67 | 68 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 69 | Software shall not be used to promote, endorse or advertise any 70 | Modified Version, except to acknowledge the contribution(s) of the 71 | Copyright Holder(s) and the Author(s) or with their explicit written 72 | permission. 73 | 74 | 5) The Font Software, modified or unmodified, in part or in whole, 75 | must be distributed entirely under this license, and must not be 76 | distributed under any other license. The requirement for fonts to 77 | remain under this license does not apply to any document created 78 | using the Font Software. 79 | 80 | TERMINATION 81 | This license becomes null and void if any of the above conditions are 82 | not met. 83 | 84 | DISCLAIMER 85 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 86 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 87 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 88 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 89 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 90 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 91 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 92 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 93 | OTHER DEALINGS IN THE FONT SOFTWARE. 94 | -------------------------------------------------------------------------------- /fonts/vector/README.md: -------------------------------------------------------------------------------- 1 | # Included Font Files 2 | 3 | Frozen font files are included in the firmware. 4 | 5 | ## Vector fonts for use with the Draw method 6 | 7 | ### Hershey Vector Fonts 8 | 9 | Frozen | Font | Example 10 | ------ | ---------------------------------------- | ---------------------- 11 | No | [astrol.py](/fonts/vector/astrol.py) | ![Image](/docs/astrol.svg) 12 | Yes | [cyrilc.py](/fonts/vector/cyrilc.py) | ![Image](/docs/cyrilc.svg) 13 | Yes | [gotheng.py](/fonts/vector/gotheng.py) | ![Image](/docs/gotheng.svg) 14 | Yes | [gothger.py](/fonts/vector/gothger.py) | ![Image](/docs/gothger.svg) 15 | Yes | [gothita.py](/fonts/vector/gothita.py) | ![Image](/docs/gothita.svg) 16 | Yes | [greekc.py](/fonts/vector/greekc.py) | ![Image](/docs/greekc.svg) 17 | Yes | [greekcs.py](/fonts/vector/greekcs.py) | ![Image](/docs/greekcs.svg) 18 | Yes | [greekp.py](/fonts/vector/greekp.py) | ![Image](/docs/greekp.svg) 19 | Yes | [greeks.py](/fonts/vector/greeks.py) | ![Image](/docs/greeks.svg) 20 | Yes | [italicc.py](/fonts/vector/italicc.py) | ![Image](/docs/italicc.svg) 21 | Yes | [italiccs.py](/fonts/vector/italiccs.py) | ![Image](/docs/italiccs.svg) 22 | Yes | [italict.py](/fonts/vector/italict.py) | ![Image](/docs/italict.svg) 23 | Yes | [lowmat.py](/fonts/vector/lowmat.py) | ![Image](/docs/lowmat.svg) 24 | Yes | [marker.py](/fonts/vector/marker.py) | ![Image](/docs/marker.svg) 25 | Yes | [meteo.py](/fonts/vector/meteo.py) | ![Image](/docs/meteo.svg) 26 | Yes | [music.py](/fonts/vector/music.py) | ![Image](/docs/music.svg) 27 | Yes | [romanc.py](/fonts/vector/romanc.py) | ![Image](/docs/romanc.svg) 28 | Yes | [romancs.py](/fonts/vector/romancs.py) | ![Image](/docs/romancs.svg) 29 | Yes | [romand.py](/fonts/vector/romand.py) | ![Image](/docs/romand.svg) 30 | Yes | [romanp.py](/fonts/vector/romanp.py) | ![Image](/docs/romanp.svg) 31 | Yes | [romans.py](/fonts/vector/romans.py) | ![Image](/docs/romans.svg) 32 | Yes | [romant.py](/fonts/vector/romant.py) | ![Image](/docs/romant.svg) 33 | Yes | [scriptc.py](/fonts/vector/scriptc.py) | ![Image](/docs/scriptc.svg) 34 | Yes | [scripts.py](/fonts/vector/scripts.py) | ![Image](/docs/scripts.svg) 35 | Yes | [symbol.py](/fonts/vector/symbol.py) | ![Image](/docs/symbol.svg) 36 | Yes | [uppmat.py](/fonts/vector/uppmat.py) | ![Image](/docs/uppmat.svg) 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /fonts/vector/marker.py: -------------------------------------------------------------------------------- 1 | WIDTH = 26 2 | HEIGHT = 26 3 | FIRST = 0x20 4 | LAST = 0x7f 5 | 6 | _font =\ 7 | b'\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a'\ 8 | b'\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a'\ 9 | b'\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a'\ 10 | b'\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a'\ 11 | b'\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a'\ 12 | b'\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a'\ 13 | b'\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x11\x4b\x59\x51\x4b\x4e'\ 14 | b'\x4c\x4c\x4e\x4b\x51\x4b\x53\x4c\x56\x4e\x58\x51\x59\x53\x59'\ 15 | b'\x56\x58\x58\x56\x59\x53\x59\x51\x58\x4e\x56\x4c\x53\x4b\x51'\ 16 | b'\x4b\x05\x4c\x58\x4c\x4c\x4c\x58\x58\x58\x58\x4c\x4c\x4c\x04'\ 17 | b'\x4b\x59\x52\x4a\x4b\x56\x59\x56\x52\x4a\x05\x4c\x58\x52\x48'\ 18 | b'\x4c\x52\x52\x5c\x58\x52\x52\x48\x0b\x4a\x5a\x52\x49\x50\x4f'\ 19 | b'\x4a\x4f\x4f\x53\x4d\x59\x52\x55\x57\x59\x55\x53\x5a\x4f\x54'\ 20 | b'\x4f\x52\x49\x0d\x4c\x58\x50\x4c\x50\x50\x4c\x50\x4c\x54\x50'\ 21 | b'\x54\x50\x58\x54\x58\x54\x54\x58\x54\x58\x50\x54\x50\x54\x4c'\ 22 | b'\x50\x4c\x05\x4b\x59\x52\x4b\x52\x59\x20\x52\x4b\x52\x59\x52'\ 23 | b'\x05\x4d\x57\x4d\x4d\x57\x57\x20\x52\x57\x4d\x4d\x57\x08\x4d'\ 24 | b'\x57\x52\x4c\x52\x58\x20\x52\x4d\x4f\x57\x55\x20\x52\x57\x4f'\ 25 | b'\x4d\x55\x22\x4e\x56\x51\x4e\x4f\x4f\x4e\x51\x4e\x53\x4f\x55'\ 26 | b'\x51\x56\x53\x56\x55\x55\x56\x53\x56\x51\x55\x4f\x53\x4e\x51'\ 27 | b'\x4e\x20\x52\x4f\x51\x4f\x53\x20\x52\x50\x50\x50\x54\x20\x52'\ 28 | b'\x51\x4f\x51\x55\x20\x52\x52\x4f\x52\x55\x20\x52\x53\x4f\x53'\ 29 | b'\x55\x20\x52\x54\x50\x54\x54\x20\x52\x55\x51\x55\x53\x1a\x4e'\ 30 | b'\x56\x4e\x4e\x4e\x56\x56\x56\x56\x4e\x4e\x4e\x20\x52\x4f\x4f'\ 31 | b'\x4f\x55\x20\x52\x50\x4f\x50\x55\x20\x52\x51\x4f\x51\x55\x20'\ 32 | b'\x52\x52\x4f\x52\x55\x20\x52\x53\x4f\x53\x55\x20\x52\x54\x4f'\ 33 | b'\x54\x55\x20\x52\x55\x4f\x55\x55\x10\x4d\x57\x52\x4c\x4d\x55'\ 34 | b'\x57\x55\x52\x4c\x20\x52\x52\x4f\x4f\x54\x20\x52\x52\x4f\x55'\ 35 | b'\x54\x20\x52\x52\x52\x51\x54\x20\x52\x52\x52\x53\x54\x10\x4c'\ 36 | b'\x55\x4c\x52\x55\x57\x55\x4d\x4c\x52\x20\x52\x4f\x52\x54\x55'\ 37 | b'\x20\x52\x4f\x52\x54\x4f\x20\x52\x52\x52\x54\x53\x20\x52\x52'\ 38 | b'\x52\x54\x51\x10\x4d\x57\x52\x58\x57\x4f\x4d\x4f\x52\x58\x20'\ 39 | b'\x52\x52\x55\x55\x50\x20\x52\x52\x55\x4f\x50\x20\x52\x52\x52'\ 40 | b'\x53\x50\x20\x52\x52\x52\x51\x50\x10\x4f\x58\x58\x52\x4f\x4d'\ 41 | b'\x4f\x57\x58\x52\x20\x52\x55\x52\x50\x4f\x20\x52\x55\x52\x50'\ 42 | b'\x55\x20\x52\x52\x52\x50\x51\x20\x52\x52\x52\x50\x53\x08\x44'\ 43 | b'\x60\x44\x52\x60\x52\x20\x52\x44\x52\x52\x62\x20\x52\x60\x52'\ 44 | b'\x52\x62\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00'\ 45 | b'\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00'\ 46 | b'\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00'\ 47 | b'\x4a\x5a\x00\x4a\x5a\x11\x4b\x59\x51\x4b\x4e\x4c\x4c\x4e\x4b'\ 48 | b'\x51\x4b\x53\x4c\x56\x4e\x58\x51\x59\x53\x59\x56\x58\x58\x56'\ 49 | b'\x59\x53\x59\x51\x58\x4e\x56\x4c\x53\x4b\x51\x4b\x05\x4c\x58'\ 50 | b'\x4c\x4c\x4c\x58\x58\x58\x58\x4c\x4c\x4c\x04\x4b\x59\x52\x4a'\ 51 | b'\x4b\x56\x59\x56\x52\x4a\x05\x4c\x58\x52\x48\x4c\x52\x52\x5c'\ 52 | b'\x58\x52\x52\x48\x0b\x4a\x5a\x52\x49\x50\x4f\x4a\x4f\x4f\x53'\ 53 | b'\x4d\x59\x52\x55\x57\x59\x55\x53\x5a\x4f\x54\x4f\x52\x49\x0d'\ 54 | b'\x4c\x58\x50\x4c\x50\x50\x4c\x50\x4c\x54\x50\x54\x50\x58\x54'\ 55 | b'\x58\x54\x54\x58\x54\x58\x50\x54\x50\x54\x4c\x50\x4c\x05\x4b'\ 56 | b'\x59\x52\x4b\x52\x59\x20\x52\x4b\x52\x59\x52\x05\x4d\x57\x4d'\ 57 | b'\x4d\x57\x57\x20\x52\x57\x4d\x4d\x57\x08\x4d\x57\x52\x4c\x52'\ 58 | b'\x58\x20\x52\x4d\x4f\x57\x55\x20\x52\x57\x4f\x4d\x55\x22\x4e'\ 59 | b'\x56\x51\x4e\x4f\x4f\x4e\x51\x4e\x53\x4f\x55\x51\x56\x53\x56'\ 60 | b'\x55\x55\x56\x53\x56\x51\x55\x4f\x53\x4e\x51\x4e\x20\x52\x4f'\ 61 | b'\x51\x4f\x53\x20\x52\x50\x50\x50\x54\x20\x52\x51\x4f\x51\x55'\ 62 | b'\x20\x52\x52\x4f\x52\x55\x20\x52\x53\x4f\x53\x55\x20\x52\x54'\ 63 | b'\x50\x54\x54\x20\x52\x55\x51\x55\x53\x1a\x4e\x56\x4e\x4e\x4e'\ 64 | b'\x56\x56\x56\x56\x4e\x4e\x4e\x20\x52\x4f\x4f\x4f\x55\x20\x52'\ 65 | b'\x50\x4f\x50\x55\x20\x52\x51\x4f\x51\x55\x20\x52\x52\x4f\x52'\ 66 | b'\x55\x20\x52\x53\x4f\x53\x55\x20\x52\x54\x4f\x54\x55\x20\x52'\ 67 | b'\x55\x4f\x55\x55\x10\x4d\x57\x52\x4c\x4d\x55\x57\x55\x52\x4c'\ 68 | b'\x20\x52\x52\x4f\x4f\x54\x20\x52\x52\x4f\x55\x54\x20\x52\x52'\ 69 | b'\x52\x51\x54\x20\x52\x52\x52\x53\x54\x10\x4c\x55\x4c\x52\x55'\ 70 | b'\x57\x55\x4d\x4c\x52\x20\x52\x4f\x52\x54\x55\x20\x52\x4f\x52'\ 71 | b'\x54\x4f\x20\x52\x52\x52\x54\x53\x20\x52\x52\x52\x54\x51\x10'\ 72 | b'\x4d\x57\x52\x58\x57\x4f\x4d\x4f\x52\x58\x20\x52\x52\x55\x55'\ 73 | b'\x50\x20\x52\x52\x55\x4f\x50\x20\x52\x52\x52\x53\x50\x20\x52'\ 74 | b'\x52\x52\x51\x50\x10\x4f\x58\x58\x52\x4f\x4d\x4f\x57\x58\x52'\ 75 | b'\x20\x52\x55\x52\x50\x4f\x20\x52\x55\x52\x50\x55\x20\x52\x52'\ 76 | b'\x52\x50\x51\x20\x52\x52\x52\x50\x53\x08\x44\x60\x44\x52\x60'\ 77 | b'\x52\x20\x52\x44\x52\x52\x62\x20\x52\x60\x52\x52\x62\x00\x4a'\ 78 | b'\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a'\ 79 | b'\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a'\ 80 | b'\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a'\ 81 | b'\x5a' 82 | 83 | _index =\ 84 | b'\x00\x00\x03\x00\x06\x00\x09\x00\x0c\x00\x0f\x00\x12\x00\x15'\ 85 | b'\x00\x18\x00\x1b\x00\x1e\x00\x21\x00\x24\x00\x27\x00\x2a\x00'\ 86 | b'\x2d\x00\x30\x00\x33\x00\x36\x00\x39\x00\x3c\x00\x3f\x00\x42'\ 87 | b'\x00\x45\x00\x48\x00\x4b\x00\x4e\x00\x51\x00\x54\x00\x57\x00'\ 88 | b'\x5a\x00\x5d\x00\x60\x00\x63\x00\x88\x00\x95\x00\xa0\x00\xad'\ 89 | b'\x00\xc6\x00\xe3\x00\xf0\x00\xfd\x00\x10\x01\x57\x01\x8e\x01'\ 90 | b'\xb1\x01\xd4\x01\xf7\x01\x1a\x02\x2d\x02\x30\x02\x33\x02\x36'\ 91 | b'\x02\x39\x02\x3c\x02\x3f\x02\x42\x02\x45\x02\x48\x02\x4b\x02'\ 92 | b'\x4e\x02\x51\x02\x54\x02\x57\x02\x5a\x02\x5d\x02\x82\x02\x8f'\ 93 | b'\x02\x9a\x02\xa7\x02\xc0\x02\xdd\x02\xea\x02\xf7\x02\x0a\x03'\ 94 | b'\x51\x03\x88\x03\xab\x03\xce\x03\xf1\x03\x14\x04\x27\x04\x2a'\ 95 | b'\x04\x2d\x04\x30\x04\x33\x04\x36\x04\x39\x04\x3c\x04\x3f\x04'\ 96 | b'\x42\x04\x45\x04\x48\x04\x4b\x04\x4e\x04\x51\x04\x54\x04' 97 | 98 | INDEX = memoryview(_index) 99 | FONT = memoryview(_font) 100 | -------------------------------------------------------------------------------- /lib/focaltouch.py: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | # 3 | # Copyright (c) 2017 ladyada for adafruit industries 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | """ 23 | `adafruit_focaltouch` 24 | ==================================================== 25 | 26 | CircuitPython driver for common low-cost FocalTech capacitive touch chips. 27 | Currently supports FT6206 & FT6236. 28 | 29 | * Author(s): ladyada 30 | 31 | * adopted for micropython => franz schaefer (mond) 32 | 33 | Implementation Notes 34 | -------------------- 35 | 36 | **Hardware:** 37 | 38 | * Adafruit `2.8" TFT LCD with Cap Touch Breakout Board w/MicroSD Socket 39 | `_ (Product ID: 2090) 40 | 41 | * Adafruit `2.8" TFT Touch Shield for Arduino w/Capacitive Touch 42 | `_ (Product ID: 1947) 43 | 44 | **Software and Dependencies:** 45 | 46 | * Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: 47 | https://github.com/adafruit/circuitpython/releases 48 | * Adafruit's Bus Device library (when using I2C/SPI): 49 | https://github.com/adafruit/Adafruit_CircuitPython_BusDevice 50 | """ 51 | 52 | # imports 53 | 54 | try: 55 | import struct 56 | except ImportError: 57 | import ustruct as struct 58 | 59 | from machine import SoftI2C 60 | from micropython import const 61 | 62 | 63 | _FT6206_DEFAULT_I2C_ADDR = 0x38 64 | 65 | _FT6XXX_REG_DATA = const(0x00) 66 | _FT6XXX_REG_NUMTOUCHES = const(0x02) 67 | _FT6XXX_REG_THRESHHOLD = const(0x80) 68 | _FT6XXX_REG_POINTRATE = const(0x88) 69 | _FT6XXX_REG_LIBH = const(0xA1) 70 | _FT6XXX_REG_LIBL = const(0xA2) 71 | _FT6XXX_REG_CHIPID = const(0xA3) 72 | _FT6XXX_REG_FIRMVERS = const(0xA6) 73 | _FT6XXX_REG_VENDID = const(0xA8) 74 | _FT6XXX_REG_RELEASE = const(0xAF) 75 | 76 | 77 | class FocalTouch: 78 | """ 79 | A driver for the FocalTech capacitive touch sensor. 80 | """ 81 | 82 | _debug = False 83 | chip = None 84 | 85 | def __init__(self, i2c, address=_FT6206_DEFAULT_I2C_ADDR, debug=False): 86 | self.bus = i2c 87 | self.address = address 88 | self._debug = debug 89 | 90 | chip_data = self._read(_FT6XXX_REG_LIBH, 8) 91 | lib_ver, chip_id, _, _, firm_id, _, vend_id = struct.unpack( 92 | ">HBBBBBB", chip_data 93 | ) 94 | 95 | if debug: 96 | print("Vendor ID %02x" % vend_id) 97 | 98 | self.vend_id=vend_id 99 | if chip_id == 0x06: 100 | self.chip = "FT6206" 101 | elif chip_id == 0x64: 102 | self.chip = "FT6236" 103 | elif debug: 104 | print("Chip Id: %02x" % chip_id) 105 | 106 | if debug: 107 | print("Library vers %04X" % lib_ver) 108 | print("Firmware ID %02X" % firm_id) 109 | print("Point rate %d Hz" % self._read(_FT6XXX_REG_POINTRATE, 1)[0]) 110 | print("Thresh %d" % self._read(_FT6XXX_REG_THRESHHOLD, 1)[0]) 111 | 112 | 113 | @property 114 | def touched(self): 115 | """ Returns the number of touches currently detected """ 116 | return self._read(_FT6XXX_REG_NUMTOUCHES, 1)[0] 117 | 118 | # pylint: disable=unused-variable 119 | @property 120 | def touches(self): 121 | """ 122 | Returns a list of touchpoint dicts, with 'x' and 'y' containing the 123 | touch coordinates, and 'id' as the touch # for multitouch tracking 124 | """ 125 | touchpoints = [] 126 | data = self._read(_FT6XXX_REG_DATA, 32) 127 | 128 | for i in range(2): 129 | point_data = data[i * 6 + 3 : i * 6 + 9] 130 | if all([i == 0xFF for i in point_data]): 131 | continue 132 | # print([hex(i) for i in point_data]) 133 | x, y, weight, misc = struct.unpack(">HHBB", point_data) 134 | # print(x, y, weight, misc) 135 | touch_id = y >> 12 136 | x &= 0xFFF 137 | y &= 0xFFF 138 | point = {"x": x, "y": y, "id": touch_id} 139 | touchpoints.append(point) 140 | return touchpoints 141 | 142 | def _read(self, reg, length): 143 | """Returns an array of 'length' bytes from the 'register'""" 144 | result = bytearray(length) 145 | self.bus.readfrom_mem_into(self.address, reg, result) 146 | if self._debug: 147 | print("\t$%02X => %s" % (reg, [hex(i) for i in result])) 148 | return result 149 | 150 | def _write(self, reg, values): 151 | """Writes an array of 'length' bytes to the 'register'""" 152 | values = [(v & 0xFF) for v in values] 153 | self.bus.writeto_mem(self.address,reg,bytes(values)) 154 | if self._debug: 155 | print("\t$%02X <= %s" % (reg, [hex(i) for i in values])) 156 | -------------------------------------------------------------------------------- /manifest.py: -------------------------------------------------------------------------------- 1 | include("$(PORT_DIR)/boards/manifest.py") 2 | freeze("modules") 3 | -------------------------------------------------------------------------------- /modules/df.py: -------------------------------------------------------------------------------- 1 | import uos 2 | fs_stat = uos.statvfs('/flash') 3 | fs_size = fs_stat[0] * fs_stat[2] 4 | fs_free = fs_stat[0] * fs_stat[3] 5 | print("File System Size {:,} - Free Space {:,}".format(fs_size, fs_free)) 6 | -------------------------------------------------------------------------------- /modules/focaltouch.py: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | # 3 | # Copyright (c) 2017 ladyada for adafruit industries 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | """ 23 | `adafruit_focaltouch` 24 | ==================================================== 25 | 26 | CircuitPython driver for common low-cost FocalTech capacitive touch chips. 27 | Currently supports FT6206 & FT6236. 28 | 29 | * Author(s): ladyada 30 | 31 | * adopted for micropython => franz schaefer (mond) 32 | 33 | Implementation Notes 34 | -------------------- 35 | 36 | **Hardware:** 37 | 38 | * Adafruit `2.8" TFT LCD with Cap Touch Breakout Board w/MicroSD Socket 39 | `_ (Product ID: 2090) 40 | 41 | * Adafruit `2.8" TFT Touch Shield for Arduino w/Capacitive Touch 42 | `_ (Product ID: 1947) 43 | 44 | **Software and Dependencies:** 45 | 46 | * Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: 47 | https://github.com/adafruit/circuitpython/releases 48 | * Adafruit's Bus Device library (when using I2C/SPI): 49 | https://github.com/adafruit/Adafruit_CircuitPython_BusDevice 50 | """ 51 | 52 | # imports 53 | 54 | try: 55 | import struct 56 | except ImportError: 57 | import ustruct as struct 58 | 59 | from machine import SoftI2C 60 | from micropython import const 61 | 62 | 63 | _FT6206_DEFAULT_I2C_ADDR = 0x38 64 | 65 | _FT6XXX_REG_DATA = const(0x00) 66 | _FT6XXX_REG_NUMTOUCHES = const(0x02) 67 | _FT6XXX_REG_THRESHHOLD = const(0x80) 68 | _FT6XXX_REG_POINTRATE = const(0x88) 69 | _FT6XXX_REG_LIBH = const(0xA1) 70 | _FT6XXX_REG_LIBL = const(0xA2) 71 | _FT6XXX_REG_CHIPID = const(0xA3) 72 | _FT6XXX_REG_FIRMVERS = const(0xA6) 73 | _FT6XXX_REG_VENDID = const(0xA8) 74 | _FT6XXX_REG_RELEASE = const(0xAF) 75 | 76 | 77 | class FocalTouch: 78 | """ 79 | A driver for the FocalTech capacitive touch sensor. 80 | """ 81 | 82 | _debug = False 83 | chip = None 84 | 85 | def __init__(self, i2c, address=_FT6206_DEFAULT_I2C_ADDR, debug=False): 86 | self.bus = i2c 87 | self.address = address 88 | self._debug = debug 89 | 90 | chip_data = self._read(_FT6XXX_REG_LIBH, 8) 91 | lib_ver, chip_id, _, _, firm_id, _, vend_id = struct.unpack( 92 | ">HBBBBBB", chip_data 93 | ) 94 | 95 | if debug: 96 | print("Vendor ID %02x" % vend_id) 97 | 98 | self.vend_id=vend_id 99 | if chip_id == 0x06: 100 | self.chip = "FT6206" 101 | elif chip_id == 0x64: 102 | self.chip = "FT6236" 103 | elif debug: 104 | print("Chip Id: %02x" % chip_id) 105 | 106 | if debug: 107 | print("Library vers %04X" % lib_ver) 108 | print("Firmware ID %02X" % firm_id) 109 | print("Point rate %d Hz" % self._read(_FT6XXX_REG_POINTRATE, 1)[0]) 110 | print("Thresh %d" % self._read(_FT6XXX_REG_THRESHHOLD, 1)[0]) 111 | 112 | 113 | @property 114 | def touched(self): 115 | """ Returns the number of touches currently detected """ 116 | return self._read(_FT6XXX_REG_NUMTOUCHES, 1)[0] 117 | 118 | # pylint: disable=unused-variable 119 | @property 120 | def touches(self): 121 | """ 122 | Returns a list of touchpoint dicts, with 'x' and 'y' containing the 123 | touch coordinates, and 'id' as the touch # for multitouch tracking 124 | """ 125 | touchpoints = [] 126 | data = self._read(_FT6XXX_REG_DATA, 32) 127 | 128 | for i in range(2): 129 | point_data = data[i * 6 + 3 : i * 6 + 9] 130 | if all([i == 0xFF for i in point_data]): 131 | continue 132 | # print([hex(i) for i in point_data]) 133 | x, y, weight, misc = struct.unpack(">HHBB", point_data) 134 | # print(x, y, weight, misc) 135 | touch_id = y >> 12 136 | x &= 0xFFF 137 | y &= 0xFFF 138 | point = {"x": x, "y": y, "id": touch_id} 139 | touchpoints.append(point) 140 | return touchpoints 141 | 142 | def _read(self, reg, length): 143 | """Returns an array of 'length' bytes from the 'register'""" 144 | result = bytearray(length) 145 | self.bus.readfrom_mem_into(self.address, reg, result) 146 | if self._debug: 147 | print("\t$%02X => %s" % (reg, [hex(i) for i in result])) 148 | return result 149 | 150 | def _write(self, reg, values): 151 | """Writes an array of 'length' bytes to the 'register'""" 152 | values = [(v & 0xFF) for v in values] 153 | self.bus.writeto_mem(self.address,reg,bytes(values)) 154 | if self._debug: 155 | print("\t$%02X <= %s" % (reg, [hex(i) for i in values])) 156 | -------------------------------------------------------------------------------- /modules/marker.py: -------------------------------------------------------------------------------- 1 | WIDTH = 26 2 | HEIGHT = 26 3 | FIRST = 0x20 4 | LAST = 0x7f 5 | 6 | _font =\ 7 | b'\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a'\ 8 | b'\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a'\ 9 | b'\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a'\ 10 | b'\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a'\ 11 | b'\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a'\ 12 | b'\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a'\ 13 | b'\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x11\x4b\x59\x51\x4b\x4e'\ 14 | b'\x4c\x4c\x4e\x4b\x51\x4b\x53\x4c\x56\x4e\x58\x51\x59\x53\x59'\ 15 | b'\x56\x58\x58\x56\x59\x53\x59\x51\x58\x4e\x56\x4c\x53\x4b\x51'\ 16 | b'\x4b\x05\x4c\x58\x4c\x4c\x4c\x58\x58\x58\x58\x4c\x4c\x4c\x04'\ 17 | b'\x4b\x59\x52\x4a\x4b\x56\x59\x56\x52\x4a\x05\x4c\x58\x52\x48'\ 18 | b'\x4c\x52\x52\x5c\x58\x52\x52\x48\x0b\x4a\x5a\x52\x49\x50\x4f'\ 19 | b'\x4a\x4f\x4f\x53\x4d\x59\x52\x55\x57\x59\x55\x53\x5a\x4f\x54'\ 20 | b'\x4f\x52\x49\x0d\x4c\x58\x50\x4c\x50\x50\x4c\x50\x4c\x54\x50'\ 21 | b'\x54\x50\x58\x54\x58\x54\x54\x58\x54\x58\x50\x54\x50\x54\x4c'\ 22 | b'\x50\x4c\x05\x4b\x59\x52\x4b\x52\x59\x20\x52\x4b\x52\x59\x52'\ 23 | b'\x05\x4d\x57\x4d\x4d\x57\x57\x20\x52\x57\x4d\x4d\x57\x08\x4d'\ 24 | b'\x57\x52\x4c\x52\x58\x20\x52\x4d\x4f\x57\x55\x20\x52\x57\x4f'\ 25 | b'\x4d\x55\x22\x4e\x56\x51\x4e\x4f\x4f\x4e\x51\x4e\x53\x4f\x55'\ 26 | b'\x51\x56\x53\x56\x55\x55\x56\x53\x56\x51\x55\x4f\x53\x4e\x51'\ 27 | b'\x4e\x20\x52\x4f\x51\x4f\x53\x20\x52\x50\x50\x50\x54\x20\x52'\ 28 | b'\x51\x4f\x51\x55\x20\x52\x52\x4f\x52\x55\x20\x52\x53\x4f\x53'\ 29 | b'\x55\x20\x52\x54\x50\x54\x54\x20\x52\x55\x51\x55\x53\x1a\x4e'\ 30 | b'\x56\x4e\x4e\x4e\x56\x56\x56\x56\x4e\x4e\x4e\x20\x52\x4f\x4f'\ 31 | b'\x4f\x55\x20\x52\x50\x4f\x50\x55\x20\x52\x51\x4f\x51\x55\x20'\ 32 | b'\x52\x52\x4f\x52\x55\x20\x52\x53\x4f\x53\x55\x20\x52\x54\x4f'\ 33 | b'\x54\x55\x20\x52\x55\x4f\x55\x55\x10\x4d\x57\x52\x4c\x4d\x55'\ 34 | b'\x57\x55\x52\x4c\x20\x52\x52\x4f\x4f\x54\x20\x52\x52\x4f\x55'\ 35 | b'\x54\x20\x52\x52\x52\x51\x54\x20\x52\x52\x52\x53\x54\x10\x4c'\ 36 | b'\x55\x4c\x52\x55\x57\x55\x4d\x4c\x52\x20\x52\x4f\x52\x54\x55'\ 37 | b'\x20\x52\x4f\x52\x54\x4f\x20\x52\x52\x52\x54\x53\x20\x52\x52'\ 38 | b'\x52\x54\x51\x10\x4d\x57\x52\x58\x57\x4f\x4d\x4f\x52\x58\x20'\ 39 | b'\x52\x52\x55\x55\x50\x20\x52\x52\x55\x4f\x50\x20\x52\x52\x52'\ 40 | b'\x53\x50\x20\x52\x52\x52\x51\x50\x10\x4f\x58\x58\x52\x4f\x4d'\ 41 | b'\x4f\x57\x58\x52\x20\x52\x55\x52\x50\x4f\x20\x52\x55\x52\x50'\ 42 | b'\x55\x20\x52\x52\x52\x50\x51\x20\x52\x52\x52\x50\x53\x08\x44'\ 43 | b'\x60\x44\x52\x60\x52\x20\x52\x44\x52\x52\x62\x20\x52\x60\x52'\ 44 | b'\x52\x62\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00'\ 45 | b'\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00'\ 46 | b'\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00'\ 47 | b'\x4a\x5a\x00\x4a\x5a\x11\x4b\x59\x51\x4b\x4e\x4c\x4c\x4e\x4b'\ 48 | b'\x51\x4b\x53\x4c\x56\x4e\x58\x51\x59\x53\x59\x56\x58\x58\x56'\ 49 | b'\x59\x53\x59\x51\x58\x4e\x56\x4c\x53\x4b\x51\x4b\x05\x4c\x58'\ 50 | b'\x4c\x4c\x4c\x58\x58\x58\x58\x4c\x4c\x4c\x04\x4b\x59\x52\x4a'\ 51 | b'\x4b\x56\x59\x56\x52\x4a\x05\x4c\x58\x52\x48\x4c\x52\x52\x5c'\ 52 | b'\x58\x52\x52\x48\x0b\x4a\x5a\x52\x49\x50\x4f\x4a\x4f\x4f\x53'\ 53 | b'\x4d\x59\x52\x55\x57\x59\x55\x53\x5a\x4f\x54\x4f\x52\x49\x0d'\ 54 | b'\x4c\x58\x50\x4c\x50\x50\x4c\x50\x4c\x54\x50\x54\x50\x58\x54'\ 55 | b'\x58\x54\x54\x58\x54\x58\x50\x54\x50\x54\x4c\x50\x4c\x05\x4b'\ 56 | b'\x59\x52\x4b\x52\x59\x20\x52\x4b\x52\x59\x52\x05\x4d\x57\x4d'\ 57 | b'\x4d\x57\x57\x20\x52\x57\x4d\x4d\x57\x08\x4d\x57\x52\x4c\x52'\ 58 | b'\x58\x20\x52\x4d\x4f\x57\x55\x20\x52\x57\x4f\x4d\x55\x22\x4e'\ 59 | b'\x56\x51\x4e\x4f\x4f\x4e\x51\x4e\x53\x4f\x55\x51\x56\x53\x56'\ 60 | b'\x55\x55\x56\x53\x56\x51\x55\x4f\x53\x4e\x51\x4e\x20\x52\x4f'\ 61 | b'\x51\x4f\x53\x20\x52\x50\x50\x50\x54\x20\x52\x51\x4f\x51\x55'\ 62 | b'\x20\x52\x52\x4f\x52\x55\x20\x52\x53\x4f\x53\x55\x20\x52\x54'\ 63 | b'\x50\x54\x54\x20\x52\x55\x51\x55\x53\x1a\x4e\x56\x4e\x4e\x4e'\ 64 | b'\x56\x56\x56\x56\x4e\x4e\x4e\x20\x52\x4f\x4f\x4f\x55\x20\x52'\ 65 | b'\x50\x4f\x50\x55\x20\x52\x51\x4f\x51\x55\x20\x52\x52\x4f\x52'\ 66 | b'\x55\x20\x52\x53\x4f\x53\x55\x20\x52\x54\x4f\x54\x55\x20\x52'\ 67 | b'\x55\x4f\x55\x55\x10\x4d\x57\x52\x4c\x4d\x55\x57\x55\x52\x4c'\ 68 | b'\x20\x52\x52\x4f\x4f\x54\x20\x52\x52\x4f\x55\x54\x20\x52\x52'\ 69 | b'\x52\x51\x54\x20\x52\x52\x52\x53\x54\x10\x4c\x55\x4c\x52\x55'\ 70 | b'\x57\x55\x4d\x4c\x52\x20\x52\x4f\x52\x54\x55\x20\x52\x4f\x52'\ 71 | b'\x54\x4f\x20\x52\x52\x52\x54\x53\x20\x52\x52\x52\x54\x51\x10'\ 72 | b'\x4d\x57\x52\x58\x57\x4f\x4d\x4f\x52\x58\x20\x52\x52\x55\x55'\ 73 | b'\x50\x20\x52\x52\x55\x4f\x50\x20\x52\x52\x52\x53\x50\x20\x52'\ 74 | b'\x52\x52\x51\x50\x10\x4f\x58\x58\x52\x4f\x4d\x4f\x57\x58\x52'\ 75 | b'\x20\x52\x55\x52\x50\x4f\x20\x52\x55\x52\x50\x55\x20\x52\x52'\ 76 | b'\x52\x50\x51\x20\x52\x52\x52\x50\x53\x08\x44\x60\x44\x52\x60'\ 77 | b'\x52\x20\x52\x44\x52\x52\x62\x20\x52\x60\x52\x52\x62\x00\x4a'\ 78 | b'\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a'\ 79 | b'\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a'\ 80 | b'\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a\x5a\x00\x4a'\ 81 | b'\x5a' 82 | 83 | _index =\ 84 | b'\x00\x00\x03\x00\x06\x00\x09\x00\x0c\x00\x0f\x00\x12\x00\x15'\ 85 | b'\x00\x18\x00\x1b\x00\x1e\x00\x21\x00\x24\x00\x27\x00\x2a\x00'\ 86 | b'\x2d\x00\x30\x00\x33\x00\x36\x00\x39\x00\x3c\x00\x3f\x00\x42'\ 87 | b'\x00\x45\x00\x48\x00\x4b\x00\x4e\x00\x51\x00\x54\x00\x57\x00'\ 88 | b'\x5a\x00\x5d\x00\x60\x00\x63\x00\x88\x00\x95\x00\xa0\x00\xad'\ 89 | b'\x00\xc6\x00\xe3\x00\xf0\x00\xfd\x00\x10\x01\x57\x01\x8e\x01'\ 90 | b'\xb1\x01\xd4\x01\xf7\x01\x1a\x02\x2d\x02\x30\x02\x33\x02\x36'\ 91 | b'\x02\x39\x02\x3c\x02\x3f\x02\x42\x02\x45\x02\x48\x02\x4b\x02'\ 92 | b'\x4e\x02\x51\x02\x54\x02\x57\x02\x5a\x02\x5d\x02\x82\x02\x8f'\ 93 | b'\x02\x9a\x02\xa7\x02\xc0\x02\xdd\x02\xea\x02\xf7\x02\x0a\x03'\ 94 | b'\x51\x03\x88\x03\xab\x03\xce\x03\xf1\x03\x14\x04\x27\x04\x2a'\ 95 | b'\x04\x2d\x04\x30\x04\x33\x04\x36\x04\x39\x04\x3c\x04\x3f\x04'\ 96 | b'\x42\x04\x45\x04\x48\x04\x4b\x04\x4e\x04\x51\x04\x54\x04' 97 | 98 | INDEX = memoryview(_index) 99 | FONT = memoryview(_font) 100 | -------------------------------------------------------------------------------- /modules/mf.py: -------------------------------------------------------------------------------- 1 | import gc 2 | 3 | print("Allocating 1K bytes until memory is full... ", end='') 4 | memory = [] 5 | i = 0 6 | gc.collect() 7 | 8 | try: 9 | while True: 10 | memory.append(bytearray(1024)) 11 | i += 1 12 | 13 | except MemoryError: 14 | gc.collect() 15 | print(f'{i}K bytes Allocated.') 16 | -------------------------------------------------------------------------------- /modules/vga1_8x16.py: -------------------------------------------------------------------------------- 1 | """converted from vga_8x16.bin """ 2 | WIDTH = 8 3 | HEIGHT = 16 4 | FIRST = 0x20 5 | LAST = 0x7f 6 | _FONT =\ 7 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 8 | b'\x00\x00\x18\x3c\x3c\x3c\x18\x18\x18\x00\x18\x18\x00\x00\x00\x00'\ 9 | b'\x00\x66\x66\x66\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 10 | b'\x00\x00\x00\x6c\x6c\xfe\x6c\x6c\x6c\xfe\x6c\x6c\x00\x00\x00\x00'\ 11 | b'\x18\x18\x7c\xc6\xc2\xc0\x7c\x06\x06\x86\xc6\x7c\x18\x18\x00\x00'\ 12 | b'\x00\x00\x00\x00\xc2\xc6\x0c\x18\x30\x60\xc6\x86\x00\x00\x00\x00'\ 13 | b'\x00\x00\x38\x6c\x6c\x38\x76\xdc\xcc\xcc\xcc\x76\x00\x00\x00\x00'\ 14 | b'\x00\x30\x30\x30\x60\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 15 | b'\x00\x00\x0c\x18\x30\x30\x30\x30\x30\x30\x18\x0c\x00\x00\x00\x00'\ 16 | b'\x00\x00\x30\x18\x0c\x0c\x0c\x0c\x0c\x0c\x18\x30\x00\x00\x00\x00'\ 17 | b'\x00\x00\x00\x00\x00\x66\x3c\xff\x3c\x66\x00\x00\x00\x00\x00\x00'\ 18 | b'\x00\x00\x00\x00\x00\x18\x18\x7e\x18\x18\x00\x00\x00\x00\x00\x00'\ 19 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x18\x18\x30\x00\x00\x00'\ 20 | b'\x00\x00\x00\x00\x00\x00\x00\xfe\x00\x00\x00\x00\x00\x00\x00\x00'\ 21 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x18\x00\x00\x00\x00'\ 22 | b'\x00\x00\x00\x00\x02\x06\x0c\x18\x30\x60\xc0\x80\x00\x00\x00\x00'\ 23 | b'\x00\x00\x38\x6c\xc6\xc6\xd6\xd6\xc6\xc6\x6c\x38\x00\x00\x00\x00'\ 24 | b'\x00\x00\x18\x38\x78\x18\x18\x18\x18\x18\x18\x7e\x00\x00\x00\x00'\ 25 | b'\x00\x00\x7c\xc6\x06\x0c\x18\x30\x60\xc0\xc6\xfe\x00\x00\x00\x00'\ 26 | b'\x00\x00\x7c\xc6\x06\x06\x3c\x06\x06\x06\xc6\x7c\x00\x00\x00\x00'\ 27 | b'\x00\x00\x0c\x1c\x3c\x6c\xcc\xfe\x0c\x0c\x0c\x1e\x00\x00\x00\x00'\ 28 | b'\x00\x00\xfe\xc0\xc0\xc0\xfc\x06\x06\x06\xc6\x7c\x00\x00\x00\x00'\ 29 | b'\x00\x00\x38\x60\xc0\xc0\xfc\xc6\xc6\xc6\xc6\x7c\x00\x00\x00\x00'\ 30 | b'\x00\x00\xfe\xc6\x06\x06\x0c\x18\x30\x30\x30\x30\x00\x00\x00\x00'\ 31 | b'\x00\x00\x7c\xc6\xc6\xc6\x7c\xc6\xc6\xc6\xc6\x7c\x00\x00\x00\x00'\ 32 | b'\x00\x00\x7c\xc6\xc6\xc6\x7e\x06\x06\x06\x0c\x78\x00\x00\x00\x00'\ 33 | b'\x00\x00\x00\x00\x18\x18\x00\x00\x00\x18\x18\x00\x00\x00\x00\x00'\ 34 | b'\x00\x00\x00\x00\x18\x18\x00\x00\x00\x18\x18\x30\x00\x00\x00\x00'\ 35 | b'\x00\x00\x00\x06\x0c\x18\x30\x60\x30\x18\x0c\x06\x00\x00\x00\x00'\ 36 | b'\x00\x00\x00\x00\x00\x7e\x00\x00\x7e\x00\x00\x00\x00\x00\x00\x00'\ 37 | b'\x00\x00\x00\x60\x30\x18\x0c\x06\x0c\x18\x30\x60\x00\x00\x00\x00'\ 38 | b'\x00\x00\x7c\xc6\xc6\x0c\x18\x18\x18\x00\x18\x18\x00\x00\x00\x00'\ 39 | b'\x00\x00\x00\x7c\xc6\xc6\xde\xde\xde\xdc\xc0\x7c\x00\x00\x00\x00'\ 40 | b'\x00\x00\x10\x38\x6c\xc6\xc6\xfe\xc6\xc6\xc6\xc6\x00\x00\x00\x00'\ 41 | b'\x00\x00\xfc\x66\x66\x66\x7c\x66\x66\x66\x66\xfc\x00\x00\x00\x00'\ 42 | b'\x00\x00\x3c\x66\xc2\xc0\xc0\xc0\xc0\xc2\x66\x3c\x00\x00\x00\x00'\ 43 | b'\x00\x00\xf8\x6c\x66\x66\x66\x66\x66\x66\x6c\xf8\x00\x00\x00\x00'\ 44 | b'\x00\x00\xfe\x66\x62\x68\x78\x68\x60\x62\x66\xfe\x00\x00\x00\x00'\ 45 | b'\x00\x00\xfe\x66\x62\x68\x78\x68\x60\x60\x60\xf0\x00\x00\x00\x00'\ 46 | b'\x00\x00\x3c\x66\xc2\xc0\xc0\xde\xc6\xc6\x66\x3a\x00\x00\x00\x00'\ 47 | b'\x00\x00\xc6\xc6\xc6\xc6\xfe\xc6\xc6\xc6\xc6\xc6\x00\x00\x00\x00'\ 48 | b'\x00\x00\x3c\x18\x18\x18\x18\x18\x18\x18\x18\x3c\x00\x00\x00\x00'\ 49 | b'\x00\x00\x1e\x0c\x0c\x0c\x0c\x0c\xcc\xcc\xcc\x78\x00\x00\x00\x00'\ 50 | b'\x00\x00\xe6\x66\x66\x6c\x78\x78\x6c\x66\x66\xe6\x00\x00\x00\x00'\ 51 | b'\x00\x00\xf0\x60\x60\x60\x60\x60\x60\x62\x66\xfe\x00\x00\x00\x00'\ 52 | b'\x00\x00\xc6\xee\xfe\xfe\xd6\xc6\xc6\xc6\xc6\xc6\x00\x00\x00\x00'\ 53 | b'\x00\x00\xc6\xe6\xf6\xfe\xde\xce\xc6\xc6\xc6\xc6\x00\x00\x00\x00'\ 54 | b'\x00\x00\x7c\xc6\xc6\xc6\xc6\xc6\xc6\xc6\xc6\x7c\x00\x00\x00\x00'\ 55 | b'\x00\x00\xfc\x66\x66\x66\x7c\x60\x60\x60\x60\xf0\x00\x00\x00\x00'\ 56 | b'\x00\x00\x7c\xc6\xc6\xc6\xc6\xc6\xc6\xd6\xde\x7c\x0c\x0e\x00\x00'\ 57 | b'\x00\x00\xfc\x66\x66\x66\x7c\x6c\x66\x66\x66\xe6\x00\x00\x00\x00'\ 58 | b'\x00\x00\x7c\xc6\xc6\x60\x38\x0c\x06\xc6\xc6\x7c\x00\x00\x00\x00'\ 59 | b'\x00\x00\x7e\x7e\x5a\x18\x18\x18\x18\x18\x18\x3c\x00\x00\x00\x00'\ 60 | b'\x00\x00\xc6\xc6\xc6\xc6\xc6\xc6\xc6\xc6\xc6\x7c\x00\x00\x00\x00'\ 61 | b'\x00\x00\xc6\xc6\xc6\xc6\xc6\xc6\xc6\x6c\x38\x10\x00\x00\x00\x00'\ 62 | b'\x00\x00\xc6\xc6\xc6\xc6\xd6\xd6\xd6\xfe\xee\x6c\x00\x00\x00\x00'\ 63 | b'\x00\x00\xc6\xc6\x6c\x7c\x38\x38\x7c\x6c\xc6\xc6\x00\x00\x00\x00'\ 64 | b'\x00\x00\x66\x66\x66\x66\x3c\x18\x18\x18\x18\x3c\x00\x00\x00\x00'\ 65 | b'\x00\x00\xfe\xc6\x86\x0c\x18\x30\x60\xc2\xc6\xfe\x00\x00\x00\x00'\ 66 | b'\x00\x00\x3c\x30\x30\x30\x30\x30\x30\x30\x30\x3c\x00\x00\x00\x00'\ 67 | b'\x00\x00\x00\x80\xc0\xe0\x70\x38\x1c\x0e\x06\x02\x00\x00\x00\x00'\ 68 | b'\x00\x00\x3c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x3c\x00\x00\x00\x00'\ 69 | b'\x10\x38\x6c\xc6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 70 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\x00'\ 71 | b'\x00\x30\x18\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 72 | b'\x00\x00\x00\x00\x00\x78\x0c\x7c\xcc\xcc\xcc\x76\x00\x00\x00\x00'\ 73 | b'\x00\x00\xe0\x60\x60\x78\x6c\x66\x66\x66\x66\x7c\x00\x00\x00\x00'\ 74 | b'\x00\x00\x00\x00\x00\x7c\xc6\xc0\xc0\xc0\xc6\x7c\x00\x00\x00\x00'\ 75 | b'\x00\x00\x1c\x0c\x0c\x3c\x6c\xcc\xcc\xcc\xcc\x76\x00\x00\x00\x00'\ 76 | b'\x00\x00\x00\x00\x00\x7c\xc6\xfe\xc0\xc0\xc6\x7c\x00\x00\x00\x00'\ 77 | b'\x00\x00\x1c\x36\x32\x30\x78\x30\x30\x30\x30\x78\x00\x00\x00\x00'\ 78 | b'\x00\x00\x00\x00\x00\x76\xcc\xcc\xcc\xcc\xcc\x7c\x0c\xcc\x78\x00'\ 79 | b'\x00\x00\xe0\x60\x60\x6c\x76\x66\x66\x66\x66\xe6\x00\x00\x00\x00'\ 80 | b'\x00\x00\x18\x18\x00\x38\x18\x18\x18\x18\x18\x3c\x00\x00\x00\x00'\ 81 | b'\x00\x00\x06\x06\x00\x0e\x06\x06\x06\x06\x06\x06\x66\x66\x3c\x00'\ 82 | b'\x00\x00\xe0\x60\x60\x66\x6c\x78\x78\x6c\x66\xe6\x00\x00\x00\x00'\ 83 | b'\x00\x00\x38\x18\x18\x18\x18\x18\x18\x18\x18\x3c\x00\x00\x00\x00'\ 84 | b'\x00\x00\x00\x00\x00\xec\xfe\xd6\xd6\xd6\xd6\xc6\x00\x00\x00\x00'\ 85 | b'\x00\x00\x00\x00\x00\xdc\x66\x66\x66\x66\x66\x66\x00\x00\x00\x00'\ 86 | b'\x00\x00\x00\x00\x00\x7c\xc6\xc6\xc6\xc6\xc6\x7c\x00\x00\x00\x00'\ 87 | b'\x00\x00\x00\x00\x00\xdc\x66\x66\x66\x66\x66\x7c\x60\x60\xf0\x00'\ 88 | b'\x00\x00\x00\x00\x00\x76\xcc\xcc\xcc\xcc\xcc\x7c\x0c\x0c\x1e\x00'\ 89 | b'\x00\x00\x00\x00\x00\xdc\x76\x66\x60\x60\x60\xf0\x00\x00\x00\x00'\ 90 | b'\x00\x00\x00\x00\x00\x7c\xc6\x60\x38\x0c\xc6\x7c\x00\x00\x00\x00'\ 91 | b'\x00\x00\x10\x30\x30\xfc\x30\x30\x30\x30\x36\x1c\x00\x00\x00\x00'\ 92 | b'\x00\x00\x00\x00\x00\xcc\xcc\xcc\xcc\xcc\xcc\x76\x00\x00\x00\x00'\ 93 | b'\x00\x00\x00\x00\x00\xc6\xc6\xc6\xc6\xc6\x6c\x38\x00\x00\x00\x00'\ 94 | b'\x00\x00\x00\x00\x00\xc6\xc6\xd6\xd6\xd6\xfe\x6c\x00\x00\x00\x00'\ 95 | b'\x00\x00\x00\x00\x00\xc6\x6c\x38\x38\x38\x6c\xc6\x00\x00\x00\x00'\ 96 | b'\x00\x00\x00\x00\x00\xc6\xc6\xc6\xc6\xc6\xc6\x7e\x06\x0c\xf8\x00'\ 97 | b'\x00\x00\x00\x00\x00\xfe\xcc\x18\x30\x60\xc6\xfe\x00\x00\x00\x00'\ 98 | b'\x00\x00\x0e\x18\x18\x18\x70\x18\x18\x18\x18\x0e\x00\x00\x00\x00'\ 99 | b'\x00\x00\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x00\x00\x00\x00'\ 100 | b'\x00\x00\x70\x18\x18\x18\x0e\x18\x18\x18\x18\x70\x00\x00\x00\x00'\ 101 | b'\x00\x76\xdc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ 102 | b'\x00\x00\x00\x00\x10\x38\x6c\xc6\xc6\xc6\xfe\x00\x00\x00\x00\x00'\ 103 | 104 | FONT = memoryview(_FONT) 105 | -------------------------------------------------------------------------------- /modules/vga1_8x8.py: -------------------------------------------------------------------------------- 1 | """converted from vga_8x8.bin """ 2 | WIDTH = 8 3 | HEIGHT = 8 4 | FIRST = 0x20 5 | LAST = 0x7f 6 | _FONT =\ 7 | b'\x00\x00\x00\x00\x00\x00\x00\x00'\ 8 | b'\x18\x3c\x3c\x18\x18\x00\x18\x00'\ 9 | b'\x66\x66\x24\x00\x00\x00\x00\x00'\ 10 | b'\x6c\x6c\xfe\x6c\xfe\x6c\x6c\x00'\ 11 | b'\x18\x3e\x60\x3c\x06\x7c\x18\x00'\ 12 | b'\x00\xc6\xcc\x18\x30\x66\xc6\x00'\ 13 | b'\x38\x6c\x38\x76\xdc\xcc\x76\x00'\ 14 | b'\x18\x18\x30\x00\x00\x00\x00\x00'\ 15 | b'\x0c\x18\x30\x30\x30\x18\x0c\x00'\ 16 | b'\x30\x18\x0c\x0c\x0c\x18\x30\x00'\ 17 | b'\x00\x66\x3c\xff\x3c\x66\x00\x00'\ 18 | b'\x00\x18\x18\x7e\x18\x18\x00\x00'\ 19 | b'\x00\x00\x00\x00\x00\x18\x18\x30'\ 20 | b'\x00\x00\x00\x7e\x00\x00\x00\x00'\ 21 | b'\x00\x00\x00\x00\x00\x18\x18\x00'\ 22 | b'\x06\x0c\x18\x30\x60\xc0\x80\x00'\ 23 | b'\x38\x6c\xc6\xd6\xc6\x6c\x38\x00'\ 24 | b'\x18\x38\x18\x18\x18\x18\x7e\x00'\ 25 | b'\x7c\xc6\x06\x1c\x30\x66\xfe\x00'\ 26 | b'\x7c\xc6\x06\x3c\x06\xc6\x7c\x00'\ 27 | b'\x1c\x3c\x6c\xcc\xfe\x0c\x1e\x00'\ 28 | b'\xfe\xc0\xc0\xfc\x06\xc6\x7c\x00'\ 29 | b'\x38\x60\xc0\xfc\xc6\xc6\x7c\x00'\ 30 | b'\xfe\xc6\x0c\x18\x30\x30\x30\x00'\ 31 | b'\x7c\xc6\xc6\x7c\xc6\xc6\x7c\x00'\ 32 | b'\x7c\xc6\xc6\x7e\x06\x0c\x78\x00'\ 33 | b'\x00\x18\x18\x00\x00\x18\x18\x00'\ 34 | b'\x00\x18\x18\x00\x00\x18\x18\x30'\ 35 | b'\x06\x0c\x18\x30\x18\x0c\x06\x00'\ 36 | b'\x00\x00\x7e\x00\x00\x7e\x00\x00'\ 37 | b'\x60\x30\x18\x0c\x18\x30\x60\x00'\ 38 | b'\x7c\xc6\x0c\x18\x18\x00\x18\x00'\ 39 | b'\x7c\xc6\xde\xde\xde\xc0\x78\x00'\ 40 | b'\x38\x6c\xc6\xfe\xc6\xc6\xc6\x00'\ 41 | b'\xfc\x66\x66\x7c\x66\x66\xfc\x00'\ 42 | b'\x3c\x66\xc0\xc0\xc0\x66\x3c\x00'\ 43 | b'\xf8\x6c\x66\x66\x66\x6c\xf8\x00'\ 44 | b'\xfe\x62\x68\x78\x68\x62\xfe\x00'\ 45 | b'\xfe\x62\x68\x78\x68\x60\xf0\x00'\ 46 | b'\x3c\x66\xc0\xc0\xce\x66\x3a\x00'\ 47 | b'\xc6\xc6\xc6\xfe\xc6\xc6\xc6\x00'\ 48 | b'\x3c\x18\x18\x18\x18\x18\x3c\x00'\ 49 | b'\x1e\x0c\x0c\x0c\xcc\xcc\x78\x00'\ 50 | b'\xe6\x66\x6c\x78\x6c\x66\xe6\x00'\ 51 | b'\xf0\x60\x60\x60\x62\x66\xfe\x00'\ 52 | b'\xc6\xee\xfe\xfe\xd6\xc6\xc6\x00'\ 53 | b'\xc6\xe6\xf6\xde\xce\xc6\xc6\x00'\ 54 | b'\x7c\xc6\xc6\xc6\xc6\xc6\x7c\x00'\ 55 | b'\xfc\x66\x66\x7c\x60\x60\xf0\x00'\ 56 | b'\x7c\xc6\xc6\xc6\xc6\xce\x7c\x0e'\ 57 | b'\xfc\x66\x66\x7c\x6c\x66\xe6\x00'\ 58 | b'\x3c\x66\x30\x18\x0c\x66\x3c\x00'\ 59 | b'\x7e\x7e\x5a\x18\x18\x18\x3c\x00'\ 60 | b'\xc6\xc6\xc6\xc6\xc6\xc6\x7c\x00'\ 61 | b'\xc6\xc6\xc6\xc6\xc6\x6c\x38\x00'\ 62 | b'\xc6\xc6\xc6\xd6\xd6\xfe\x6c\x00'\ 63 | b'\xc6\xc6\x6c\x38\x6c\xc6\xc6\x00'\ 64 | b'\x66\x66\x66\x3c\x18\x18\x3c\x00'\ 65 | b'\xfe\xc6\x8c\x18\x32\x66\xfe\x00'\ 66 | b'\x3c\x30\x30\x30\x30\x30\x3c\x00'\ 67 | b'\xc0\x60\x30\x18\x0c\x06\x02\x00'\ 68 | b'\x3c\x0c\x0c\x0c\x0c\x0c\x3c\x00'\ 69 | b'\x10\x38\x6c\xc6\x00\x00\x00\x00'\ 70 | b'\x00\x00\x00\x00\x00\x00\x00\xff'\ 71 | b'\x30\x18\x0c\x00\x00\x00\x00\x00'\ 72 | b'\x00\x00\x78\x0c\x7c\xcc\x76\x00'\ 73 | b'\xe0\x60\x7c\x66\x66\x66\xdc\x00'\ 74 | b'\x00\x00\x7c\xc6\xc0\xc6\x7c\x00'\ 75 | b'\x1c\x0c\x7c\xcc\xcc\xcc\x76\x00'\ 76 | b'\x00\x00\x7c\xc6\xfe\xc0\x7c\x00'\ 77 | b'\x3c\x66\x60\xf8\x60\x60\xf0\x00'\ 78 | b'\x00\x00\x76\xcc\xcc\x7c\x0c\xf8'\ 79 | b'\xe0\x60\x6c\x76\x66\x66\xe6\x00'\ 80 | b'\x18\x00\x38\x18\x18\x18\x3c\x00'\ 81 | b'\x06\x00\x06\x06\x06\x66\x66\x3c'\ 82 | b'\xe0\x60\x66\x6c\x78\x6c\xe6\x00'\ 83 | b'\x38\x18\x18\x18\x18\x18\x3c\x00'\ 84 | b'\x00\x00\xec\xfe\xd6\xd6\xd6\x00'\ 85 | b'\x00\x00\xdc\x66\x66\x66\x66\x00'\ 86 | b'\x00\x00\x7c\xc6\xc6\xc6\x7c\x00'\ 87 | b'\x00\x00\xdc\x66\x66\x7c\x60\xf0'\ 88 | b'\x00\x00\x76\xcc\xcc\x7c\x0c\x1e'\ 89 | b'\x00\x00\xdc\x76\x60\x60\xf0\x00'\ 90 | b'\x00\x00\x7e\xc0\x7c\x06\xfc\x00'\ 91 | b'\x30\x30\xfc\x30\x30\x36\x1c\x00'\ 92 | b'\x00\x00\xcc\xcc\xcc\xcc\x76\x00'\ 93 | b'\x00\x00\xc6\xc6\xc6\x6c\x38\x00'\ 94 | b'\x00\x00\xc6\xd6\xd6\xfe\x6c\x00'\ 95 | b'\x00\x00\xc6\x6c\x38\x6c\xc6\x00'\ 96 | b'\x00\x00\xc6\xc6\xc6\x7e\x06\xfc'\ 97 | b'\x00\x00\x7e\x4c\x18\x32\x7e\x00'\ 98 | b'\x0e\x18\x18\x70\x18\x18\x0e\x00'\ 99 | b'\x18\x18\x18\x18\x18\x18\x18\x00'\ 100 | b'\x70\x18\x18\x0e\x18\x18\x70\x00'\ 101 | b'\x76\xdc\x00\x00\x00\x00\x00\x00'\ 102 | b'\x00\x10\x38\x6c\xc6\xc6\xfe\x00'\ 103 | 104 | FONT = memoryview(_FONT) 105 | -------------------------------------------------------------------------------- /src/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | # BasedOnStyle: LLVM 3 | AccessModifierOffset: -2 4 | ConstructorInitializerIndentWidth: 4 5 | AlignEscapedNewlinesLeft: false 6 | AlignTrailingComments: true 7 | AllowAllParametersOfDeclarationOnNextLine: true 8 | AllowShortIfStatementsOnASingleLine: false 9 | AllowShortLoopsOnASingleLine: false 10 | AlwaysBreakTemplateDeclarations: false 11 | AlwaysBreakBeforeMultilineStrings: false 12 | BreakBeforeBinaryOperators: false 13 | BreakBeforeTernaryOperators: true 14 | BreakConstructorInitializersBeforeComma: false 15 | BinPackParameters: true 16 | ColumnLimit: 0 17 | ConstructorInitializerAllOnOneLineOrOnePerLine: false 18 | DerivePointerBinding: false 19 | ExperimentalAutoDetectBinPacking: false 20 | IndentCaseLabels: true 21 | MaxEmptyLinesToKeep: 1 22 | NamespaceIndentation: None 23 | ObjCSpaceBeforeProtocolList: true 24 | PenaltyBreakBeforeFirstCallParameter: 19 25 | PenaltyBreakComment: 60 26 | PenaltyBreakString: 1000 27 | PenaltyBreakFirstLessLess: 120 28 | PenaltyExcessCharacter: 1000000 29 | PenaltyReturnTypeOnItsOwnLine: 60 30 | PointerBindsToType: false 31 | SpacesBeforeTrailingComments: 1 32 | Cpp11BracedListStyle: true 33 | Standard: Cpp03 34 | IndentWidth: 4 35 | TabWidth: 4 36 | UseTab: Always 37 | BreakBeforeBraces: BS_WebKit 38 | IndentFunctionDeclarationAfterType: false 39 | SpacesInParentheses: false 40 | SpacesInAngles: false 41 | SpaceInEmptyParentheses: false 42 | SpacesInCStyleCastParentheses: false 43 | SpaceAfterControlStatementKeyword: true 44 | SpaceBeforeAssignmentOperators: true 45 | ContinuationIndentWidth: 4 46 | IndentWrappedFunctionNames: true 47 | KeepEmptyLinesAtTheStartOfBlocks: false 48 | SortIncludes: false 49 | SpaceAfterCStyleCast: true 50 | SpacesInSquareBrackets: false 51 | AlignConsecutiveAssignments: true 52 | AlignConsecutiveDeclarations: true 53 | ... 54 | 55 | -------------------------------------------------------------------------------- /src/ili9342c.h: -------------------------------------------------------------------------------- 1 | #ifndef __ILI9342C_H__ 2 | #define __ILI9342C_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define ILI9342C_SWRESET 0x01 9 | 10 | #define ILI9342C_CASET 0x2a 11 | #define ILI9342C_PASET 0x2b 12 | #define ILI9342C_RAMWR 0x2c 13 | #define ILI9342C_INVOFF 0x20 14 | #define ILI9342C_INVON 0x21 15 | #define ILI9342C_MADCTL 0x36 16 | #define ILI9342C_MADCTL_BGR 0x0 17 | #define ILI9342C_MADCTL_RGB 0x08 18 | #define ILI9342C_MADCTL_MX 0x40 19 | #define ILI9342C_MADCTL_MV 0x20 20 | #define ILI9342C_MADCTL_MY 0x80 21 | #define ILI9342C_VSCRDEF 0x33 22 | #define ILI9342C_VSCSAD 0x37 23 | #define ILI9342C_SLPIN 0x10 24 | #define ILI9342C_SLPOUT 0x11 25 | #define ILI9342C_COLMOD 0x3A 26 | #define ILI9342C_NORON 0x13 27 | #define ILI9342C_DISPON 0x29 28 | #define COLOR_MODE_65K 0x50 29 | #define COLOR_MODE_262K 0x60 30 | #define COLOR_MODE_12BIT 0x03 31 | #define COLOR_MODE_16BIT 0x05 32 | #define COLOR_MODE_18BIT 0x06 33 | #define COLOR_MODE_16M 0x07 34 | 35 | // Color definitions 36 | #define BLACK 0x0000 37 | #define BLUE 0x001F 38 | #define RED 0xF800 39 | #define GREEN 0x07E0 40 | #define CYAN 0x07FF 41 | #define MAGENTA 0xF81F 42 | #define YELLOW 0xFFE0 43 | #define WHITE 0xFFFF 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif /* __cplusplus */ 48 | 49 | #endif /* __ILI9342C_H__ */ 50 | -------------------------------------------------------------------------------- /src/micropython.cmake: -------------------------------------------------------------------------------- 1 | # Create an INTERFACE library for our C module. 2 | add_library(usermod_ili9342c INTERFACE) 3 | 4 | # Add our source files to the lib 5 | target_sources(usermod_ili9342c INTERFACE 6 | ${CMAKE_CURRENT_LIST_DIR}/ili9342c.c 7 | ${CMAKE_CURRENT_LIST_DIR}/mpfile.c 8 | ${CMAKE_CURRENT_LIST_DIR}/tjpgd565.c 9 | ) 10 | 11 | # Add the current directory as an include directory. 12 | target_include_directories(usermod_ili9342c INTERFACE 13 | ${CMAKE_CURRENT_LIST_DIR} 14 | ) 15 | 16 | target_compile_definitions(usermod_ili9342c INTERFACE 17 | MODULE_ILI9342C_ENABLED=1 18 | MICROPY_PY_FILE_LIKE=1 19 | EXPOSE_EXTRA_METHODS=1 20 | ) 21 | 22 | # Link our INTERFACE library to the usermod target. 23 | target_link_libraries(usermod INTERFACE usermod_ili9342c) -------------------------------------------------------------------------------- /src/micropython.mk: -------------------------------------------------------------------------------- 1 | ILI9342C_MOD_DIR := $(USERMOD_DIR) 2 | SRC_USERMOD += $(addprefix $(ILI9342C_MOD_DIR)/, ili9342c.c) 3 | SRC_USERMOD += $(addprefix $(ILI9342C_MOD_DIR)/, mpfile.c) 4 | SRC_USERMOD += $(addprefix $(ILI9342C_MOD_DIR)/, tjpgd565.c) 5 | 6 | CFLAGS_USERMOD += -I$(ILI9342C_MOD_DIR) -DMODULE_ILI9342C=1 -DMICROPY_PY_FILE_LIKE=1 -DMODULE_ILI9342C_ENABLED=1 7 | -------------------------------------------------------------------------------- /src/mpfile.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Micro Python project, http://micropython.org/ 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016 Dave Hylands 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 "py/builtin.h" 28 | #include "py/misc.h" 29 | #include "py/runtime.h" 30 | #include "mpfile.h" 31 | 32 | #include 33 | 34 | static const mp_obj_type_t mp_file_type; 35 | static mp_obj_t mp___del__(mp_obj_t self); 36 | 37 | mp_file_t *mp_file_from_file_obj(mp_obj_t file_obj) { 38 | mp_file_t *file = m_new_obj(mp_file_t); 39 | memset(file, 0, sizeof(*file)); 40 | file->base.type = &mp_file_type; 41 | file->file_obj = file_obj; 42 | file->readinto_fn = mp_const_none; 43 | file->seek_fn = mp_const_none; 44 | file->tell_fn = mp_const_none; 45 | 46 | return file; 47 | } 48 | 49 | mp_file_t *mp_open(const char *filename, const char *mode) { 50 | mp_obj_t filename_obj = mp_obj_new_str(filename, strlen(filename)); 51 | mp_obj_t mode_obj = mp_obj_new_str(mode, strlen(mode)); 52 | mp_obj_t args[2] = { filename_obj, mode_obj }; 53 | return mp_file_from_file_obj(mp_builtin_open(2, args, (mp_map_t *)&mp_const_empty_map)); 54 | } 55 | 56 | mp_int_t mp_readinto(mp_file_t *file, void *buf, size_t num_bytes) { 57 | mp_int_t nread; 58 | 59 | if (file->readinto_fn == mp_const_none) { 60 | file->readinto_fn = mp_load_attr(file->file_obj, MP_QSTR_readinto); 61 | } 62 | 63 | mp_obj_t bytearray = mp_obj_new_bytearray_by_ref(num_bytes, buf); 64 | mp_obj_t bytes_read = mp_call_function_1(file->readinto_fn, bytearray); 65 | if (bytes_read == mp_const_none) { 66 | return 0; 67 | } 68 | nread = mp_obj_get_int(bytes_read); 69 | return nread; 70 | } 71 | 72 | off_t mp_seek(mp_file_t *file, off_t offset, int whence) { 73 | if (file->seek_fn == mp_const_none) { 74 | file->seek_fn = mp_load_attr(file->file_obj, MP_QSTR_seek); 75 | } 76 | return mp_obj_get_int(mp_call_function_2(file->seek_fn, 77 | MP_OBJ_NEW_SMALL_INT(offset), 78 | MP_OBJ_NEW_SMALL_INT(whence))); 79 | } 80 | 81 | off_t mp_tell(mp_file_t *file) { 82 | if (file->tell_fn == mp_const_none) { 83 | file->tell_fn = mp_load_attr(file->file_obj, MP_QSTR_tell); 84 | } 85 | return mp_obj_get_int(mp_call_function_0(file->tell_fn)); 86 | } 87 | 88 | void mp_close(mp_file_t *file) { 89 | 90 | mp_obj_t close_fn = mp_load_attr(file->file_obj, MP_QSTR_close); 91 | file->file_obj = mp_const_none; 92 | file->readinto_fn = mp_const_none; 93 | file->seek_fn = mp_const_none; 94 | file->tell_fn = mp_const_none; 95 | mp_call_function_0(close_fn); 96 | } 97 | 98 | static void mp_file_print(const mp_print_t *print, mp_obj_t self, mp_print_kind_t kind) { 99 | (void)kind; 100 | mp_printf(print, "", self); 101 | } 102 | 103 | static mp_obj_t mp___del__(mp_obj_t self) { 104 | mp_close(MP_OBJ_TO_PTR(self)); 105 | return mp_const_none; 106 | } 107 | static MP_DEFINE_CONST_FUN_OBJ_1(mp___del___obj, mp___del__); 108 | 109 | static const mp_rom_map_elem_t mp_file_locals_dict_table[] = { 110 | { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mp___del___obj) }, 111 | }; 112 | static MP_DEFINE_CONST_DICT(mp_file_locals_dict, mp_file_locals_dict_table); 113 | 114 | #ifdef MP_OBJ_TYPE_GET_SLOT 115 | 116 | static MP_DEFINE_CONST_OBJ_TYPE( 117 | mp_file_type, 118 | MP_QSTR_mp_file, 119 | MP_TYPE_FLAG_NONE, 120 | print, mp_file_print, 121 | locals_dict, (mp_obj_dict_t *) &mp_file_locals_dict 122 | ); 123 | 124 | #else 125 | 126 | static const mp_obj_type_t mp_file_type = { 127 | .base = { &mp_type_type }, 128 | .name = MP_QSTR_mp_file, 129 | .print = mp_file_print, 130 | .locals_dict = (mp_obj_dict_t *)&mp_file_locals_dict, 131 | }; 132 | 133 | #endif -------------------------------------------------------------------------------- /src/mpfile.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Micro Python project, http://micropython.org/ 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016 Dave Hylands 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 | #ifndef __MICROPY_INCLUDED_PY_MPFILE_H__ 28 | #define __MICROPY_INCLUDED_PY_MPFILE_H__ 29 | 30 | #include "py/obj.h" 31 | #include // for off_t 32 | 33 | // A C API for performing I/O on files or file-like objects. 34 | 35 | typedef struct { 36 | mp_obj_base_t base; 37 | mp_obj_t file_obj; 38 | mp_obj_t readinto_fn; 39 | mp_obj_t seek_fn; 40 | mp_obj_t tell_fn; 41 | } mp_file_t; 42 | 43 | #define MP_SEEK_SET 0 44 | #define MP_SEEK_CUR 1 45 | #define MP_SEEK_END 2 46 | 47 | mp_file_t *mp_file_from_file_obj(mp_obj_t file_obj); 48 | mp_file_t *mp_open(const char *filename, const char *mode); 49 | mp_int_t mp_readinto(mp_file_t *file, void *buf, size_t num_bytes); 50 | off_t mp_seek(mp_file_t *file, off_t offset, int whence); 51 | off_t mp_tell(mp_file_t *file); 52 | void mp_close(mp_file_t *file); 53 | 54 | 55 | #endif // __MICROPY_INCLUDED_PY_MPFILE_H__ 56 | -------------------------------------------------------------------------------- /src/tjpgd565.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------/ 2 | / TJpgDec - Tiny JPEG Decompressor include file (C)ChaN, 2020 3 | /----------------------------------------------------------------------------*/ 4 | #ifndef DEF_TJPGDEC 5 | #define DEF_TJPGDEC 6 | /*---------------------------------------------------------------------------*/ 7 | /* System Configurations */ 8 | 9 | #define JD_SZBUF 512 /* Size of stream input buffer */ 10 | #define JD_FORMAT 1 /* Output pixel format 0:RGB888 (3 BYTE/pix), 1:RGB565 (1 WORD/pix) */ 11 | #define JD_USE_SCALE 1 /* Use descaling feature for output */ 12 | #define JD_TBLCLIP 1 /* Use table for saturation (might be a bit faster but increases 1K bytes of code size) */ 13 | 14 | /*---------------------------------------------------------------------------*/ 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | #include "stdint.h" 21 | 22 | /* Error code */ 23 | typedef enum { 24 | JDR_OK = 0, /* 0: Succeeded */ 25 | JDR_INTR, /* 1: Interrupted by output function */ 26 | JDR_INP, /* 2: Device error or wrong termination of input stream */ 27 | JDR_MEM1, /* 3: Insufficient memory pool for the image */ 28 | JDR_MEM2, /* 4: Insufficient stream input buffer */ 29 | JDR_PAR, /* 5: Parameter error */ 30 | JDR_FMT1, /* 6: Data format error (may be damaged data) */ 31 | JDR_FMT2, /* 7: Right format but not supported */ 32 | JDR_FMT3 /* 8: Not supported JPEG standard */ 33 | } JRESULT; 34 | 35 | 36 | 37 | /* Rectangular structure */ 38 | typedef struct { 39 | uint16_t left, right, top, bottom; 40 | } JRECT; 41 | 42 | 43 | 44 | /* Decompressor object structure */ 45 | typedef struct JDEC JDEC; 46 | struct JDEC { 47 | unsigned int dctr; /* Number of bytes available in the input buffer */ 48 | uint8_t* dptr; /* Current data read ptr */ 49 | uint8_t* inbuf; /* Bit stream input buffer */ 50 | uint8_t dmsk; /* Current bit in the current read byte */ 51 | uint8_t scale; /* Output scaling ratio */ 52 | uint8_t msx, msy; /* MCU size in unit of block (width, height) */ 53 | uint8_t qtid[3]; /* Quantization table ID of each component */ 54 | int16_t dcv[3]; /* Previous DC element of each component */ 55 | uint16_t nrst; /* Restart interval */ 56 | uint16_t width, height; /* Size of the input image (pixel) */ 57 | uint8_t* huffbits[2][2]; /* Huffman bit distribution tables [id][dcac] */ 58 | uint16_t* huffcode[2][2]; /* Huffman code word tables [id][dcac] */ 59 | uint8_t* huffdata[2][2]; /* Huffman decoded data tables [id][dcac] */ 60 | int32_t* qttbl[4]; /* Dequantizer tables [id] */ 61 | void* workbuf; /* Working buffer for IDCT and RGB output */ 62 | uint8_t* mcubuf; /* Working buffer for the MCU */ 63 | void* pool; /* Pointer to available memory pool */ 64 | unsigned int sz_pool; /* Size of memory pool (bytes available) */ 65 | unsigned int (*infunc)(JDEC*, uint8_t*, unsigned int); /* Pointer to jpeg stream input function */ 66 | void* device; /* Pointer to I/O device identifier for the session */ 67 | uint16_t x_offs; /* x offset for slow method */ 68 | uint16_t y_offs; /* y offset for slow method */ 69 | }; 70 | 71 | 72 | /* TJpgDec API functions */ 73 | JRESULT jd_prepare (JDEC* jd, unsigned int (*infunc)(JDEC*,uint8_t*,unsigned int), void* pool, unsigned int sz_pool, void* dev); 74 | JRESULT jd_decomp (JDEC* jd, int (*outfunc)(JDEC*,void*,JRECT*), uint8_t scale); 75 | 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif /* _TJPGDEC */ 82 | -------------------------------------------------------------------------------- /utils/font_from_romfont.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Convert fonts from the font-bin directory of spacerace's 4 | https://github.com/spacerace/romfont repo. 5 | 6 | Reads all romfont bin files from the specified -input-directory (-i) and writes 7 | python font files to the specified -output-directory (-o). Optionally limiting 8 | characters included to -first-char (-f) thru -last-char (-l). 9 | 10 | Example: 11 | 12 | font_from_romfont -i font-bin -o pyfont -f 32 -l 127 13 | 14 | requires argparse 15 | """ 16 | import os 17 | import re 18 | import argparse 19 | 20 | def convert_font(file_in, file_out, width, height, first=0x0, last=0xff): 21 | chunk_size = height 22 | with open(file_in, "rb") as bin_file: 23 | bin_file.seek(first * height) 24 | current = first 25 | with open(file_out, 'wt') as font_file: 26 | print(f'"""converted from {file_in} """', file=font_file) 27 | print(f'WIDTH = {width}', file=font_file) 28 | print(f'HEIGHT = {height}', file=font_file) 29 | print(f'FIRST = 0x{first:02x}', file=font_file) 30 | print(f'LAST = 0x{last:02x}', file=font_file) 31 | print(f'_FONT =\\\n', sep='', end='', file=font_file) 32 | for chunk in iter(lambda: bin_file.read(chunk_size), b''): 33 | print('b\'', sep='', end='', file=font_file) 34 | for data in chunk: 35 | print(f'\\x{data:02x}', end='', file=font_file) 36 | print('\'\\', file=font_file) 37 | current += 1 38 | if current > last: 39 | break 40 | 41 | print('', file=font_file) 42 | print('FONT = memoryview(_FONT)', file=font_file) 43 | 44 | def auto_int(x): 45 | return int(x, 0) 46 | 47 | def main(): 48 | 49 | parser = argparse.ArgumentParser( 50 | description='Convert fomfont.bin font files in input to python in font_directory.') 51 | parser.add_argument('input', help='file or directory containing binary font file(s).') 52 | parser.add_argument('output', help='file or directory to contain python font file(s).') 53 | parser.add_argument('-f', '--first-char', type=auto_int, default=0x20) 54 | parser.add_argument('-l', '--last-char', type=auto_int, default=0x7f) 55 | args = parser.parse_args() 56 | 57 | file_re = re.compile(r'^(.*)(\d+)x(\d+)\.bin$') 58 | 59 | is_dir = os.path.isdir(args.input) 60 | if is_dir: 61 | bin_files = os.listdir(args.input) 62 | else: 63 | bin_files = [args.input] 64 | 65 | for bin_file_name in bin_files: 66 | match = file_re.match(bin_file_name) 67 | if match: 68 | font_width = int(match.group(2)) 69 | font_height = int(match.group(3)) 70 | 71 | if is_dir: 72 | bin_file_name = args.input+'/'+bin_file_name 73 | 74 | if is_dir: 75 | font_file_name = ( 76 | args.font_directory + '/' + 77 | match.group(1).rstrip('_').lower()+ 78 | f'_{font_width}x{font_height}.py') 79 | else: 80 | font_file_name = args.output 81 | 82 | print("converting", bin_file_name, 'to', font_file_name) 83 | 84 | convert_font( 85 | bin_file_name, 86 | font_file_name, 87 | font_width, 88 | font_height, 89 | args.first_char, 90 | args.last_char) 91 | main() -------------------------------------------------------------------------------- /utils/imgtobitmap.py: -------------------------------------------------------------------------------- 1 | #!python3 2 | ''' 3 | Convert image file to python module for use with blit_bitmap. 4 | 5 | Usage imgtobitmap image_file bits_per_pixel >image.py 6 | ''' 7 | 8 | import sys 9 | from PIL import Image 10 | from itertools import groupby 11 | import argparse 12 | 13 | def main(): 14 | 15 | parser = argparse.ArgumentParser( 16 | prog='imgtobitmap', 17 | description='Convert image file to python module for use with bitmap method.') 18 | 19 | parser.add_argument('image_file', 20 | help='Name of file containing image to convert') 21 | 22 | parser.add_argument('bits_per_pixel', 23 | type=int, 24 | choices=range(1,9), 25 | default=1, 26 | metavar='bits_per_pixel', 27 | help='The number of bits to use per pixel (1..8)') 28 | 29 | args = parser.parse_args() 30 | 31 | bits = args.bits_per_pixel 32 | img = Image.open(args.image_file) 33 | img = img.convert("P", palette=Image.ADAPTIVE, colors=2**bits) 34 | palette = img.getpalette() # Make copy of palette colors 35 | 36 | # For all the colors in the palette 37 | colors = [] 38 | for color in range(1<> 3)) 45 | 46 | # swap bytes in 565 47 | color = ((color565 & 0xff) << 8) + ((color565 & 0xff00) >> 8) 48 | 49 | # append byte swapped 565 color to colors 50 | colors.append(f'{color:04x}') 51 | 52 | 53 | image_bitstring = '' 54 | bit_index = 0 55 | max_colors = 1<t1.py 19 | ./imgtobits.py t2.png 3 >t2.py 20 | ./imgtobits.py t3.png 3 >t3.py 21 | ./imgtobits.py t4.png 3 >t4.py 22 | ./imgtobits.py t5.png 3 >t5.py 23 | 24 | cp -v t[12345].py ../examples 25 | 26 | -------------------------------------------------------------------------------- /utils/png_from_font.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | Imports all the python font files from the specified -input-directory (-i) and 5 | creates png samples of each font in the specified -output-directory (-o). 6 | 7 | Example: 8 | png_from_font.py font_directory png_directory 9 | 10 | Requires argparse, importlib and pypng 11 | """ 12 | 13 | import os 14 | import importlib 15 | import png 16 | import argparse 17 | 18 | def create_png(font_file_name, png_file_name): 19 | 20 | module_spec = importlib.util.spec_from_file_location('font', font_file_name) 21 | font = importlib.util.module_from_spec(module_spec) 22 | module_spec.loader.exec_module(font) 23 | char_count = font.LAST - font.FIRST 24 | column_count = 16 25 | row_count = (char_count // column_count) 26 | 27 | with open(png_file_name, 'wb') as png_file: 28 | image = png.Writer((16+2) * font.WIDTH, (row_count+3) * font.HEIGHT, bitdepth=1) 29 | image_data = [[0 for j in range((16+2) * font.WIDTH)] for i in range((row_count+3)* font.HEIGHT)] 30 | font_count = len(font.FONT)+1 31 | for chart_row in range(row_count+2): 32 | for chart_col in range(16): 33 | chart_idx = chart_row * 16 + chart_col 34 | for char_line in range(font.HEIGHT): 35 | for char_byte in range(font.WIDTH//8): 36 | ch_idx = chart_idx * font.HEIGHT * font.WIDTH//8 + char_byte + char_line * font.WIDTH//8 37 | print(chart_idx, char_count) 38 | if (chart_idx <= char_count): 39 | data = font.FONT[ch_idx] 40 | else: 41 | data = 0 42 | 43 | for bit in range(8): 44 | png_row = (chart_row+1)*font.HEIGHT+char_line 45 | png_col = (chart_col+1)*font.WIDTH+char_byte*8+bit 46 | if data & 1 << 7-bit: 47 | image_data[png_row][png_col] = 1 48 | else: 49 | image_data[png_row][png_col] = 0 50 | 51 | print("Creating", png_file_name) 52 | image.write(png_file, image_data) 53 | 54 | def main(): 55 | parser = argparse.ArgumentParser( 56 | description='Convert 8bit font-bin.bin font files in bin_directory to python in font_directory.') 57 | parser.add_argument( 58 | 'font_directory', help='directory containing python font files. (input)') 59 | parser.add_argument( 60 | 'png_directory', help='directory to contain binary font files. (output)') 61 | args = parser.parse_args() 62 | 63 | for file_name in os.listdir(args.font_directory): 64 | if file_name.endswith('.py'): 65 | font_file_name = args.font_directory+'/'+file_name 66 | png_file_name = args.png_directory+'/'+os.path.splitext(file_name)[0]+'.png' 67 | create_png(font_file_name, png_file_name) 68 | 69 | main() 70 | -------------------------------------------------------------------------------- /utils/requirements.txt: -------------------------------------------------------------------------------- 1 | Pillow==8.1.2 2 | pypng==0.0.20 3 | -------------------------------------------------------------------------------- /utils/t1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/utils/t1.png -------------------------------------------------------------------------------- /utils/t2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/utils/t2.png -------------------------------------------------------------------------------- /utils/t3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/utils/t3.png -------------------------------------------------------------------------------- /utils/t4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/utils/t4.png -------------------------------------------------------------------------------- /utils/t5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/utils/t5.png -------------------------------------------------------------------------------- /utils/toasters.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/russhughes/ili9342c_mpy/e4140cb0635407cb288d3b3985d225bb4da6ebf0/utils/toasters.bmp --------------------------------------------------------------------------------