├── .gitignore ├── README.md ├── artwork ├── arrow_cursor.bmp ├── arrow_cursor_mask.bmp ├── art_window_title.bmp ├── bezel.bmp ├── bezel_mask.bmp ├── cairo_0.bmp ├── cairo_1.bmp ├── cairo_2.bmp ├── cairo_3.bmp ├── cairo_4.bmp ├── cairo_5.bmp ├── cairo_6.bmp ├── cairo_7.bmp ├── cairo_8.bmp ├── calculator.bmp ├── calculator_mask.bmp ├── desktop_plain.bmp ├── dev_window_title.bmp ├── folder_tiny.bmp ├── game_window_title.bmp ├── icon_art0.bmp ├── icon_art1.bmp ├── icon_art2.bmp ├── icon_art3.bmp ├── icon_art4.bmp ├── icon_art5.bmp ├── icon_art6.bmp ├── icon_art7.bmp ├── icon_art8.bmp ├── icon_art9.bmp ├── icon_dev0.bmp ├── icon_dev1.bmp ├── icon_dev2.bmp ├── icon_dev3.bmp ├── icon_dev4.bmp ├── icon_dev5.bmp ├── icon_dev6.bmp ├── icon_dev7.bmp ├── icon_dev8.bmp ├── icon_dev9.bmp ├── icon_game0.bmp ├── icon_game1.bmp ├── icon_game10.bmp ├── icon_game11.bmp ├── icon_game12.bmp ├── icon_game13.bmp ├── icon_game14.bmp ├── icon_game15.bmp ├── icon_game16.bmp ├── icon_game17.bmp ├── icon_game18.bmp ├── icon_game19.bmp ├── icon_game2.bmp ├── icon_game20.bmp ├── icon_game21.bmp ├── icon_game22.bmp ├── icon_game23.bmp ├── icon_game24.bmp ├── icon_game25.bmp ├── icon_game26.bmp ├── icon_game27.bmp ├── icon_game28.bmp ├── icon_game29.bmp ├── icon_game3.bmp ├── icon_game30.bmp ├── icon_game31.bmp ├── icon_game32.bmp ├── icon_game33.bmp ├── icon_game34.bmp ├── icon_game35.bmp ├── icon_game36.bmp ├── icon_game37.bmp ├── icon_game38.bmp ├── icon_game39.bmp ├── icon_game4.bmp ├── icon_game40.bmp ├── icon_game41.bmp ├── icon_game42.bmp ├── icon_game43.bmp ├── icon_game44.bmp ├── icon_game45.bmp ├── icon_game46.bmp ├── icon_game47.bmp ├── icon_game48.bmp ├── icon_game49.bmp ├── icon_game5.bmp ├── icon_game50.bmp ├── icon_game51.bmp ├── icon_game52.bmp ├── icon_game53.bmp ├── icon_game54.bmp ├── icon_game55.bmp ├── icon_game56.bmp ├── icon_game57.bmp ├── icon_game58.bmp ├── icon_game59.bmp ├── icon_game6.bmp ├── icon_game60.bmp ├── icon_game61.bmp ├── icon_game62.bmp ├── icon_game63.bmp ├── icon_game64.bmp ├── icon_game65.bmp ├── icon_game66.bmp ├── icon_game67.bmp ├── icon_game68.bmp ├── icon_game69.bmp ├── icon_game7.bmp ├── icon_game70.bmp ├── icon_game71.bmp ├── icon_game72.bmp ├── icon_game73.bmp ├── icon_game74.bmp ├── icon_game75.bmp ├── icon_game76.bmp ├── icon_game77.bmp ├── icon_game78.bmp ├── icon_game79.bmp ├── icon_game8.bmp ├── icon_game80.bmp ├── icon_game81.bmp ├── icon_game82.bmp ├── icon_game83.bmp ├── icon_game84.bmp ├── icon_game85.bmp ├── icon_game86.bmp ├── icon_game87.bmp ├── icon_game88.bmp ├── icon_game9.bmp ├── icon_mask.bmp ├── icon_office0.bmp ├── icon_office1.bmp ├── icon_office2.bmp ├── icon_office3.bmp ├── icon_office4.bmp ├── icon_office5.bmp ├── icon_office6.bmp ├── icon_office7.bmp ├── icon_office8.bmp ├── icon_office9.bmp ├── icon_sys0.bmp ├── icon_sys1.bmp ├── icon_sys10.bmp ├── icon_sys11.bmp ├── icon_sys12.bmp ├── icon_sys13.bmp ├── icon_sys14.bmp ├── icon_sys15.bmp ├── icon_sys16.bmp ├── icon_sys2.bmp ├── icon_sys3.bmp ├── icon_sys4.bmp ├── icon_sys5.bmp ├── icon_sys6.bmp ├── icon_sys7.bmp ├── icon_sys8.bmp ├── icon_sys9.bmp ├── icon_util0.bmp ├── icon_util1.bmp ├── icon_util10.bmp ├── icon_util2.bmp ├── icon_util3.bmp ├── icon_util4.bmp ├── icon_util5.bmp ├── icon_util6.bmp ├── icon_util7.bmp ├── icon_util8.bmp ├── icon_util9.bmp ├── key_caps.bmp ├── key_caps_mask.bmp ├── memo.bmp ├── moon0.bmp ├── moon1.bmp ├── moon10.bmp ├── moon11.bmp ├── moon12.bmp ├── moon13.bmp ├── moon14.bmp ├── moon15.bmp ├── moon16.bmp ├── moon17.bmp ├── moon18.bmp ├── moon19.bmp ├── moon2.bmp ├── moon20.bmp ├── moon21.bmp ├── moon22.bmp ├── moon23.bmp ├── moon3.bmp ├── moon4.bmp ├── moon5.bmp ├── moon6.bmp ├── moon7.bmp ├── moon8.bmp ├── moon9.bmp ├── moon_da_window.bmp ├── moon_da_window_disabled.bmp ├── moon_da_window_mask.bmp ├── office_window_title.bmp ├── paint_window.bmp ├── paint_window_mask.bmp ├── puzzle.bmp ├── puzzle_mask.bmp ├── scrapbook.bmp ├── scrapbook_disabled.bmp ├── scrapbook_mask.bmp ├── system_window_title.bmp ├── systemsix_disk_black.bmp ├── systemsix_disk_mask.bmp ├── systemsix_disk_white.bmp ├── trash.bmp ├── trash_full.bmp ├── trash_full_mask.bmp ├── trash_mask.bmp ├── util_window_title.bmp ├── window_3_2.bmp ├── window_3_2_disabled.bmp ├── window_3_2_mask.bmp ├── window_4_1.bmp ├── window_4_1_mask.bmp ├── window_list_6.bmp ├── window_list_6_mask.bmp ├── write_window.bmp ├── write_window_disabled.bmp └── write_window_mask.bmp ├── calendar_module.py ├── desktop_render.py ├── documentation ├── DisplaySample.png ├── SystemSixDisplayed.jpeg ├── SystemSixLogo.png ├── systemsix_stand.svg └── systemsix_stand_bend_line.svg ├── eink_utils.py ├── fonts ├── ChiKareGo2.ttf ├── Pixelva.ttf └── geneva_9.ttf ├── lib ├── __init__.py ├── epd1in02.py ├── epd1in54.py ├── epd1in54_V2.py ├── epd1in54b.py ├── epd1in54b_V2.py ├── epd1in54c.py ├── epd2in13.py ├── epd2in13_V2.py ├── epd2in13_V3.py ├── epd2in13b_V3.py ├── epd2in13bc.py ├── epd2in13d.py ├── epd2in66.py ├── epd2in66b.py ├── epd2in7.py ├── epd2in7b.py ├── epd2in7b_V2.py ├── epd2in9.py ├── epd2in9_V2.py ├── epd2in9b_V3.py ├── epd2in9bc.py ├── epd2in9d.py ├── epd3in7.py ├── epd4in01f.py ├── epd4in2.py ├── epd4in2b_V2.py ├── epd4in2bc.py ├── epd5in65f.py ├── epd5in83.py ├── epd5in83_V2.py ├── epd5in83b_V2.py ├── epd5in83bc.py ├── epd7in5.py ├── epd7in5_HD.py ├── epd7in5_V2.py ├── epd7in5b_HD.py ├── epd7in5b_V2.py ├── epd7in5bc.py ├── epdconfig.py ├── info.txt ├── sysfs_gpio.so └── sysfs_software_spi.so ├── moon_module.py ├── requirements.txt ├── run_systemsix.sh ├── settings.py ├── settings.py.sample ├── systemsix.py └── weather_module.py /.gitignore: -------------------------------------------------------------------------------- 1 | e-Paper/* 2 | bcm2835-1.60/* 3 | .vscode/* 4 | *__pycache__/* 5 | INK_EXPORT.bmp 6 | *.pyc 7 | *.cache/* 8 | settings.py 9 | info.log 10 | .idea/ 11 | .DS_Store -------------------------------------------------------------------------------- /artwork/arrow_cursor.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/arrow_cursor.bmp -------------------------------------------------------------------------------- /artwork/arrow_cursor_mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/arrow_cursor_mask.bmp -------------------------------------------------------------------------------- /artwork/art_window_title.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/art_window_title.bmp -------------------------------------------------------------------------------- /artwork/bezel.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/bezel.bmp -------------------------------------------------------------------------------- /artwork/bezel_mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/bezel_mask.bmp -------------------------------------------------------------------------------- /artwork/cairo_0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/cairo_0.bmp -------------------------------------------------------------------------------- /artwork/cairo_1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/cairo_1.bmp -------------------------------------------------------------------------------- /artwork/cairo_2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/cairo_2.bmp -------------------------------------------------------------------------------- /artwork/cairo_3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/cairo_3.bmp -------------------------------------------------------------------------------- /artwork/cairo_4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/cairo_4.bmp -------------------------------------------------------------------------------- /artwork/cairo_5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/cairo_5.bmp -------------------------------------------------------------------------------- /artwork/cairo_6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/cairo_6.bmp -------------------------------------------------------------------------------- /artwork/cairo_7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/cairo_7.bmp -------------------------------------------------------------------------------- /artwork/cairo_8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/cairo_8.bmp -------------------------------------------------------------------------------- /artwork/calculator.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/calculator.bmp -------------------------------------------------------------------------------- /artwork/calculator_mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/calculator_mask.bmp -------------------------------------------------------------------------------- /artwork/desktop_plain.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/desktop_plain.bmp -------------------------------------------------------------------------------- /artwork/dev_window_title.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/dev_window_title.bmp -------------------------------------------------------------------------------- /artwork/folder_tiny.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/folder_tiny.bmp -------------------------------------------------------------------------------- /artwork/game_window_title.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/game_window_title.bmp -------------------------------------------------------------------------------- /artwork/icon_art0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_art0.bmp -------------------------------------------------------------------------------- /artwork/icon_art1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_art1.bmp -------------------------------------------------------------------------------- /artwork/icon_art2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_art2.bmp -------------------------------------------------------------------------------- /artwork/icon_art3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_art3.bmp -------------------------------------------------------------------------------- /artwork/icon_art4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_art4.bmp -------------------------------------------------------------------------------- /artwork/icon_art5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_art5.bmp -------------------------------------------------------------------------------- /artwork/icon_art6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_art6.bmp -------------------------------------------------------------------------------- /artwork/icon_art7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_art7.bmp -------------------------------------------------------------------------------- /artwork/icon_art8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_art8.bmp -------------------------------------------------------------------------------- /artwork/icon_art9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_art9.bmp -------------------------------------------------------------------------------- /artwork/icon_dev0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_dev0.bmp -------------------------------------------------------------------------------- /artwork/icon_dev1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_dev1.bmp -------------------------------------------------------------------------------- /artwork/icon_dev2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_dev2.bmp -------------------------------------------------------------------------------- /artwork/icon_dev3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_dev3.bmp -------------------------------------------------------------------------------- /artwork/icon_dev4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_dev4.bmp -------------------------------------------------------------------------------- /artwork/icon_dev5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_dev5.bmp -------------------------------------------------------------------------------- /artwork/icon_dev6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_dev6.bmp -------------------------------------------------------------------------------- /artwork/icon_dev7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_dev7.bmp -------------------------------------------------------------------------------- /artwork/icon_dev8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_dev8.bmp -------------------------------------------------------------------------------- /artwork/icon_dev9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_dev9.bmp -------------------------------------------------------------------------------- /artwork/icon_game0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game0.bmp -------------------------------------------------------------------------------- /artwork/icon_game1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game1.bmp -------------------------------------------------------------------------------- /artwork/icon_game10.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game10.bmp -------------------------------------------------------------------------------- /artwork/icon_game11.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game11.bmp -------------------------------------------------------------------------------- /artwork/icon_game12.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game12.bmp -------------------------------------------------------------------------------- /artwork/icon_game13.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game13.bmp -------------------------------------------------------------------------------- /artwork/icon_game14.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game14.bmp -------------------------------------------------------------------------------- /artwork/icon_game15.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game15.bmp -------------------------------------------------------------------------------- /artwork/icon_game16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game16.bmp -------------------------------------------------------------------------------- /artwork/icon_game17.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game17.bmp -------------------------------------------------------------------------------- /artwork/icon_game18.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game18.bmp -------------------------------------------------------------------------------- /artwork/icon_game19.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game19.bmp -------------------------------------------------------------------------------- /artwork/icon_game2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game2.bmp -------------------------------------------------------------------------------- /artwork/icon_game20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game20.bmp -------------------------------------------------------------------------------- /artwork/icon_game21.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game21.bmp -------------------------------------------------------------------------------- /artwork/icon_game22.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game22.bmp -------------------------------------------------------------------------------- /artwork/icon_game23.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game23.bmp -------------------------------------------------------------------------------- /artwork/icon_game24.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game24.bmp -------------------------------------------------------------------------------- /artwork/icon_game25.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game25.bmp -------------------------------------------------------------------------------- /artwork/icon_game26.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game26.bmp -------------------------------------------------------------------------------- /artwork/icon_game27.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game27.bmp -------------------------------------------------------------------------------- /artwork/icon_game28.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game28.bmp -------------------------------------------------------------------------------- /artwork/icon_game29.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game29.bmp -------------------------------------------------------------------------------- /artwork/icon_game3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game3.bmp -------------------------------------------------------------------------------- /artwork/icon_game30.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game30.bmp -------------------------------------------------------------------------------- /artwork/icon_game31.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game31.bmp -------------------------------------------------------------------------------- /artwork/icon_game32.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game32.bmp -------------------------------------------------------------------------------- /artwork/icon_game33.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game33.bmp -------------------------------------------------------------------------------- /artwork/icon_game34.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game34.bmp -------------------------------------------------------------------------------- /artwork/icon_game35.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game35.bmp -------------------------------------------------------------------------------- /artwork/icon_game36.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game36.bmp -------------------------------------------------------------------------------- /artwork/icon_game37.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game37.bmp -------------------------------------------------------------------------------- /artwork/icon_game38.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game38.bmp -------------------------------------------------------------------------------- /artwork/icon_game39.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game39.bmp -------------------------------------------------------------------------------- /artwork/icon_game4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game4.bmp -------------------------------------------------------------------------------- /artwork/icon_game40.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game40.bmp -------------------------------------------------------------------------------- /artwork/icon_game41.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game41.bmp -------------------------------------------------------------------------------- /artwork/icon_game42.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game42.bmp -------------------------------------------------------------------------------- /artwork/icon_game43.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game43.bmp -------------------------------------------------------------------------------- /artwork/icon_game44.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game44.bmp -------------------------------------------------------------------------------- /artwork/icon_game45.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game45.bmp -------------------------------------------------------------------------------- /artwork/icon_game46.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game46.bmp -------------------------------------------------------------------------------- /artwork/icon_game47.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game47.bmp -------------------------------------------------------------------------------- /artwork/icon_game48.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game48.bmp -------------------------------------------------------------------------------- /artwork/icon_game49.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game49.bmp -------------------------------------------------------------------------------- /artwork/icon_game5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game5.bmp -------------------------------------------------------------------------------- /artwork/icon_game50.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game50.bmp -------------------------------------------------------------------------------- /artwork/icon_game51.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game51.bmp -------------------------------------------------------------------------------- /artwork/icon_game52.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game52.bmp -------------------------------------------------------------------------------- /artwork/icon_game53.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game53.bmp -------------------------------------------------------------------------------- /artwork/icon_game54.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game54.bmp -------------------------------------------------------------------------------- /artwork/icon_game55.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game55.bmp -------------------------------------------------------------------------------- /artwork/icon_game56.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game56.bmp -------------------------------------------------------------------------------- /artwork/icon_game57.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game57.bmp -------------------------------------------------------------------------------- /artwork/icon_game58.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game58.bmp -------------------------------------------------------------------------------- /artwork/icon_game59.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game59.bmp -------------------------------------------------------------------------------- /artwork/icon_game6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game6.bmp -------------------------------------------------------------------------------- /artwork/icon_game60.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game60.bmp -------------------------------------------------------------------------------- /artwork/icon_game61.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game61.bmp -------------------------------------------------------------------------------- /artwork/icon_game62.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game62.bmp -------------------------------------------------------------------------------- /artwork/icon_game63.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game63.bmp -------------------------------------------------------------------------------- /artwork/icon_game64.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game64.bmp -------------------------------------------------------------------------------- /artwork/icon_game65.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game65.bmp -------------------------------------------------------------------------------- /artwork/icon_game66.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game66.bmp -------------------------------------------------------------------------------- /artwork/icon_game67.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game67.bmp -------------------------------------------------------------------------------- /artwork/icon_game68.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game68.bmp -------------------------------------------------------------------------------- /artwork/icon_game69.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game69.bmp -------------------------------------------------------------------------------- /artwork/icon_game7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game7.bmp -------------------------------------------------------------------------------- /artwork/icon_game70.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game70.bmp -------------------------------------------------------------------------------- /artwork/icon_game71.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game71.bmp -------------------------------------------------------------------------------- /artwork/icon_game72.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game72.bmp -------------------------------------------------------------------------------- /artwork/icon_game73.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game73.bmp -------------------------------------------------------------------------------- /artwork/icon_game74.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game74.bmp -------------------------------------------------------------------------------- /artwork/icon_game75.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game75.bmp -------------------------------------------------------------------------------- /artwork/icon_game76.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game76.bmp -------------------------------------------------------------------------------- /artwork/icon_game77.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game77.bmp -------------------------------------------------------------------------------- /artwork/icon_game78.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game78.bmp -------------------------------------------------------------------------------- /artwork/icon_game79.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game79.bmp -------------------------------------------------------------------------------- /artwork/icon_game8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game8.bmp -------------------------------------------------------------------------------- /artwork/icon_game80.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game80.bmp -------------------------------------------------------------------------------- /artwork/icon_game81.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game81.bmp -------------------------------------------------------------------------------- /artwork/icon_game82.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game82.bmp -------------------------------------------------------------------------------- /artwork/icon_game83.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game83.bmp -------------------------------------------------------------------------------- /artwork/icon_game84.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game84.bmp -------------------------------------------------------------------------------- /artwork/icon_game85.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game85.bmp -------------------------------------------------------------------------------- /artwork/icon_game86.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game86.bmp -------------------------------------------------------------------------------- /artwork/icon_game87.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game87.bmp -------------------------------------------------------------------------------- /artwork/icon_game88.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game88.bmp -------------------------------------------------------------------------------- /artwork/icon_game9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_game9.bmp -------------------------------------------------------------------------------- /artwork/icon_mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_mask.bmp -------------------------------------------------------------------------------- /artwork/icon_office0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_office0.bmp -------------------------------------------------------------------------------- /artwork/icon_office1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_office1.bmp -------------------------------------------------------------------------------- /artwork/icon_office2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_office2.bmp -------------------------------------------------------------------------------- /artwork/icon_office3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_office3.bmp -------------------------------------------------------------------------------- /artwork/icon_office4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_office4.bmp -------------------------------------------------------------------------------- /artwork/icon_office5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_office5.bmp -------------------------------------------------------------------------------- /artwork/icon_office6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_office6.bmp -------------------------------------------------------------------------------- /artwork/icon_office7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_office7.bmp -------------------------------------------------------------------------------- /artwork/icon_office8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_office8.bmp -------------------------------------------------------------------------------- /artwork/icon_office9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_office9.bmp -------------------------------------------------------------------------------- /artwork/icon_sys0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys0.bmp -------------------------------------------------------------------------------- /artwork/icon_sys1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys1.bmp -------------------------------------------------------------------------------- /artwork/icon_sys10.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys10.bmp -------------------------------------------------------------------------------- /artwork/icon_sys11.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys11.bmp -------------------------------------------------------------------------------- /artwork/icon_sys12.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys12.bmp -------------------------------------------------------------------------------- /artwork/icon_sys13.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys13.bmp -------------------------------------------------------------------------------- /artwork/icon_sys14.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys14.bmp -------------------------------------------------------------------------------- /artwork/icon_sys15.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys15.bmp -------------------------------------------------------------------------------- /artwork/icon_sys16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys16.bmp -------------------------------------------------------------------------------- /artwork/icon_sys2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys2.bmp -------------------------------------------------------------------------------- /artwork/icon_sys3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys3.bmp -------------------------------------------------------------------------------- /artwork/icon_sys4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys4.bmp -------------------------------------------------------------------------------- /artwork/icon_sys5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys5.bmp -------------------------------------------------------------------------------- /artwork/icon_sys6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys6.bmp -------------------------------------------------------------------------------- /artwork/icon_sys7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys7.bmp -------------------------------------------------------------------------------- /artwork/icon_sys8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys8.bmp -------------------------------------------------------------------------------- /artwork/icon_sys9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_sys9.bmp -------------------------------------------------------------------------------- /artwork/icon_util0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_util0.bmp -------------------------------------------------------------------------------- /artwork/icon_util1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_util1.bmp -------------------------------------------------------------------------------- /artwork/icon_util10.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_util10.bmp -------------------------------------------------------------------------------- /artwork/icon_util2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_util2.bmp -------------------------------------------------------------------------------- /artwork/icon_util3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_util3.bmp -------------------------------------------------------------------------------- /artwork/icon_util4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_util4.bmp -------------------------------------------------------------------------------- /artwork/icon_util5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_util5.bmp -------------------------------------------------------------------------------- /artwork/icon_util6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_util6.bmp -------------------------------------------------------------------------------- /artwork/icon_util7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_util7.bmp -------------------------------------------------------------------------------- /artwork/icon_util8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_util8.bmp -------------------------------------------------------------------------------- /artwork/icon_util9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/icon_util9.bmp -------------------------------------------------------------------------------- /artwork/key_caps.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/key_caps.bmp -------------------------------------------------------------------------------- /artwork/key_caps_mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/key_caps_mask.bmp -------------------------------------------------------------------------------- /artwork/memo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/memo.bmp -------------------------------------------------------------------------------- /artwork/moon0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon0.bmp -------------------------------------------------------------------------------- /artwork/moon1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon1.bmp -------------------------------------------------------------------------------- /artwork/moon10.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon10.bmp -------------------------------------------------------------------------------- /artwork/moon11.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon11.bmp -------------------------------------------------------------------------------- /artwork/moon12.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon12.bmp -------------------------------------------------------------------------------- /artwork/moon13.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon13.bmp -------------------------------------------------------------------------------- /artwork/moon14.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon14.bmp -------------------------------------------------------------------------------- /artwork/moon15.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon15.bmp -------------------------------------------------------------------------------- /artwork/moon16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon16.bmp -------------------------------------------------------------------------------- /artwork/moon17.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon17.bmp -------------------------------------------------------------------------------- /artwork/moon18.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon18.bmp -------------------------------------------------------------------------------- /artwork/moon19.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon19.bmp -------------------------------------------------------------------------------- /artwork/moon2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon2.bmp -------------------------------------------------------------------------------- /artwork/moon20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon20.bmp -------------------------------------------------------------------------------- /artwork/moon21.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon21.bmp -------------------------------------------------------------------------------- /artwork/moon22.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon22.bmp -------------------------------------------------------------------------------- /artwork/moon23.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon23.bmp -------------------------------------------------------------------------------- /artwork/moon3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon3.bmp -------------------------------------------------------------------------------- /artwork/moon4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon4.bmp -------------------------------------------------------------------------------- /artwork/moon5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon5.bmp -------------------------------------------------------------------------------- /artwork/moon6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon6.bmp -------------------------------------------------------------------------------- /artwork/moon7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon7.bmp -------------------------------------------------------------------------------- /artwork/moon8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon8.bmp -------------------------------------------------------------------------------- /artwork/moon9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon9.bmp -------------------------------------------------------------------------------- /artwork/moon_da_window.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon_da_window.bmp -------------------------------------------------------------------------------- /artwork/moon_da_window_disabled.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon_da_window_disabled.bmp -------------------------------------------------------------------------------- /artwork/moon_da_window_mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/moon_da_window_mask.bmp -------------------------------------------------------------------------------- /artwork/office_window_title.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/office_window_title.bmp -------------------------------------------------------------------------------- /artwork/paint_window.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/paint_window.bmp -------------------------------------------------------------------------------- /artwork/paint_window_mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/paint_window_mask.bmp -------------------------------------------------------------------------------- /artwork/puzzle.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/puzzle.bmp -------------------------------------------------------------------------------- /artwork/puzzle_mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/puzzle_mask.bmp -------------------------------------------------------------------------------- /artwork/scrapbook.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/scrapbook.bmp -------------------------------------------------------------------------------- /artwork/scrapbook_disabled.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/scrapbook_disabled.bmp -------------------------------------------------------------------------------- /artwork/scrapbook_mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/scrapbook_mask.bmp -------------------------------------------------------------------------------- /artwork/system_window_title.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/system_window_title.bmp -------------------------------------------------------------------------------- /artwork/systemsix_disk_black.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/systemsix_disk_black.bmp -------------------------------------------------------------------------------- /artwork/systemsix_disk_mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/systemsix_disk_mask.bmp -------------------------------------------------------------------------------- /artwork/systemsix_disk_white.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/systemsix_disk_white.bmp -------------------------------------------------------------------------------- /artwork/trash.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/trash.bmp -------------------------------------------------------------------------------- /artwork/trash_full.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/trash_full.bmp -------------------------------------------------------------------------------- /artwork/trash_full_mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/trash_full_mask.bmp -------------------------------------------------------------------------------- /artwork/trash_mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/trash_mask.bmp -------------------------------------------------------------------------------- /artwork/util_window_title.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/util_window_title.bmp -------------------------------------------------------------------------------- /artwork/window_3_2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/window_3_2.bmp -------------------------------------------------------------------------------- /artwork/window_3_2_disabled.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/window_3_2_disabled.bmp -------------------------------------------------------------------------------- /artwork/window_3_2_mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/window_3_2_mask.bmp -------------------------------------------------------------------------------- /artwork/window_4_1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/window_4_1.bmp -------------------------------------------------------------------------------- /artwork/window_4_1_mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/window_4_1_mask.bmp -------------------------------------------------------------------------------- /artwork/window_list_6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/window_list_6.bmp -------------------------------------------------------------------------------- /artwork/window_list_6_mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/window_list_6_mask.bmp -------------------------------------------------------------------------------- /artwork/write_window.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/write_window.bmp -------------------------------------------------------------------------------- /artwork/write_window_disabled.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/write_window_disabled.bmp -------------------------------------------------------------------------------- /artwork/write_window_mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/artwork/write_window_mask.bmp -------------------------------------------------------------------------------- /calendar_module.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import logging 3 | import time 4 | from typing import List 5 | from dateutil import tz 6 | from icalevents.icalevents import events 7 | from icalevents.icalparser import Event 8 | from settings import WEBDAV_CALENDAR_URL, WEBDAV_IS_APPLE 9 | 10 | 11 | logger = logging.getLogger('app') 12 | 13 | 14 | def sort_by_date(e: Event): 15 | return e.start.astimezone() 16 | 17 | 18 | def get_events(max_number: int) -> List[Event]: 19 | logger.info("calendar_module.get_events(); trying....") 20 | utc_timezone = tz.tzutc() 21 | current_timezone = tz.tzlocal() 22 | 23 | try: 24 | event_list = events(WEBDAV_CALENDAR_URL, fix_apple=WEBDAV_IS_APPLE) 25 | event_list.sort(key=sort_by_date) 26 | 27 | start_count = 0 28 | for event in event_list: 29 | event.start.replace(tzinfo=utc_timezone) 30 | event.start = event.start.astimezone(current_timezone) 31 | 32 | # remove events from previous day (problem based on time-zones) 33 | day_number = time.localtime().tm_mday 34 | event_date = event.start.date() 35 | if day_number == 1 and event_date.month < time.localtime().tm_mon: 36 | start_count += 1 37 | max_number += 1 38 | elif event_date.day < day_number: 39 | start_count += 1 40 | max_number += 1 41 | 42 | logger.info("calendar_module.get_events(); got {} entries (capped to {}).".format( 43 | len(event_list), max_number-start_count)) 44 | return event_list[start_count:max_number] 45 | 46 | except Exception as e: 47 | logger.critical(e) 48 | return None 49 | 50 | -------------------------------------------------------------------------------- /documentation/DisplaySample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/documentation/DisplaySample.png -------------------------------------------------------------------------------- /documentation/SystemSixDisplayed.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/documentation/SystemSixDisplayed.jpeg -------------------------------------------------------------------------------- /documentation/SystemSixLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/documentation/SystemSixLogo.png -------------------------------------------------------------------------------- /documentation/systemsix_stand.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /documentation/systemsix_stand_bend_line.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | Overall size: 32 | 27.0 x 15.2 cm 33 | 34 | 35 | -------------------------------------------------------------------------------- /eink_utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import logging 3 | import lib.epd5in83_V2 as eInk 4 | 5 | 6 | logger = logging.getLogger('app') 7 | 8 | 9 | def init_display(epd: eInk.EPD): 10 | logger.info("Init display") 11 | epd.init() 12 | 13 | 14 | def clear_display(epd: eInk.EPD): 15 | logger.info("Clear display") 16 | epd.Clear() 17 | 18 | 19 | def set_sleep(epd: eInk.EPD): 20 | logger.info("Set display to sleep-mode") 21 | epd.sleep() 22 | 23 | -------------------------------------------------------------------------------- /fonts/ChiKareGo2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/fonts/ChiKareGo2.ttf -------------------------------------------------------------------------------- /fonts/Pixelva.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/fonts/Pixelva.ttf -------------------------------------------------------------------------------- /fonts/geneva_9.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/fonts/geneva_9.ttf -------------------------------------------------------------------------------- /lib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/lib/__init__.py -------------------------------------------------------------------------------- /lib/epd1in54b_V2.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd1in54b.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V4.0 8 | # * | Date : 2019-06-20 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | import logging 31 | from . import epdconfig 32 | 33 | # Display resolution 34 | EPD_WIDTH = 200 35 | EPD_HEIGHT = 200 36 | 37 | logger = logging.getLogger(__name__) 38 | 39 | class EPD: 40 | def __init__(self): 41 | self.reset_pin = epdconfig.RST_PIN 42 | self.dc_pin = epdconfig.DC_PIN 43 | self.busy_pin = epdconfig.BUSY_PIN 44 | self.cs_pin = epdconfig.CS_PIN 45 | self.width = EPD_WIDTH 46 | self.height = EPD_HEIGHT 47 | 48 | 49 | # Hardware reset 50 | def reset(self): 51 | epdconfig.digital_write(self.reset_pin, 1) 52 | epdconfig.delay_ms(200) 53 | epdconfig.digital_write(self.reset_pin, 0) # module reset 54 | epdconfig.delay_ms(5) 55 | epdconfig.digital_write(self.reset_pin, 1) 56 | epdconfig.delay_ms(200) 57 | 58 | def send_command(self, command): 59 | epdconfig.digital_write(self.dc_pin, 0) 60 | epdconfig.digital_write(self.cs_pin, 0) 61 | epdconfig.spi_writebyte([command]) 62 | epdconfig.digital_write(self.cs_pin, 1) 63 | 64 | def send_data(self, data): 65 | epdconfig.digital_write(self.dc_pin, 1) 66 | epdconfig.digital_write(self.cs_pin, 0) 67 | epdconfig.spi_writebyte([data]) 68 | epdconfig.digital_write(self.cs_pin, 1) 69 | 70 | def ReadBusy(self): 71 | logger.debug("e-Paper busy") 72 | while(epdconfig.digital_read(self.busy_pin) == 1): 73 | epdconfig.delay_ms(100) 74 | logger.debug("e-Paper busy release") 75 | 76 | def init(self): 77 | if (epdconfig.module_init() != 0): 78 | return -1 79 | # EPD hardware init start 80 | self.reset() 81 | 82 | self.ReadBusy() 83 | self.send_command(0x12) #SWRESET 84 | self.ReadBusy() 85 | 86 | self.send_command(0x01) #Driver output control 87 | self.send_data(0xC7) 88 | self.send_data(0x00) 89 | self.send_data(0x01) 90 | 91 | self.send_command(0x11) #data entry mode 92 | self.send_data(0x01) 93 | 94 | self.send_command(0x44) #set Ram-X address start/end position 95 | self.send_data(0x00) 96 | self.send_data(0x18) #0x18-->(24+1)*8=200 97 | 98 | self.send_command(0x45) #set Ram-Y address start/end position 99 | self.send_data(0xC7) #0xC7-->(199+1)=200 100 | self.send_data(0x00) 101 | self.send_data(0x00) 102 | self.send_data(0x00) 103 | 104 | self.send_command(0x3C) #BorderWavefrom 105 | self.send_data(0x05) 106 | 107 | self.send_command(0x18) #Read built-in temperature sensor 108 | self.send_data(0x80) 109 | 110 | self.send_command(0x4E) # set RAM x address count to 0 111 | self.send_data(0x00) 112 | self.send_command(0x4F) # set RAM y address count to 0X199 113 | self.send_data(0xC7) 114 | self.send_data(0x00) 115 | self.ReadBusy() 116 | return 0 117 | 118 | def getbuffer(self, image): 119 | buf = [0xFF] * int(self.width * self.height / 8) 120 | # Set buffer to value of Python Imaging Library image. 121 | # Image must be in mode 1. 122 | image_monocolor = image.convert('1') 123 | imwidth, imheight = image_monocolor.size 124 | if imwidth != self.width or imheight != self.height: 125 | raise ValueError('Image must be same dimensions as display \ 126 | ({0}x{1}).' .format(self.width, self.height)) 127 | 128 | pixels = image_monocolor.load() 129 | for y in range(self.height): 130 | for x in range(self.width): 131 | # Set the bits for the column of pixels at the current position. 132 | if pixels[x, y] == 0: 133 | buf[int((x + y * self.width) / 8)] &= ~(0x80 >> (x % 8)) 134 | return buf 135 | 136 | def display(self, blackimage, redimage): 137 | # send black data 138 | if (blackimage != None): 139 | self.send_command(0x24) # DATA_START_TRANSMISSION_1 140 | for i in range(0, int(self.width * self.height / 8)): 141 | self.send_data(blackimage[i]) 142 | 143 | # send red data 144 | if (redimage != None): 145 | self.send_command(0x26) # DATA_START_TRANSMISSION_2 146 | for i in range(0, int(self.width * self.height / 8)): 147 | self.send_data(~redimage[i]) 148 | 149 | self.send_command(0x22) # DISPLAY_REFRESH 150 | self.send_data(0xF7) 151 | self.send_command(0x20) # DISPLAY_REFRESH 152 | self.ReadBusy() 153 | 154 | def Clear(self): 155 | self.send_command(0x24) # DATA_START_TRANSMISSION_1 156 | for i in range(0, int(self.width * self.height / 8)): 157 | self.send_data(0xFF) 158 | 159 | self.send_command(0x26) # DATA_START_TRANSMISSION_2 160 | for i in range(0, int(self.width * self.height / 8)): 161 | self.send_data(0x00) 162 | 163 | self.send_command(0x22) # DISPLAY_REFRESH 164 | self.send_data(0xF7) 165 | self.send_command(0x20) # DISPLAY_REFRESH 166 | self.ReadBusy() 167 | 168 | 169 | def sleep(self): 170 | self.send_command(0x10) #enter deep sleep 171 | self.send_data(0x01) 172 | 173 | epdconfig.delay_ms(2000) 174 | epdconfig.module_exit() 175 | 176 | ### END OF FILE ### 177 | 178 | -------------------------------------------------------------------------------- /lib/epd1in54c.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd1in54c.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V4.0 8 | # * | Date : 2019-06-20 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | import logging 30 | from . import epdconfig 31 | 32 | # Display resolution 33 | EPD_WIDTH = 152 34 | EPD_HEIGHT = 152 35 | 36 | logger = logging.getLogger(__name__) 37 | 38 | class EPD: 39 | def __init__(self): 40 | self.reset_pin = epdconfig.RST_PIN 41 | self.dc_pin = epdconfig.DC_PIN 42 | self.busy_pin = epdconfig.BUSY_PIN 43 | self.cs_pin = epdconfig.CS_PIN 44 | self.width = EPD_WIDTH 45 | self.height = EPD_HEIGHT 46 | 47 | # Hardware reset 48 | def reset(self): 49 | epdconfig.digital_write(self.reset_pin, 1) 50 | epdconfig.delay_ms(10) 51 | epdconfig.digital_write(self.reset_pin, 0) 52 | epdconfig.delay_ms(1) 53 | epdconfig.digital_write(self.reset_pin, 1) 54 | epdconfig.delay_ms(10) 55 | 56 | def send_command(self, command): 57 | epdconfig.digital_write(self.dc_pin, 0) 58 | epdconfig.digital_write(self.cs_pin, 0) 59 | epdconfig.spi_writebyte([command]) 60 | epdconfig.digital_write(self.cs_pin, 1) 61 | 62 | def send_data(self, data): 63 | epdconfig.digital_write(self.dc_pin, 1) 64 | epdconfig.digital_write(self.cs_pin, 0) 65 | epdconfig.spi_writebyte([data]) 66 | epdconfig.digital_write(self.cs_pin, 1) 67 | 68 | def ReadBusy(self): 69 | logger.debug("e-Paper busy") 70 | while(epdconfig.digital_read(self.busy_pin) == 0): # 0: idle, 1: busy 71 | epdconfig.delay_ms(200) 72 | logger.debug("e-Paper busy release") 73 | 74 | def init(self): 75 | if (epdconfig.module_init() != 0): 76 | return -1 77 | # EPD hardware init start 78 | self.reset() 79 | 80 | self.send_command(0x06) # boost soft start 81 | self.send_data(0x17) 82 | self.send_data(0x17) 83 | self.send_data(0x17) 84 | self.send_command(0x04) # power on 85 | 86 | self.ReadBusy() 87 | 88 | self.send_command(0x00) # panel setting 89 | self.send_data(0x0f) # LUT from OTP,160x296 90 | self.send_data(0x0d) # VCOM to 0V fast 91 | 92 | self.send_command(0x61) # resolution setting 93 | self.send_data(0x98) 94 | self.send_data(0x00) 95 | self.send_data(0x98) 96 | 97 | self.send_command(0x50) 98 | self.send_data(0x77) 99 | 100 | def getbuffer(self, image): 101 | buf = [0xFF] * (int(self.width/8) * self.height) 102 | image_monocolor = image.convert('1') 103 | imwidth, imheight = image_monocolor.size 104 | pixels = image_monocolor.load() 105 | if(imwidth == self.width and imheight == self.height): 106 | logger.debug("Horizontal") 107 | for y in range(imheight): 108 | for x in range(imwidth): 109 | # Set the bits for the column of pixels at the current position. 110 | if pixels[x, y] == 0: 111 | buf[int((x + y * self.width) / 8)] &= ~(0x80 >> (x % 8)) 112 | elif(imwidth == self.height and imheight == self.width): 113 | logger.debug("Vertical") 114 | for y in range(imheight): 115 | for x in range(imwidth): 116 | newx = y 117 | newy = self.height - x - 1 118 | if pixels[x, y] == 0: 119 | buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8)) 120 | return buf 121 | 122 | def display(self, blackimage, yellowimage): 123 | self.send_command(0x10) 124 | logger.debug("blackimage") 125 | for i in range(0, int(self.width * self.height / 8)): 126 | self.send_data(blackimage[i]) 127 | self.send_command(0x13) 128 | logger.debug("yellowimage") 129 | for i in range(0, int(self.width * self.height / 8)): 130 | self.send_data(yellowimage[i]) 131 | 132 | self.send_command(0x12) 133 | self.ReadBusy() 134 | 135 | def Clear(self): 136 | self.send_command(0x10) 137 | for i in range(0, int(self.width * self.height / 8)): 138 | self.send_data(0xFF) 139 | self.send_command(0x13) 140 | for i in range(0, int(self.width * self.height / 8)): 141 | self.send_data(0xFF) 142 | 143 | self.send_command(0x12) 144 | self.ReadBusy() 145 | 146 | # after this, call epd.init() to awaken the module 147 | def sleep(self): 148 | self.send_command(0X02) # power off 149 | self.ReadBusy() 150 | self.send_command(0X07) # deep sleep 151 | self.send_data(0xA5) 152 | 153 | epdconfig.delay_ms(2000) 154 | epdconfig.module_exit() 155 | ### END OF FILE ### 156 | 157 | -------------------------------------------------------------------------------- /lib/epd2in13b_V3.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd2in13bc.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V4.0 8 | # * | Date : 2019-06-20 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | import logging 31 | from . import epdconfig 32 | 33 | # Display resolution 34 | EPD_WIDTH = 104 35 | EPD_HEIGHT = 212 36 | 37 | logger = logging.getLogger(__name__) 38 | 39 | class EPD: 40 | def __init__(self): 41 | self.reset_pin = epdconfig.RST_PIN 42 | self.dc_pin = epdconfig.DC_PIN 43 | self.busy_pin = epdconfig.BUSY_PIN 44 | self.cs_pin = epdconfig.CS_PIN 45 | self.width = EPD_WIDTH 46 | self.height = EPD_HEIGHT 47 | 48 | # Hardware reset 49 | def reset(self): 50 | epdconfig.digital_write(self.reset_pin, 1) 51 | epdconfig.delay_ms(200) 52 | epdconfig.digital_write(self.reset_pin, 0) 53 | epdconfig.delay_ms(2) 54 | epdconfig.digital_write(self.reset_pin, 1) 55 | epdconfig.delay_ms(200) 56 | 57 | def send_command(self, command): 58 | epdconfig.digital_write(self.dc_pin, 0) 59 | epdconfig.digital_write(self.cs_pin, 0) 60 | epdconfig.spi_writebyte([command]) 61 | epdconfig.digital_write(self.cs_pin, 1) 62 | 63 | def send_data(self, data): 64 | epdconfig.digital_write(self.dc_pin, 1) 65 | epdconfig.digital_write(self.cs_pin, 0) 66 | epdconfig.spi_writebyte([data]) 67 | epdconfig.digital_write(self.cs_pin, 1) 68 | 69 | def ReadBusy(self): 70 | logger.debug("e-Paper busy") 71 | self.send_command(0x71); 72 | while(epdconfig.digital_read(self.busy_pin) == 0): 73 | self.send_command(0x71); 74 | epdconfig.delay_ms(100) 75 | logger.debug("e-Paper busy release") 76 | 77 | def init(self): 78 | if (epdconfig.module_init() != 0): 79 | return -1 80 | 81 | self.reset() 82 | self.send_command(0x04); 83 | self.ReadBusy();#waiting for the electronic paper IC to release the idle signal 84 | 85 | self.send_command(0x00); #panel setting 86 | self.send_data(0x0f); #LUT from OTP,128x296 87 | self.send_data(0x89); #Temperature sensor, boost and other related timing settings 88 | 89 | self.send_command(0x61); #resolution setting 90 | self.send_data (0x68); 91 | self.send_data (0x00); 92 | self.send_data (0xD4); 93 | 94 | self.send_command(0X50); #VCOM AND DATA INTERVAL SETTING 95 | self.send_data(0x77); #WBmode:VBDF 17|D7 VBDW 97 VBDB 57 96 | # WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7 97 | 98 | return 0 99 | 100 | def getbuffer(self, image): 101 | # logger.debug("bufsiz = ",int(self.width/8) * self.height) 102 | buf = [0xFF] * (int(self.width/8) * self.height) 103 | image_monocolor = image.convert('1') 104 | imwidth, imheight = image_monocolor.size 105 | pixels = image_monocolor.load() 106 | # logger.debug("imwidth = %d, imheight = %d",imwidth,imheight) 107 | if(imwidth == self.width and imheight == self.height): 108 | logger.debug("Vertical") 109 | for y in range(imheight): 110 | for x in range(imwidth): 111 | # Set the bits for the column of pixels at the current position. 112 | if pixels[x, y] == 0: 113 | buf[int((x + y * self.width) / 8)] &= ~(0x80 >> (x % 8)) 114 | elif(imwidth == self.height and imheight == self.width): 115 | logger.debug("Horizontal") 116 | for y in range(imheight): 117 | for x in range(imwidth): 118 | newx = y 119 | newy = self.height - x - 1 120 | if pixels[x, y] == 0: 121 | buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8)) 122 | return buf 123 | 124 | def display(self, imageblack, imagered): 125 | self.send_command(0x10) 126 | for i in range(0, int(self.width * self.height / 8)): 127 | self.send_data(imageblack[i]) 128 | 129 | self.send_command(0x13) 130 | for i in range(0, int(self.width * self.height / 8)): 131 | self.send_data(imagered[i]) 132 | 133 | self.send_command(0x12) # REFRESH 134 | epdconfig.delay_ms(100) 135 | self.ReadBusy() 136 | 137 | def Clear(self): 138 | self.send_command(0x10) 139 | for i in range(0, int(self.width * self.height / 8)): 140 | self.send_data(0xFF) 141 | 142 | self.send_command(0x13) 143 | for i in range(0, int(self.width * self.height / 8)): 144 | self.send_data(0xFF) 145 | 146 | self.send_command(0x12) # REFRESH 147 | epdconfig.delay_ms(100) 148 | self.ReadBusy() 149 | 150 | def sleep(self): 151 | self.send_command(0X50) 152 | self.send_data(0xf7) 153 | self.send_command(0X02) 154 | self.ReadBusy() 155 | self.send_command(0x07) # DEEP_SLEEP 156 | self.send_data(0xA5) # check code 157 | 158 | epdconfig.delay_ms(2000) 159 | epdconfig.module_exit() 160 | ### END OF FILE ### 161 | 162 | -------------------------------------------------------------------------------- /lib/epd2in13bc.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd2in13bc.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V4.0 8 | # * | Date : 2019-06-20 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | import logging 31 | from . import epdconfig 32 | 33 | # Display resolution 34 | EPD_WIDTH = 104 35 | EPD_HEIGHT = 212 36 | 37 | logger = logging.getLogger(__name__) 38 | 39 | class EPD: 40 | def __init__(self): 41 | self.reset_pin = epdconfig.RST_PIN 42 | self.dc_pin = epdconfig.DC_PIN 43 | self.busy_pin = epdconfig.BUSY_PIN 44 | self.cs_pin = epdconfig.CS_PIN 45 | self.width = EPD_WIDTH 46 | self.height = EPD_HEIGHT 47 | 48 | # Hardware reset 49 | def reset(self): 50 | epdconfig.digital_write(self.reset_pin, 1) 51 | epdconfig.delay_ms(200) 52 | epdconfig.digital_write(self.reset_pin, 0) 53 | epdconfig.delay_ms(5) 54 | epdconfig.digital_write(self.reset_pin, 1) 55 | epdconfig.delay_ms(200) 56 | 57 | def send_command(self, command): 58 | epdconfig.digital_write(self.dc_pin, 0) 59 | epdconfig.digital_write(self.cs_pin, 0) 60 | epdconfig.spi_writebyte([command]) 61 | epdconfig.digital_write(self.cs_pin, 1) 62 | 63 | def send_data(self, data): 64 | epdconfig.digital_write(self.dc_pin, 1) 65 | epdconfig.digital_write(self.cs_pin, 0) 66 | epdconfig.spi_writebyte([data]) 67 | epdconfig.digital_write(self.cs_pin, 1) 68 | 69 | def ReadBusy(self): 70 | logger.debug("e-Paper busy") 71 | while(epdconfig.digital_read(self.busy_pin) == 0): # 0: idle, 1: busy 72 | epdconfig.delay_ms(100) 73 | logger.debug("e-Paper busy release") 74 | 75 | def init(self): 76 | if (epdconfig.module_init() != 0): 77 | return -1 78 | 79 | self.reset() 80 | 81 | self.send_command(0x06) # BOOSTER_SOFT_START 82 | self.send_data(0x17) 83 | self.send_data(0x17) 84 | self.send_data(0x17) 85 | 86 | self.send_command(0x04) # POWER_ON 87 | self.ReadBusy() 88 | 89 | self.send_command(0x00) # PANEL_SETTING 90 | self.send_data(0x8F) 91 | 92 | self.send_command(0x50) # VCOM_AND_DATA_INTERVAL_SETTING 93 | self.send_data(0xF0) 94 | 95 | self.send_command(0x61) # RESOLUTION_SETTING 96 | self.send_data(self.width & 0xff) 97 | self.send_data(self.height >> 8) 98 | self.send_data(self.height & 0xff) 99 | return 0 100 | 101 | def getbuffer(self, image): 102 | # logger.debug("bufsiz = ",int(self.width/8) * self.height) 103 | buf = [0xFF] * (int(self.width/8) * self.height) 104 | image_monocolor = image.convert('1') 105 | imwidth, imheight = image_monocolor.size 106 | pixels = image_monocolor.load() 107 | # logger.debug("imwidth = %d, imheight = %d",imwidth,imheight) 108 | if(imwidth == self.width and imheight == self.height): 109 | logger.debug("Vertical") 110 | for y in range(imheight): 111 | for x in range(imwidth): 112 | # Set the bits for the column of pixels at the current position. 113 | if pixels[x, y] == 0: 114 | buf[int((x + y * self.width) / 8)] &= ~(0x80 >> (x % 8)) 115 | elif(imwidth == self.height and imheight == self.width): 116 | logger.debug("Horizontal") 117 | for y in range(imheight): 118 | for x in range(imwidth): 119 | newx = y 120 | newy = self.height - x - 1 121 | if pixels[x, y] == 0: 122 | buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8)) 123 | return buf 124 | 125 | def display(self, imageblack, imagered): 126 | self.send_command(0x10) 127 | for i in range(0, int(self.width * self.height / 8)): 128 | self.send_data(imageblack[i]) 129 | # self.send_command(0x92) 130 | 131 | self.send_command(0x13) 132 | for i in range(0, int(self.width * self.height / 8)): 133 | self.send_data(imagered[i]) 134 | # self.send_command(0x92) 135 | 136 | self.send_command(0x12) # REFRESH 137 | self.ReadBusy() 138 | 139 | def Clear(self): 140 | self.send_command(0x10) 141 | for i in range(0, int(self.width * self.height / 8)): 142 | self.send_data(0xFF) 143 | self.send_command(0x92) 144 | 145 | self.send_command(0x13) 146 | for i in range(0, int(self.width * self.height / 8)): 147 | self.send_data(0xFF) 148 | self.send_command(0x92) 149 | 150 | self.send_command(0x12) # REFRESH 151 | self.ReadBusy() 152 | 153 | def sleep(self): 154 | self.send_command(0x02) # POWER_OFF 155 | self.ReadBusy() 156 | self.send_command(0x07) # DEEP_SLEEP 157 | self.send_data(0xA5) # check code 158 | 159 | epdconfig.delay_ms(2000) 160 | epdconfig.module_exit() 161 | ### END OF FILE ### 162 | 163 | -------------------------------------------------------------------------------- /lib/epd2in66b.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd2in66b.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V1.0 8 | # * | Date : 2020-12-01 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | import logging 31 | from . import epdconfig 32 | 33 | # Display resolution 34 | EPD_WIDTH = 152 35 | EPD_HEIGHT = 296 36 | 37 | logger = logging.getLogger(__name__) 38 | 39 | class EPD: 40 | def __init__(self): 41 | self.reset_pin = epdconfig.RST_PIN 42 | self.dc_pin = epdconfig.DC_PIN 43 | self.busy_pin = epdconfig.BUSY_PIN 44 | self.cs_pin = epdconfig.CS_PIN 45 | self.width = EPD_WIDTH 46 | self.height = EPD_HEIGHT 47 | 48 | # Hardware reset 49 | def reset(self): 50 | epdconfig.digital_write(self.reset_pin, 1) 51 | epdconfig.delay_ms(200) 52 | epdconfig.digital_write(self.reset_pin, 0) 53 | epdconfig.delay_ms(5) 54 | epdconfig.digital_write(self.reset_pin, 1) 55 | epdconfig.delay_ms(200) 56 | 57 | 58 | def send_command(self, command): 59 | epdconfig.digital_write(self.dc_pin, 0) 60 | epdconfig.digital_write(self.cs_pin, 0) 61 | epdconfig.spi_writebyte([command]) 62 | epdconfig.digital_write(self.cs_pin, 1) 63 | 64 | 65 | def send_data(self, data): 66 | epdconfig.digital_write(self.dc_pin, 1) 67 | epdconfig.digital_write(self.cs_pin, 0) 68 | epdconfig.spi_writebyte([data]) 69 | epdconfig.digital_write(self.cs_pin, 1) 70 | 71 | 72 | def ReadBusy(self): 73 | logger.debug("e-Paper busy") 74 | while(epdconfig.digital_read(self.busy_pin) == 1): # 0: idle, 1: busy 75 | epdconfig.delay_ms(20) 76 | logger.debug("e-Paper busy release") 77 | 78 | 79 | def init(self): 80 | if (epdconfig.module_init() != 0): 81 | return -1 82 | # EPD hardware init start 83 | self.reset() 84 | 85 | self.send_command(0x12) 86 | epdconfig.delay_ms(30) 87 | self.ReadBusy() 88 | 89 | self.send_command(0x11) # setting gaet number 90 | self.send_data(0x03) 91 | 92 | self.setWindows(0, 0, self.width-1, self.height-1) 93 | 94 | self.send_command(0x21) 95 | self.send_data(0x00) 96 | self.send_data(0x80) 97 | 98 | self.setCursor(0, 0) 99 | self.ReadBusy() 100 | 101 | return 0 102 | 103 | def setWindows(self, Xstart, Ystart, Xend, Yend): 104 | self.send_command(0x44) # SET_RAM_X_ADDRESS_START_END_POSITION 105 | self.send_data((Xstart>>3) & 0x1F) 106 | self.send_data((Xend>>3) & 0x1F) 107 | 108 | self.send_command(0x45) # SET_RAM_Y_ADDRESS_START_END_POSITION 109 | self.send_data(Ystart & 0xFF) 110 | self.send_data((Ystart >> 8) & 0x01) 111 | self.send_data(Yend & 0xFF) 112 | self.send_data((Yend >> 8) & 0x01) 113 | 114 | def setCursor(self, Xstart, Ystart): 115 | self.send_command(0x4E) # SET_RAM_X_ADDRESS_COUNTER 116 | self.send_data(Xstart & 0x1F) 117 | 118 | self.send_command(0x4F) # SET_RAM_Y_ADDRESS_COUNTER 119 | self.send_data(Ystart & 0xFF) 120 | self.send_data((Ystart >> 8) & 0x01) 121 | 122 | def turnon_display(self): 123 | self.send_command(0x20) 124 | self.ReadBusy() 125 | 126 | def getbuffer(self, image): 127 | # logger.debug("bufsiz = ",int(self.width/8) * self.height) 128 | buf = [0xFF] * (int(self.width/8) * self.height) 129 | image_monocolor = image.convert('1') 130 | imwidth, imheight = image_monocolor.size 131 | pixels = image_monocolor.load() 132 | # logger.debug("imwidth = %d, imheight = %d",imwidth,imheight) 133 | if(imwidth == self.width and imheight == self.height): 134 | logger.debug("Vertical") 135 | for y in range(imheight): 136 | for x in range(imwidth): 137 | # Set the bits for the column of pixels at the current position. 138 | if pixels[x, y] == 0: 139 | buf[int((x + y * self.width) / 8)] &= ~(0x80 >> (x % 8)) 140 | elif(imwidth == self.height and imheight == self.width): 141 | logger.debug("Horizontal") 142 | for y in range(imheight): 143 | for x in range(imwidth): 144 | newx = y 145 | newy = self.height - x - 1 146 | if pixels[x, y] == 0: 147 | buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8)) 148 | return buf 149 | 150 | def display(self, Blackimage, Redimage): 151 | if (Blackimage == None or Redimage == None): 152 | return 153 | self.send_command(0x24) 154 | for j in range(0, self.height): 155 | for i in range(0, int(self.width / 8)): 156 | self.send_data(Blackimage[i + j * int(self.width / 8)]) 157 | 158 | self.send_command(0x26) 159 | for j in range(0, self.height): 160 | for i in range(0, int(self.width / 8)): 161 | self.send_data(~Redimage[i + j * int(self.width / 8)]) 162 | 163 | self.turnon_display() 164 | 165 | 166 | def Clear(self): 167 | self.send_command(0x24) 168 | for j in range(0, self.height): 169 | for i in range(0, int(self.width / 8)): 170 | self.send_data(0xff) 171 | 172 | self.send_command(0x26) 173 | for j in range(0, self.height): 174 | for i in range(0, int(self.width / 8)): 175 | self.send_data(0x00) 176 | 177 | self.turnon_display() 178 | 179 | 180 | def sleep(self): 181 | self.send_command(0X10) # DEEP_SLEEP_MODE 182 | self.send_data(0x01) 183 | 184 | epdconfig.delay_ms(2000) 185 | epdconfig.module_exit() 186 | 187 | ### END OF FILE ### 188 | 189 | -------------------------------------------------------------------------------- /lib/epd2in7b_V2.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd2in7b_V2.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V1.0 8 | # * | Date : 2020-10-22 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | 31 | import logging 32 | from . import epdconfig 33 | 34 | # Display resolution 35 | EPD_WIDTH = 176 36 | EPD_HEIGHT = 264 37 | 38 | logger = logging.getLogger(__name__) 39 | 40 | class EPD: 41 | def __init__(self): 42 | self.reset_pin = epdconfig.RST_PIN 43 | self.dc_pin = epdconfig.DC_PIN 44 | self.busy_pin = epdconfig.BUSY_PIN 45 | self.cs_pin = epdconfig.CS_PIN 46 | self.width = EPD_WIDTH 47 | self.height = EPD_HEIGHT 48 | 49 | # Hardware reset 50 | def reset(self): 51 | epdconfig.digital_write(self.reset_pin, 1) 52 | epdconfig.delay_ms(200) 53 | epdconfig.digital_write(self.reset_pin, 0) 54 | epdconfig.delay_ms(2) 55 | epdconfig.digital_write(self.reset_pin, 1) 56 | epdconfig.delay_ms(200) 57 | 58 | # Send Command 59 | def send_command(self, command): 60 | epdconfig.digital_write(self.dc_pin, 0) 61 | epdconfig.digital_write(self.cs_pin, 0) 62 | epdconfig.spi_writebyte([command]) 63 | epdconfig.digital_write(self.cs_pin, 1) 64 | 65 | # Send Data 66 | def send_data(self, data): 67 | epdconfig.digital_write(self.dc_pin, 1) 68 | epdconfig.digital_write(self.cs_pin, 0) 69 | epdconfig.spi_writebyte([data]) 70 | epdconfig.digital_write(self.cs_pin, 1) 71 | 72 | # Read Busy 73 | def ReadBusy(self): 74 | logger.debug("e-Paper busy") 75 | while(epdconfig.digital_read(self.busy_pin) == 1): # 0: idle, 1: busy 76 | epdconfig.delay_ms(10) 77 | logger.debug("e-Paper busy release") 78 | 79 | # Setting the display window 80 | def SetWindows(self, Xstart, Ystart, Xend, Yend): 81 | self.send_command(0x44) 82 | self.send_data((Xstart >> 3) & 0xff) 83 | self.send_data((Xend >> 3) & 0xff) 84 | 85 | self.send_command(0x45) 86 | self.send_data(Ystart & 0xff) 87 | self.send_data((Ystart >> 8) & 0xff) 88 | self.send_data(Yend & 0xff) 89 | self.send_data((Yend >> 8) & 0xff) 90 | 91 | # Set Cursor 92 | def SetCursor(self, Xstart, Ystart): 93 | self.send_command(0x4E) 94 | self.send_data(Xstart & 0xff) 95 | self.send_command(0x4F) 96 | self.send_data(Ystart & 0xff) 97 | self.send_data((Ystart >> 8) & 0xff) 98 | 99 | # Initialize the e-Paper register 100 | def init(self): 101 | if (epdconfig.module_init() != 0): 102 | return -1 103 | 104 | self.reset() 105 | 106 | self.ReadBusy() 107 | self.send_command(0x12) 108 | self.ReadBusy() 109 | 110 | self.send_command(0x00) 111 | self.send_data(0x27) 112 | self.send_data(0x01) 113 | self.send_data(0x00) 114 | 115 | self.send_command(0x11) 116 | self.send_data(0x03) 117 | 118 | self.SetWindows(0, 0, self.width-1, self.height-1) 119 | self.SetCursor(0, 0) 120 | return 0 121 | 122 | def getbuffer(self, image): 123 | # logger.debug("bufsiz = ",int(self.width/8) * self.height) 124 | buf = [0xFF] * (int(self.width/8) * self.height) 125 | image_monocolor = image.convert('1') 126 | imwidth, imheight = image_monocolor.size 127 | pixels = image_monocolor.load() 128 | # logger.debug("imwidth = %d, imheight = %d",imwidth,imheight) 129 | if(imwidth == self.width and imheight == self.height): 130 | logger.debug("Vertical") 131 | for y in range(imheight): 132 | for x in range(imwidth): 133 | # Set the bits for the column of pixels at the current position. 134 | if pixels[x, y] == 0: 135 | buf[int((x + y * self.width) / 8)] &= ~(0x80 >> (x % 8)) 136 | elif(imwidth == self.height and imheight == self.width): 137 | logger.debug("Horizontal") 138 | for y in range(imheight): 139 | for x in range(imwidth): 140 | newx = y 141 | newy = self.height - x - 1 142 | if pixels[x, y] == 0: 143 | buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8)) 144 | return buf 145 | 146 | # Sends the image buffer in RAM to e-Paper and displays 147 | def display(self, imageblack, imagered): 148 | Width = self.width / 8 149 | Height = self.height 150 | 151 | self.send_command(0x24) 152 | for i in range(0, int(Width * Height)): 153 | self.send_data(imageblack[i]) 154 | 155 | self.send_command(0x26) 156 | for i in range(0, int(Width * Height)): 157 | self.send_data(~imagered[i]) 158 | 159 | self.TurnOnDisplay() 160 | 161 | # Clear the screen 162 | def Clear(self): 163 | self.send_command(0x24) 164 | for i in range(0, int(self.width * self.height / 8)): 165 | self.send_data(0xff) 166 | 167 | self.send_command(0x26) 168 | for i in range(0, int(self.width * self.height / 8)): 169 | self.send_data(0x00) 170 | 171 | self.TurnOnDisplay() 172 | 173 | # Turn on display 174 | def TurnOnDisplay(self): 175 | self.send_command(0x20) 176 | self.ReadBusy() 177 | 178 | # Enter sleep mode 179 | def sleep(self): 180 | self.send_command(0x10) 181 | self.send_data(0x01) 182 | 183 | epdconfig.delay_ms(2000) 184 | epdconfig.module_exit() 185 | ### END OF FILE ### 186 | 187 | -------------------------------------------------------------------------------- /lib/epd2in9b_V3.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd2in9b_V3.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V1.1 8 | # * | Date : 2020-12-03 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | 31 | import logging 32 | from . import epdconfig 33 | 34 | # Display resolution 35 | EPD_WIDTH = 128 36 | EPD_HEIGHT = 296 37 | 38 | logger = logging.getLogger(__name__) 39 | 40 | class EPD: 41 | def __init__(self): 42 | self.reset_pin = epdconfig.RST_PIN 43 | self.dc_pin = epdconfig.DC_PIN 44 | self.busy_pin = epdconfig.BUSY_PIN 45 | self.cs_pin = epdconfig.CS_PIN 46 | self.width = EPD_WIDTH 47 | self.height = EPD_HEIGHT 48 | 49 | # Hardware reset 50 | def reset(self): 51 | epdconfig.digital_write(self.reset_pin, 1) 52 | epdconfig.delay_ms(200) 53 | epdconfig.digital_write(self.reset_pin, 0) 54 | epdconfig.delay_ms(2) 55 | epdconfig.digital_write(self.reset_pin, 1) 56 | epdconfig.delay_ms(200) 57 | 58 | def send_command(self, command): 59 | epdconfig.digital_write(self.dc_pin, 0) 60 | epdconfig.digital_write(self.cs_pin, 0) 61 | epdconfig.spi_writebyte([command]) 62 | epdconfig.digital_write(self.cs_pin, 1) 63 | 64 | def send_data(self, data): 65 | epdconfig.digital_write(self.dc_pin, 1) 66 | epdconfig.digital_write(self.cs_pin, 0) 67 | epdconfig.spi_writebyte([data]) 68 | epdconfig.digital_write(self.cs_pin, 1) 69 | 70 | def ReadBusy(self): 71 | logger.debug("e-Paper busy") 72 | self.send_command(0X71) 73 | while(epdconfig.digital_read(self.busy_pin) == 0): # 0: idle, 1: busy 74 | self.send_command(0X71) 75 | epdconfig.delay_ms(200) 76 | logger.debug("e-Paper busy release") 77 | 78 | def init(self): 79 | if (epdconfig.module_init() != 0): 80 | return -1 81 | # EPD hardware init start 82 | self.reset() 83 | 84 | self.send_command(0x04) 85 | self.ReadBusy()#waiting for the electronic paper IC to release the idle signal 86 | 87 | self.send_command(0x00) #panel setting 88 | self.send_data(0x0f) #LUT from OTP,128x296 89 | self.send_data(0x89) #Temperature sensor, boost and other related timing settings 90 | 91 | self.send_command(0x61) #resolution setting 92 | self.send_data (0x80) 93 | self.send_data (0x01) 94 | self.send_data (0x28) 95 | 96 | self.send_command(0X50) #VCOM AND DATA INTERVAL SETTING 97 | self.send_data(0x77) #WBmode:VBDF 17|D7 VBDW 97 VBDB 57 98 | # WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7 99 | 100 | return 0 101 | 102 | def getbuffer(self, image): 103 | # logger.debug("bufsiz = ",int(self.width/8) * self.height) 104 | buf = [0xFF] * (int(self.width/8) * self.height) 105 | image_monocolor = image.convert('1') 106 | imwidth, imheight = image_monocolor.size 107 | pixels = image_monocolor.load() 108 | # logger.debug("imwidth = %d, imheight = %d",imwidth,imheight) 109 | if(imwidth == self.width and imheight == self.height): 110 | logger.debug("Vertical") 111 | for y in range(imheight): 112 | for x in range(imwidth): 113 | # Set the bits for the column of pixels at the current position. 114 | if pixels[x, y] == 0: 115 | buf[int((x + y * self.width) / 8)] &= ~(0x80 >> (x % 8)) 116 | elif(imwidth == self.height and imheight == self.width): 117 | logger.debug("Horizontal") 118 | for y in range(imheight): 119 | for x in range(imwidth): 120 | newx = y 121 | newy = self.height - x - 1 122 | if pixels[x, y] == 0: 123 | buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8)) 124 | return buf 125 | 126 | def display(self, blackimage, ryimage): # ryimage: red or yellow image 127 | if (blackimage != None): 128 | self.send_command(0X10) 129 | for i in range(0, int(self.width * self.height / 8)): 130 | self.send_data(blackimage[i]) 131 | if (ryimage != None): 132 | self.send_command(0X13) 133 | for i in range(0, int(self.width * self.height / 8)): 134 | self.send_data(ryimage[i]) 135 | 136 | self.send_command(0x12) 137 | epdconfig.delay_ms(200) 138 | self.ReadBusy() 139 | 140 | def Clear(self): 141 | self.send_command(0X10) 142 | for i in range(0, int(self.width * self.height / 8)): 143 | self.send_data(0xff) 144 | self.send_command(0X13) 145 | for i in range(0, int(self.width * self.height / 8)): 146 | self.send_data(0xff) 147 | 148 | self.send_command(0x12) 149 | epdconfig.delay_ms(200) 150 | self.ReadBusy() 151 | 152 | def sleep(self): 153 | self.send_command(0X02) # power off 154 | self.ReadBusy() 155 | self.send_command(0X07) # deep sleep 156 | self.send_data(0xA5) 157 | 158 | epdconfig.delay_ms(2000) 159 | epdconfig.module_exit() 160 | ### END OF FILE ### 161 | 162 | -------------------------------------------------------------------------------- /lib/epd2in9bc.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd2in9bc.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V4.0 8 | # * | Date : 2019-06-20 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | 31 | import logging 32 | from . import epdconfig 33 | 34 | # Display resolution 35 | EPD_WIDTH = 128 36 | EPD_HEIGHT = 296 37 | 38 | logger = logging.getLogger(__name__) 39 | 40 | class EPD: 41 | def __init__(self): 42 | self.reset_pin = epdconfig.RST_PIN 43 | self.dc_pin = epdconfig.DC_PIN 44 | self.busy_pin = epdconfig.BUSY_PIN 45 | self.cs_pin = epdconfig.CS_PIN 46 | self.width = EPD_WIDTH 47 | self.height = EPD_HEIGHT 48 | 49 | # Hardware reset 50 | def reset(self): 51 | epdconfig.digital_write(self.reset_pin, 1) 52 | epdconfig.delay_ms(200) 53 | epdconfig.digital_write(self.reset_pin, 0) 54 | epdconfig.delay_ms(5) 55 | epdconfig.digital_write(self.reset_pin, 1) 56 | epdconfig.delay_ms(200) 57 | 58 | def send_command(self, command): 59 | epdconfig.digital_write(self.dc_pin, 0) 60 | epdconfig.digital_write(self.cs_pin, 0) 61 | epdconfig.spi_writebyte([command]) 62 | epdconfig.digital_write(self.cs_pin, 1) 63 | 64 | def send_data(self, data): 65 | epdconfig.digital_write(self.dc_pin, 1) 66 | epdconfig.digital_write(self.cs_pin, 0) 67 | epdconfig.spi_writebyte([data]) 68 | epdconfig.digital_write(self.cs_pin, 1) 69 | 70 | def ReadBusy(self): 71 | logger.debug("e-Paper busy") 72 | while(epdconfig.digital_read(self.busy_pin) == 0): # 0: idle, 1: busy 73 | epdconfig.delay_ms(200) 74 | logger.debug("e-Paper busy release") 75 | 76 | def init(self): 77 | if (epdconfig.module_init() != 0): 78 | return -1 79 | # EPD hardware init start 80 | self.reset() 81 | 82 | self.send_command(0x06) # boost 83 | self.send_data (0x17) 84 | self.send_data (0x17) 85 | self.send_data (0x17) 86 | self.send_command(0x04) # POWER_ON 87 | self.ReadBusy() 88 | self.send_command(0X00) # PANEL_SETTING 89 | self.send_data(0x8F) 90 | self.send_command(0X50) # VCOM_AND_DATA_INTERVAL_SETTING 91 | self.send_data(0x77) 92 | self.send_command(0x61) # TCON_RESOLUTION 93 | self.send_data (0x80) 94 | self.send_data (0x01) 95 | self.send_data (0x28) 96 | # self.send_command(VCM_DC_SETTING_REGISTER) 97 | # self.send_data (0x0A) 98 | 99 | return 0 100 | 101 | def getbuffer(self, image): 102 | # logger.debug("bufsiz = ",int(self.width/8) * self.height) 103 | buf = [0xFF] * (int(self.width/8) * self.height) 104 | image_monocolor = image.convert('1') 105 | imwidth, imheight = image_monocolor.size 106 | pixels = image_monocolor.load() 107 | # logger.debug("imwidth = %d, imheight = %d",imwidth,imheight) 108 | if(imwidth == self.width and imheight == self.height): 109 | logger.debug("Vertical") 110 | for y in range(imheight): 111 | for x in range(imwidth): 112 | # Set the bits for the column of pixels at the current position. 113 | if pixels[x, y] == 0: 114 | buf[int((x + y * self.width) / 8)] &= ~(0x80 >> (x % 8)) 115 | elif(imwidth == self.height and imheight == self.width): 116 | logger.debug("Horizontal") 117 | for y in range(imheight): 118 | for x in range(imwidth): 119 | newx = y 120 | newy = self.height - x - 1 121 | if pixels[x, y] == 0: 122 | buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8)) 123 | return buf 124 | 125 | def display(self, blackimage, ryimage): # ryimage: red or yellow image 126 | if (blackimage != None): 127 | self.send_command(0X10) 128 | for i in range(0, int(self.width * self.height / 8)): 129 | self.send_data(blackimage[i]) 130 | if (ryimage != None): 131 | self.send_command(0X13) 132 | for i in range(0, int(self.width * self.height / 8)): 133 | self.send_data(ryimage[i]) 134 | 135 | self.send_command(0x12) 136 | self.ReadBusy() 137 | 138 | def Clear(self): 139 | self.send_command(0X10) 140 | for i in range(0, int(self.width * self.height / 8)): 141 | self.send_data(0xff) 142 | self.send_command(0X13) 143 | for i in range(0, int(self.width * self.height / 8)): 144 | self.send_data(0xff) 145 | 146 | self.send_command(0x12) 147 | self.ReadBusy() 148 | 149 | def sleep(self): 150 | self.send_command(0X02) # power off 151 | self.ReadBusy() 152 | self.send_command(0X07) # deep sleep 153 | self.send_data(0xA5) 154 | 155 | epdconfig.delay_ms(2000) 156 | epdconfig.module_exit() 157 | ### END OF FILE ### 158 | 159 | -------------------------------------------------------------------------------- /lib/epd4in2b_V2.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd4in2bc.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V4.0 8 | # * | Date : 2019-06-20 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | import logging 31 | from . import epdconfig 32 | 33 | # Display resolution 34 | EPD_WIDTH = 400 35 | EPD_HEIGHT = 300 36 | 37 | logger = logging.getLogger(__name__) 38 | 39 | class EPD: 40 | def __init__(self): 41 | self.reset_pin = epdconfig.RST_PIN 42 | self.dc_pin = epdconfig.DC_PIN 43 | self.busy_pin = epdconfig.BUSY_PIN 44 | self.cs_pin = epdconfig.CS_PIN 45 | self.width = EPD_WIDTH 46 | self.height = EPD_HEIGHT 47 | 48 | # Hardware reset 49 | def reset(self): 50 | epdconfig.digital_write(self.reset_pin, 1) 51 | epdconfig.delay_ms(200) 52 | epdconfig.digital_write(self.reset_pin, 0) 53 | epdconfig.delay_ms(5) 54 | epdconfig.digital_write(self.reset_pin, 1) 55 | epdconfig.delay_ms(200) 56 | 57 | def send_command(self, command): 58 | epdconfig.digital_write(self.dc_pin, 0) 59 | epdconfig.digital_write(self.cs_pin, 0) 60 | epdconfig.spi_writebyte([command]) 61 | epdconfig.digital_write(self.cs_pin, 1) 62 | 63 | def send_data(self, data): 64 | epdconfig.digital_write(self.dc_pin, 1) 65 | epdconfig.digital_write(self.cs_pin, 0) 66 | epdconfig.spi_writebyte([data]) 67 | epdconfig.digital_write(self.cs_pin, 1) 68 | 69 | def ReadBusy(self): 70 | logger.debug("e-Paper busy") 71 | self.send_command(0x71); 72 | while(epdconfig.digital_read(self.busy_pin) == 0): # 0: idle, 1: busy 73 | self.send_command(0x71); 74 | epdconfig.delay_ms(20) 75 | logger.debug("e-Paper busy release") 76 | 77 | def init(self): 78 | if (epdconfig.module_init() != 0): 79 | return -1 80 | 81 | self.reset() 82 | 83 | self.send_command(0x04); 84 | self.ReadBusy(); 85 | 86 | self.send_command(0x00); 87 | self.send_data(0x0f); 88 | 89 | return 0 90 | 91 | def getbuffer(self, image): 92 | # logger.debug("bufsiz = ",int(self.width/8) * self.height) 93 | buf = [0xFF] * (int(self.width/8) * self.height) 94 | image_monocolor = image.convert('1') 95 | imwidth, imheight = image_monocolor.size 96 | pixels = image_monocolor.load() 97 | # logger.debug("imwidth = %d, imheight = %d",imwidth,imheight) 98 | if(imwidth == self.width and imheight == self.height): 99 | logger.debug("Horizontal") 100 | for y in range(imheight): 101 | for x in range(imwidth): 102 | # Set the bits for the column of pixels at the current position. 103 | if pixels[x, y] == 0: 104 | buf[int((x + y * self.width) / 8)] &= ~(0x80 >> (x % 8)) 105 | elif(imwidth == self.height and imheight == self.width): 106 | logger.debug("Vertical") 107 | for y in range(imheight): 108 | for x in range(imwidth): 109 | newx = y 110 | newy = self.height - x - 1 111 | if pixels[x, y] == 0: 112 | buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8)) 113 | return buf 114 | 115 | def display(self, imageblack, imagered): 116 | self.send_command(0x10) 117 | for i in range(0, int(self.width * self.height / 8)): 118 | self.send_data(imageblack[i]) 119 | 120 | self.send_command(0x13) 121 | for i in range(0, int(self.width * self.height / 8)): 122 | self.send_data(imagered[i]) 123 | 124 | self.send_command(0x12) 125 | epdconfig.delay_ms(20) 126 | self.ReadBusy() 127 | 128 | def Clear(self): 129 | self.send_command(0x10) 130 | for i in range(0, int(self.width * self.height / 8)): 131 | self.send_data(0xFF) 132 | 133 | self.send_command(0x13) 134 | for i in range(0, int(self.width * self.height / 8)): 135 | self.send_data(0xFF) 136 | 137 | self.send_command(0x12) 138 | epdconfig.delay_ms(20) 139 | self.ReadBusy() 140 | 141 | def sleep(self): 142 | self.send_command(0X50); 143 | self.send_data(0xf7); #border floating 144 | 145 | self.send_command(0X02); #power off 146 | self.ReadBusy(); #waiting for the electronic paper IC to release the idle signal 147 | self.send_command(0X07); #deep sleep 148 | self.send_data(0xA5); 149 | 150 | epdconfig.delay_ms(2000) 151 | epdconfig.module_exit() 152 | ### END OF FILE ### 153 | 154 | -------------------------------------------------------------------------------- /lib/epd4in2bc.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd4in2bc.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V4.0 8 | # * | Date : 2019-06-20 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | import logging 31 | from . import epdconfig 32 | 33 | # Display resolution 34 | EPD_WIDTH = 400 35 | EPD_HEIGHT = 300 36 | 37 | logger = logging.getLogger(__name__) 38 | 39 | class EPD: 40 | def __init__(self): 41 | self.reset_pin = epdconfig.RST_PIN 42 | self.dc_pin = epdconfig.DC_PIN 43 | self.busy_pin = epdconfig.BUSY_PIN 44 | self.cs_pin = epdconfig.CS_PIN 45 | self.width = EPD_WIDTH 46 | self.height = EPD_HEIGHT 47 | 48 | # Hardware reset 49 | def reset(self): 50 | epdconfig.digital_write(self.reset_pin, 1) 51 | epdconfig.delay_ms(200) 52 | epdconfig.digital_write(self.reset_pin, 0) 53 | epdconfig.delay_ms(5) 54 | epdconfig.digital_write(self.reset_pin, 1) 55 | epdconfig.delay_ms(200) 56 | 57 | def send_command(self, command): 58 | epdconfig.digital_write(self.dc_pin, 0) 59 | epdconfig.digital_write(self.cs_pin, 0) 60 | epdconfig.spi_writebyte([command]) 61 | epdconfig.digital_write(self.cs_pin, 1) 62 | 63 | def send_data(self, data): 64 | epdconfig.digital_write(self.dc_pin, 1) 65 | epdconfig.digital_write(self.cs_pin, 0) 66 | epdconfig.spi_writebyte([data]) 67 | epdconfig.digital_write(self.cs_pin, 1) 68 | 69 | def ReadBusy(self): 70 | logger.debug("e-Paper busy") 71 | while(epdconfig.digital_read(self.busy_pin) == 0): # 0: idle, 1: busy 72 | epdconfig.delay_ms(100) 73 | logger.debug("e-Paper busy release") 74 | 75 | def init(self): 76 | if (epdconfig.module_init() != 0): 77 | return -1 78 | 79 | self.reset() 80 | 81 | self.send_command(0x06) # BOOSTER_SOFT_START 82 | self.send_data (0x17) 83 | self.send_data (0x17) 84 | self.send_data (0x17) # 07 0f 17 1f 27 2F 37 2f 85 | 86 | self.send_command(0x04) # POWER_ON 87 | self.ReadBusy() 88 | 89 | self.send_command(0x00) # PANEL_SETTING 90 | self.send_data(0x0F) # LUT from OTP 91 | 92 | return 0 93 | 94 | def getbuffer(self, image): 95 | # logger.debug("bufsiz = ",int(self.width/8) * self.height) 96 | buf = [0xFF] * (int(self.width/8) * self.height) 97 | image_monocolor = image.convert('1') 98 | imwidth, imheight = image_monocolor.size 99 | pixels = image_monocolor.load() 100 | # logger.debug("imwidth = %d, imheight = %d",imwidth,imheight) 101 | if(imwidth == self.width and imheight == self.height): 102 | logger.debug("Horizontal") 103 | for y in range(imheight): 104 | for x in range(imwidth): 105 | # Set the bits for the column of pixels at the current position. 106 | if pixels[x, y] == 0: 107 | buf[int((x + y * self.width) / 8)] &= ~(0x80 >> (x % 8)) 108 | elif(imwidth == self.height and imheight == self.width): 109 | logger.debug("Vertical") 110 | for y in range(imheight): 111 | for x in range(imwidth): 112 | newx = y 113 | newy = self.height - x - 1 114 | if pixels[x, y] == 0: 115 | buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8)) 116 | return buf 117 | 118 | def display(self, imageblack, imagered): 119 | self.send_command(0x10) 120 | for i in range(0, int(self.width * self.height / 8)): 121 | self.send_data(imageblack[i]) 122 | 123 | self.send_command(0x13) 124 | for i in range(0, int(self.width * self.height / 8)): 125 | self.send_data(imagered[i]) 126 | 127 | self.send_command(0x12) 128 | self.ReadBusy() 129 | 130 | def Clear(self): 131 | self.send_command(0x10) 132 | for i in range(0, int(self.width * self.height / 8)): 133 | self.send_data(0xFF) 134 | 135 | self.send_command(0x13) 136 | for i in range(0, int(self.width * self.height / 8)): 137 | self.send_data(0xFF) 138 | 139 | self.send_command(0x12) 140 | self.ReadBusy() 141 | 142 | def sleep(self): 143 | self.send_command(0x02) # POWER_OFF 144 | self.ReadBusy() 145 | self.send_command(0x07) # DEEP_SLEEP 146 | self.send_data(0xA5) # check code 147 | 148 | epdconfig.delay_ms(2000) 149 | epdconfig.module_exit() 150 | ### END OF FILE ### 151 | 152 | -------------------------------------------------------------------------------- /lib/epd5in65f.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | # ***************************************************************************** 4 | # * | File : epd5in65f.py 5 | # * | Author : Waveshare team 6 | # * | Function : Electronic paper driver 7 | # * | Info : 8 | # *---------------- 9 | # * | This version: V1.0 10 | # * | Date : 2020-03-02 11 | # # | Info : python demo 12 | # ----------------------------------------------------------------------------- 13 | # Permission is hereby granted, free of charge, to any person obtaining a copy 14 | # of this software and associated documnetation files (the "Software"), to deal 15 | # in the Software without restriction, including without limitation the rights 16 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | # copies of the Software, and to permit persons to whom the Software is 18 | # furished to do so, subject to the following conditions: 19 | # 20 | # The above copyright notice and this permission notice shall be included in 21 | # all copies or substantial portions of the Software. 22 | # 23 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | # FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | # LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | # THE SOFTWARE. 30 | # 31 | 32 | import logging 33 | from . import epdconfig 34 | 35 | import PIL 36 | from PIL import Image 37 | import io 38 | 39 | # Display resolution 40 | EPD_WIDTH = 600 41 | EPD_HEIGHT = 448 42 | 43 | logger = logging.getLogger(__name__) 44 | 45 | class EPD: 46 | def __init__(self): 47 | self.reset_pin = epdconfig.RST_PIN 48 | self.dc_pin = epdconfig.DC_PIN 49 | self.busy_pin = epdconfig.BUSY_PIN 50 | self.cs_pin = epdconfig.CS_PIN 51 | self.width = EPD_WIDTH 52 | self.height = EPD_HEIGHT 53 | self.BLACK = 0x000000 # 0000 BGR 54 | self.WHITE = 0xffffff # 0001 55 | self.GREEN = 0x00ff00 # 0010 56 | self.BLUE = 0xff0000 # 0011 57 | self.RED = 0x0000ff # 0100 58 | self.YELLOW = 0x00ffff # 0101 59 | self.ORANGE = 0x0080ff # 0110 60 | 61 | 62 | # Hardware reset 63 | def reset(self): 64 | epdconfig.digital_write(self.reset_pin, 1) 65 | epdconfig.delay_ms(600) 66 | epdconfig.digital_write(self.reset_pin, 0) 67 | epdconfig.delay_ms(2) 68 | epdconfig.digital_write(self.reset_pin, 1) 69 | epdconfig.delay_ms(200) 70 | 71 | def send_command(self, command): 72 | epdconfig.digital_write(self.dc_pin, 0) 73 | epdconfig.digital_write(self.cs_pin, 0) 74 | epdconfig.spi_writebyte([command]) 75 | epdconfig.digital_write(self.cs_pin, 1) 76 | 77 | def send_data(self, data): 78 | epdconfig.digital_write(self.dc_pin, 1) 79 | epdconfig.digital_write(self.cs_pin, 0) 80 | epdconfig.spi_writebyte([data]) 81 | epdconfig.digital_write(self.cs_pin, 1) 82 | 83 | def send_data_bulk(self, data): 84 | epdconfig.digital_write(self.dc_pin, 1) 85 | epdconfig.digital_write(self.cs_pin, 0) 86 | epdconfig.spi_writebyte2(data) 87 | epdconfig.digital_write(self.cs_pin, 1) 88 | 89 | def ReadBusyHigh(self): 90 | logger.debug("e-Paper busy") 91 | while(epdconfig.digital_read(self.busy_pin) == 0): # 0: idle, 1: busy 92 | epdconfig.delay_ms(100) 93 | logger.debug("e-Paper busy release") 94 | 95 | def ReadBusyLow(self): 96 | logger.debug("e-Paper busy") 97 | while(epdconfig.digital_read(self.busy_pin) == 1): # 0: idle, 1: busy 98 | epdconfig.delay_ms(100) 99 | logger.debug("e-Paper busy release") 100 | 101 | def init(self): 102 | if (epdconfig.module_init() != 0): 103 | return -1 104 | # EPD hardware init start 105 | self.reset() 106 | 107 | self.ReadBusyHigh() 108 | self.send_command(0x00) 109 | self.send_data(0xEF) 110 | self.send_data(0x08) 111 | self.send_command(0x01) 112 | self.send_data(0x37) 113 | self.send_data(0x00) 114 | self.send_data(0x23) 115 | self.send_data(0x23) 116 | self.send_command(0x03) 117 | self.send_data(0x00) 118 | self.send_command(0x06) 119 | self.send_data(0xC7) 120 | self.send_data(0xC7) 121 | self.send_data(0x1D) 122 | self.send_command(0x30) 123 | self.send_data(0x3c) 124 | self.send_command(0x41) 125 | self.send_data(0x00) 126 | self.send_command(0x50) 127 | self.send_data(0x37) 128 | self.send_command(0x60) 129 | self.send_data(0x22) 130 | self.send_command(0x61) 131 | self.send_data(0x02) 132 | self.send_data(0x58) 133 | self.send_data(0x01) 134 | self.send_data(0xC0) 135 | self.send_command(0xE3) 136 | self.send_data(0xAA) 137 | 138 | epdconfig.delay_ms(100) 139 | self.send_command(0x50) 140 | self.send_data(0x37) 141 | # EPD hardware init end 142 | return 0 143 | 144 | def getbuffer(self, image): 145 | # Create a pallette with the 7 colors supported by the panel 146 | pal_image = Image.new("P", (1,1)) 147 | pal_image.putpalette( (0,0,0, 255,255,255, 0,255,0, 0,0,255, 255,0,0, 255,255,0, 255,128,0) + (0,0,0)*249) 148 | 149 | # Check if we need to rotate the image 150 | imwidth, imheight = image.size 151 | if(imwidth == self.width and imheight == self.height): 152 | image_temp = image 153 | elif(imwidth == self.height and imheight == self.width): 154 | image_temp = image.rotate(90, expand=True) 155 | else: 156 | logger.warning("Invalid image dimensions: %d x %d, expected %d x %d" % (imwidth, imheight, self.width, self.height)) 157 | 158 | # Convert the soruce image to the 7 colors, dithering if needed 159 | image_7color = image_temp.convert("RGB").quantize(palette=pal_image) 160 | buf_7color = bytearray(image_7color.tobytes('raw')) 161 | 162 | # PIL does not support 4 bit color, so pack the 4 bits of color 163 | # into a single byte to transfer to the panel 164 | buf = [0x00] * int(self.width * self.height / 2) 165 | idx = 0 166 | for i in range(0, len(buf_7color), 2): 167 | buf[idx] = (buf_7color[i] << 4) + buf_7color[i+1] 168 | idx += 1 169 | 170 | return buf 171 | 172 | def display(self,image): 173 | self.send_command(0x61) #Set Resolution setting 174 | self.send_data(0x02) 175 | self.send_data(0x58) 176 | self.send_data(0x01) 177 | self.send_data(0xC0) 178 | self.send_command(0x10) 179 | 180 | self.send_data_bulk(image) 181 | self.send_command(0x04) #0x04 182 | self.ReadBusyHigh() 183 | self.send_command(0x12) #0x12 184 | self.ReadBusyHigh() 185 | self.send_command(0x02) #0x02 186 | self.ReadBusyLow() 187 | epdconfig.delay_ms(500) 188 | 189 | def Clear(self): 190 | self.send_command(0x61) #Set Resolution setting 191 | self.send_data(0x02) 192 | self.send_data(0x58) 193 | self.send_data(0x01) 194 | self.send_data(0xC0) 195 | self.send_command(0x10) 196 | 197 | # Set all pixels to white 198 | buf = [0x11] * int(self.width * self.height / 2) 199 | self.send_data_bulk(buf) 200 | 201 | self.send_command(0x04) #0x04 202 | self.ReadBusyHigh() 203 | self.send_command(0x12) #0x12 204 | self.ReadBusyHigh() 205 | self.send_command(0x02) #0x02 206 | self.ReadBusyLow() 207 | epdconfig.delay_ms(500) 208 | 209 | def sleep(self): 210 | epdconfig.delay_ms(500) 211 | self.send_command(0x07) # DEEP_SLEEP 212 | self.send_data(0XA5) 213 | epdconfig.digital_write(self.reset_pin, 0) 214 | 215 | epdconfig.delay_ms(2000) 216 | epdconfig.module_exit() 217 | -------------------------------------------------------------------------------- /lib/epd5in83.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd5in83.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V4.0 8 | # * | Date : 2019-06-20 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | 31 | import logging 32 | from . import epdconfig 33 | 34 | # Display resolution 35 | EPD_WIDTH = 600 36 | EPD_HEIGHT = 448 37 | 38 | logger = logging.getLogger(__name__) 39 | 40 | class EPD: 41 | def __init__(self): 42 | self.reset_pin = epdconfig.RST_PIN 43 | self.dc_pin = epdconfig.DC_PIN 44 | self.busy_pin = epdconfig.BUSY_PIN 45 | self.cs_pin = epdconfig.CS_PIN 46 | self.width = EPD_WIDTH 47 | self.height = EPD_HEIGHT 48 | 49 | # Hardware reset 50 | def reset(self): 51 | epdconfig.digital_write(self.reset_pin, 1) 52 | epdconfig.delay_ms(200) 53 | epdconfig.digital_write(self.reset_pin, 0) 54 | epdconfig.delay_ms(2) 55 | epdconfig.digital_write(self.reset_pin, 1) 56 | epdconfig.delay_ms(200) 57 | 58 | def send_command(self, command): 59 | epdconfig.digital_write(self.dc_pin, 0) 60 | epdconfig.digital_write(self.cs_pin, 0) 61 | epdconfig.spi_writebyte([command]) 62 | epdconfig.digital_write(self.cs_pin, 1) 63 | 64 | def send_data(self, data): 65 | epdconfig.digital_write(self.dc_pin, 1) 66 | epdconfig.digital_write(self.cs_pin, 0) 67 | epdconfig.spi_writebyte([data]) 68 | epdconfig.digital_write(self.cs_pin, 1) 69 | 70 | def ReadBusy(self): 71 | logger.debug("e-Paper busy") 72 | while(epdconfig.digital_read(self.busy_pin) == 0): # 0: idle, 1: busy 73 | epdconfig.delay_ms(100) 74 | logger.debug("e-Paper busy release") 75 | 76 | def init(self): 77 | if (epdconfig.module_init() != 0): 78 | return -1 79 | # EPD hardware init start 80 | self.reset() 81 | 82 | self.send_command(0x01) # POWER_SETTING 83 | self.send_data(0x37) 84 | self.send_data(0x00) 85 | 86 | self.send_command(0x00) # PANEL_SETTING 87 | self.send_data(0xCF) 88 | self.send_data(0x08) 89 | 90 | self.send_command(0x06) # BOOSTER_SOFT_START 91 | self.send_data(0xc7) 92 | self.send_data(0xcc) 93 | self.send_data(0x28) 94 | 95 | self.send_command(0x04) # POWER_ON 96 | self.ReadBusy() 97 | 98 | self.send_command(0x30) # PLL_CONTROL 99 | self.send_data(0x3c) 100 | 101 | self.send_command(0x41) # TEMPERATURE_CALIBRATION 102 | self.send_data(0x00) 103 | 104 | self.send_command(0x50) # VCOM_AND_DATA_INTERVAL_SETTING 105 | self.send_data(0x77) 106 | 107 | self.send_command(0x60) # TCON_SETTING 108 | self.send_data(0x22) 109 | 110 | self.send_command(0x61) # TCON_RESOLUTION 111 | self.send_data(0x02) # source 600 112 | self.send_data(0x58) 113 | self.send_data(0x01) # gate 448 114 | self.send_data(0xC0) 115 | 116 | self.send_command(0x82) # VCM_DC_SETTING 117 | self.send_data(0x1E) # decide by LUT file 118 | 119 | self.send_command(0xe5) # FLASH MODE 120 | self.send_data(0x03) 121 | 122 | # EPD hardware init end 123 | return 0 124 | 125 | def getbuffer(self, image): 126 | buf = [0x00] * int(self.width * self.height / 4) 127 | image_monocolor = image.convert('1') 128 | imwidth, imheight = image_monocolor.size 129 | pixels = image_monocolor.load() 130 | logger.debug('imwidth = %d imheight = %d ',imwidth, imheight) 131 | if(imwidth == self.width and imheight == self.height): 132 | for y in range(imheight): 133 | for x in range(imwidth): 134 | # Set the bits for the column of pixels at the current position. 135 | if pixels[x, y] < 64: # black 136 | buf[int((x + y * self.width) / 4)] &= ~(0xC0 >> (x % 4 * 2)) 137 | elif pixels[x, y] < 192: # convert gray to red 138 | buf[int((x + y * self.width) / 4)] &= ~(0xC0 >> (x % 4 * 2)) 139 | buf[int((x + y * self.width) / 4)] |= 0x40 >> (x % 4 * 2) 140 | else: # white 141 | buf[int((x + y * self.width) / 4)] |= 0xC0 >> (x % 4 * 2) 142 | elif(imwidth == self.height and imheight == self.width): 143 | for y in range(imheight): 144 | for x in range(imwidth): 145 | newx = y 146 | newy = self.height - x - 1 147 | if pixels[x, y] < 64: # black 148 | buf[int((newx + newy*self.width) / 4)] &= ~(0xC0 >> (y % 4 * 2)) 149 | elif pixels[x, y] < 192: # convert gray to red 150 | buf[int((newx + newy*self.width) / 4)] &= ~(0xC0 >> (y % 4 * 2)) 151 | buf[int((newx + newy*self.width) / 4)] |= 0x40 >> (y % 4 * 2) 152 | else: # white 153 | buf[int((newx + newy*self.width) / 4)] |= 0xC0 >> (y % 4 * 2) 154 | return buf 155 | 156 | def display(self, image): 157 | self.send_command(0x10) 158 | for i in range(0, int(self.width / 4 * self.height)): 159 | temp1 = image[i] 160 | j = 0 161 | while (j < 4): 162 | if ((temp1 & 0xC0) == 0xC0): 163 | temp2 = 0x03 164 | elif ((temp1 & 0xC0) == 0x00): 165 | temp2 = 0x00 166 | else: 167 | temp2 = 0x04 168 | temp2 = (temp2 << 4) & 0xFF 169 | temp1 = (temp1 << 2) & 0xFF 170 | j += 1 171 | if((temp1 & 0xC0) == 0xC0): 172 | temp2 |= 0x03 173 | elif ((temp1 & 0xC0) == 0x00): 174 | temp2 |= 0x00 175 | else: 176 | temp2 |= 0x04 177 | temp1 = (temp1 << 2) & 0xFF 178 | self.send_data(temp2) 179 | j += 1 180 | 181 | self.send_command(0x12) 182 | epdconfig.delay_ms(100) 183 | self.ReadBusy() 184 | 185 | def Clear(self): 186 | self.send_command(0x10) 187 | for i in range(0, int(self.width / 4 * self.height)): 188 | for j in range(0, 4): 189 | self.send_data(0x33) 190 | self.send_command(0x12) 191 | self.ReadBusy() 192 | 193 | def sleep(self): 194 | self.send_command(0x02) # POWER_OFF 195 | self.ReadBusy() 196 | self.send_command(0x07) # DEEP_SLEEP 197 | self.send_data(0XA5) 198 | 199 | epdconfig.delay_ms(2000) 200 | epdconfig.module_exit() 201 | 202 | ### END OF FILE ### 203 | 204 | -------------------------------------------------------------------------------- /lib/epd5in83_V2.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd5in83_V2.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V1.0 8 | # * | Date : 2020-12-09 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | import logging 31 | from . import epdconfig 32 | 33 | # Display resolution 34 | EPD_WIDTH = 648 35 | EPD_HEIGHT = 480 36 | 37 | logger = logging.getLogger(__name__) 38 | 39 | class EPD: 40 | def __init__(self): 41 | self.reset_pin = epdconfig.RST_PIN 42 | self.dc_pin = epdconfig.DC_PIN 43 | self.busy_pin = epdconfig.BUSY_PIN 44 | self.cs_pin = epdconfig.CS_PIN 45 | self.width = EPD_WIDTH 46 | self.height = EPD_HEIGHT 47 | 48 | # Hardware reset 49 | def reset(self): 50 | epdconfig.digital_write(self.reset_pin, 1) 51 | epdconfig.delay_ms(200) 52 | epdconfig.digital_write(self.reset_pin, 0) 53 | epdconfig.delay_ms(2) 54 | epdconfig.digital_write(self.reset_pin, 1) 55 | epdconfig.delay_ms(200) 56 | 57 | def send_command(self, command): 58 | epdconfig.digital_write(self.dc_pin, 0) 59 | epdconfig.digital_write(self.cs_pin, 0) 60 | epdconfig.spi_writebyte([command]) 61 | epdconfig.digital_write(self.cs_pin, 1) 62 | 63 | def send_data(self, data): 64 | epdconfig.digital_write(self.dc_pin, 1) 65 | epdconfig.digital_write(self.cs_pin, 0) 66 | epdconfig.spi_writebyte([data]) 67 | epdconfig.digital_write(self.cs_pin, 1) 68 | 69 | def ReadBusy(self): 70 | logger.debug("e-Paper busy") 71 | while(epdconfig.digital_read(self.busy_pin) == 0): 72 | epdconfig.delay_ms(20) 73 | logger.debug("e-Paper busy release") 74 | 75 | def TurnOnDisplay(self): 76 | self.send_command(0x12); #POWER ON 77 | epdconfig.delay_ms(100) 78 | self.ReadBusy(); 79 | 80 | def init(self): 81 | if (epdconfig.module_init() != 0): 82 | return -1 83 | # EPD hardware init start 84 | self.reset() 85 | 86 | self.send_command(0x01) #POWER SETTING 87 | self.send_data (0x07) 88 | self.send_data (0x07) #VGH=20V,VGL=-20V 89 | self.send_data (0x3f) #VDH=15V 90 | self.send_data (0x3f) #VDL=-15V 91 | 92 | self.send_command(0x04) #POWER ON 93 | epdconfig.delay_ms(100) 94 | self.ReadBusy() #waiting for the electronic paper IC to release the idle signal 95 | 96 | self.send_command(0X00) #PANNEL SETTING 97 | self.send_data(0x1F) #KW-3f KWR-2F BWROTP 0f BWOTP 1f 98 | 99 | self.send_command(0x61) #tres 100 | self.send_data (0x02) #source 648 101 | self.send_data (0x88) 102 | self.send_data (0x01) #gate 480 103 | self.send_data (0xE0) 104 | 105 | self.send_command(0X15) 106 | self.send_data(0x00) 107 | 108 | self.send_command(0X50) #VCOM AND DATA INTERVAL SETTING 109 | self.send_data(0x10) 110 | self.send_data(0x07) 111 | 112 | self.send_command(0X60) #TCON SETTING 113 | self.send_data(0x22) 114 | 115 | # EPD hardware init end 116 | return 0 117 | 118 | def getbuffer(self, image): 119 | # logger.debug("bufsiz = ",int(self.width/8) * self.height) 120 | buf = [0xFF] * (int(self.width/8) * self.height) 121 | image_monocolor = image.convert('1') 122 | imwidth, imheight = image_monocolor.size 123 | pixels = image_monocolor.load() 124 | # logger.debug("imwidth = %d, imheight = %d",imwidth,imheight) 125 | if(imwidth == self.width and imheight == self.height): 126 | logger.debug("Vertical") 127 | for y in range(imheight): 128 | for x in range(imwidth): 129 | # Set the bits for the column of pixels at the current position. 130 | if pixels[x, y] == 0: 131 | buf[int((x + y * self.width) / 8)] &= ~(0x80 >> (x % 8)) 132 | elif(imwidth == self.height and imheight == self.width): 133 | logger.debug("Horizontal") 134 | for y in range(imheight): 135 | for x in range(imwidth): 136 | newx = y 137 | newy = self.height - x - 1 138 | if pixels[x, y] == 0: 139 | buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8)) 140 | return buf 141 | 142 | def display(self, image): 143 | self.send_command(0x10) 144 | for i in range(0, int(self.width * self.height / 8)): 145 | self.send_data(0x00) 146 | self.send_command(0x13) 147 | for i in range(0, int(self.width * self.height / 8)): 148 | self.send_data(~image[i]) 149 | self.TurnOnDisplay() 150 | 151 | def Clear(self): 152 | self.send_command(0x10) 153 | for i in range(0, int(self.width * self.height / 8)): 154 | self.send_data(0x00) 155 | self.send_command(0x13) 156 | for i in range(0, int(self.width * self.height / 8)): 157 | self.send_data(0x00) 158 | self.TurnOnDisplay() 159 | 160 | def sleep(self): 161 | self.send_command(0x02) # POWER_OFF 162 | self.ReadBusy() 163 | self.send_command(0x07) # DEEP_SLEEP 164 | self.send_data(0XA5) 165 | 166 | epdconfig.delay_ms(2000) 167 | epdconfig.module_exit() 168 | 169 | ### END OF FILE ### 170 | 171 | -------------------------------------------------------------------------------- /lib/epd5in83b_V2.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd5in83b_V2.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V1.0 8 | # * | Date : 2020-07-04 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | 31 | import logging 32 | from . import epdconfig 33 | 34 | # Display resolution 35 | EPD_WIDTH = 648 36 | EPD_HEIGHT = 480 37 | 38 | logger = logging.getLogger(__name__) 39 | 40 | class EPD: 41 | def __init__(self): 42 | self.reset_pin = epdconfig.RST_PIN 43 | self.dc_pin = epdconfig.DC_PIN 44 | self.busy_pin = epdconfig.BUSY_PIN 45 | self.cs_pin = epdconfig.CS_PIN 46 | self.width = EPD_WIDTH 47 | self.height = EPD_HEIGHT 48 | 49 | # Hardware reset 50 | def reset(self): 51 | epdconfig.digital_write(self.reset_pin, 1) 52 | epdconfig.delay_ms(200) 53 | epdconfig.digital_write(self.reset_pin, 0) 54 | epdconfig.delay_ms(1) 55 | epdconfig.digital_write(self.reset_pin, 1) 56 | epdconfig.delay_ms(200) 57 | 58 | def send_command(self, command): 59 | epdconfig.digital_write(self.dc_pin, 0) 60 | epdconfig.digital_write(self.cs_pin, 0) 61 | epdconfig.spi_writebyte([command]) 62 | epdconfig.digital_write(self.cs_pin, 1) 63 | 64 | def send_data(self, data): 65 | epdconfig.digital_write(self.dc_pin, 1) 66 | epdconfig.digital_write(self.cs_pin, 0) 67 | epdconfig.spi_writebyte([data]) 68 | epdconfig.digital_write(self.cs_pin, 1) 69 | 70 | def ReadBusy(self): 71 | logger.debug("e-Paper busy") 72 | self.send_command(0X71) 73 | while(epdconfig.digital_read(self.busy_pin) == 0): # 0: idle, 1: busy 74 | self.send_command(0X71) 75 | epdconfig.delay_ms(200) 76 | logger.debug("e-Paper busy release") 77 | 78 | def init(self): 79 | if (epdconfig.module_init() != 0): 80 | return -1 81 | 82 | self.reset() 83 | 84 | self.send_command(0x01) #POWER SETTING 85 | self.send_data (0x07) 86 | self.send_data (0x07) #VGH=20V,VGL=-20V 87 | self.send_data (0x3f) #VDH=15V 88 | self.send_data (0x3f) #VDL=-15V 89 | 90 | self.send_command(0x04) #POWER ON 91 | epdconfig.delay_ms(100) 92 | self.ReadBusy() #waiting for the electronic paper IC to release the idle signal 93 | 94 | self.send_command(0X00) #PANNEL SETTING 95 | self.send_data(0x0F) #KW-3f KWR-2F BWROTP 0f BWOTP 1f 96 | 97 | self.send_command(0x61) #tres 98 | self.send_data (0x02) #source 648 99 | self.send_data (0x88) 100 | self.send_data (0x01) #gate 480 101 | self.send_data (0xe0) 102 | 103 | self.send_command(0X15) 104 | self.send_data(0x00) 105 | 106 | self.send_command(0X50) #VCOM AND DATA INTERVAL SETTING 107 | self.send_data(0x11) 108 | self.send_data(0x07) 109 | 110 | self.send_command(0X60) #TCON SETTING 111 | self.send_data(0x22) 112 | 113 | return 0 114 | 115 | def getbuffer(self, image): 116 | # logger.debug("bufsiz = ",int(self.width/8) * self.height) 117 | buf = [0xFF] * (int(self.width/8) * self.height) 118 | image_monocolor = image.convert('1') 119 | imwidth, imheight = image_monocolor.size 120 | pixels = image_monocolor.load() 121 | # logger.debug("imwidth = %d, imheight = %d",imwidth,imheight) 122 | if(imwidth == self.width and imheight == self.height): 123 | logger.debug("Vertical") 124 | for y in range(imheight): 125 | for x in range(imwidth): 126 | # Set the bits for the column of pixels at the current position. 127 | if pixels[x, y] == 0: 128 | buf[int((x + y * self.width) / 8)] &= ~(0x80 >> (x % 8)) 129 | elif(imwidth == self.height and imheight == self.width): 130 | logger.debug("Horizontal") 131 | for y in range(imheight): 132 | for x in range(imwidth): 133 | newx = y 134 | newy = self.height - x - 1 135 | if pixels[x, y] == 0: 136 | buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8)) 137 | return buf 138 | 139 | def display(self, imageblack, imagered): 140 | if (imageblack != None): 141 | self.send_command(0X10) 142 | for i in range(0, int(self.width * self.height / 8)): 143 | self.send_data(imageblack[i]) 144 | if (imagered != None): 145 | self.send_command(0X13) 146 | for i in range(0, int(self.width * self.height / 8)): 147 | self.send_data(~imagered[i]) 148 | 149 | self.send_command(0x12) 150 | epdconfig.delay_ms(200) 151 | self.ReadBusy() 152 | 153 | def Clear(self): 154 | self.send_command(0X10) 155 | for i in range(0, int(self.width * self.height / 8)): 156 | self.send_data(0xff) 157 | self.send_command(0X13) 158 | for i in range(0, int(self.width * self.height / 8)): 159 | self.send_data(0x00) 160 | 161 | self.send_command(0x12) 162 | epdconfig.delay_ms(200) 163 | self.ReadBusy() 164 | 165 | def sleep(self): 166 | self.send_command(0X02) # power off 167 | self.ReadBusy() 168 | self.send_command(0X07) # deep sleep 169 | self.send_data(0xA5) 170 | 171 | epdconfig.delay_ms(2000) 172 | epdconfig.module_exit() 173 | ### END OF FILE ### 174 | 175 | -------------------------------------------------------------------------------- /lib/epd5in83bc.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd5in83b.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V4.0 8 | # * | Date : 2019-06-20 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | 31 | import logging 32 | from . import epdconfig 33 | 34 | # Display resolution 35 | EPD_WIDTH = 600 36 | EPD_HEIGHT = 448 37 | 38 | logger = logging.getLogger(__name__) 39 | 40 | class EPD: 41 | def __init__(self): 42 | self.reset_pin = epdconfig.RST_PIN 43 | self.dc_pin = epdconfig.DC_PIN 44 | self.busy_pin = epdconfig.BUSY_PIN 45 | self.cs_pin = epdconfig.CS_PIN 46 | self.width = EPD_WIDTH 47 | self.height = EPD_HEIGHT 48 | 49 | # Hardware reset 50 | def reset(self): 51 | epdconfig.digital_write(self.reset_pin, 1) 52 | epdconfig.delay_ms(200) 53 | epdconfig.digital_write(self.reset_pin, 0) 54 | epdconfig.delay_ms(5) 55 | epdconfig.digital_write(self.reset_pin, 1) 56 | epdconfig.delay_ms(200) 57 | 58 | def send_command(self, command): 59 | epdconfig.digital_write(self.dc_pin, 0) 60 | epdconfig.digital_write(self.cs_pin, 0) 61 | epdconfig.spi_writebyte([command]) 62 | epdconfig.digital_write(self.cs_pin, 1) 63 | 64 | def send_data(self, data): 65 | epdconfig.digital_write(self.dc_pin, 1) 66 | epdconfig.digital_write(self.cs_pin, 0) 67 | epdconfig.spi_writebyte([data]) 68 | epdconfig.digital_write(self.cs_pin, 1) 69 | 70 | def ReadBusy(self): 71 | logger.debug("e-Paper busy") 72 | while(epdconfig.digital_read(self.busy_pin) == 0): # 0: idle, 1: busy 73 | epdconfig.delay_ms(100) 74 | logger.debug("e-Paper busy release") 75 | 76 | def init(self): 77 | if (epdconfig.module_init() != 0): 78 | return -1 79 | 80 | self.reset() 81 | 82 | self.send_command(0x01) # POWER_SETTING 83 | self.send_data(0x37) 84 | self.send_data(0x00) 85 | 86 | self.send_command(0x00) # PANEL_SETTING 87 | self.send_data(0xCF) 88 | self.send_data(0x08) 89 | 90 | self.send_command(0x30) # PLL_CONTROL 91 | self.send_data(0x3A) # PLL: 0-15:0x3C, 15+:0x3A 92 | self.send_command(0X82) # VCOM VOLTAGE SETTING 93 | self.send_data(0x28) # all temperature range 94 | 95 | self.send_command(0x06) # boost 96 | self.send_data(0xc7) 97 | self.send_data(0xcc) 98 | self.send_data(0x15) 99 | 100 | self.send_command(0X50) # VCOM AND DATA INTERVAL SETTING 101 | self.send_data(0x77) 102 | 103 | self.send_command(0X60) # TCON SETTING 104 | self.send_data(0x22) 105 | 106 | self.send_command(0X65) # FLASH CONTROL 107 | self.send_data(0x00) 108 | 109 | self.send_command(0x61) # tres 110 | self.send_data(0x02) # source 600 111 | self.send_data(0x58) 112 | self.send_data(0x01) # gate 448 113 | self.send_data(0xc0) 114 | 115 | self.send_command(0xe5) # FLASH MODE 116 | self.send_data(0x03) 117 | self.send_data(0x03) 118 | 119 | return 0 120 | 121 | def getbuffer(self, image): 122 | # logger.debug("bufsiz = ",int(self.width/8) * self.height) 123 | buf = [0xFF] * (int(self.width/8) * self.height) 124 | image_monocolor = image.convert('1') 125 | imwidth, imheight = image_monocolor.size 126 | pixels = image_monocolor.load() 127 | logger.debug('imwidth = %d imheight = %d ',imwidth, imheight) 128 | if(imwidth == self.width and imheight == self.height): 129 | logger.debug("Horizontal") 130 | for y in range(imheight): 131 | for x in range(imwidth): 132 | # Set the bits for the column of pixels at the current position. 133 | if pixels[x, y] == 0: 134 | buf[int((x + y * self.width) / 8)] &= ~(0x80 >> (x % 8)) 135 | elif(imwidth == self.height and imheight == self.width): 136 | logger.debug("Vertical") 137 | for y in range(imheight): 138 | for x in range(imwidth): 139 | newx = y 140 | newy = self.height - x - 1 141 | if pixels[x, y] == 0: 142 | buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8)) 143 | return buf 144 | 145 | def display(self, imageblack, imagered): 146 | self.send_command(0x10) 147 | for i in range(0, int(self.width / 8 * self.height)): 148 | temp1 = imageblack[i] 149 | temp2 = imagered[i] 150 | j = 0 151 | while (j < 8): 152 | if ((temp2 & 0x80) == 0x00): 153 | temp3 = 0x04 #red 154 | elif ((temp1 & 0x80) == 0x00): 155 | temp3 = 0x00 #black 156 | else: 157 | temp3 = 0x03 #white 158 | 159 | temp3 = (temp3 << 4) & 0xFF 160 | temp1 = (temp1 << 1) & 0xFF 161 | temp2 = (temp2 << 1) & 0xFF 162 | j += 1 163 | if((temp2 & 0x80) == 0x00): 164 | temp3 |= 0x04 #red 165 | elif ((temp1 & 0x80) == 0x00): 166 | temp3 |= 0x00 #black 167 | else: 168 | temp3 |= 0x03 #white 169 | temp1 = (temp1 << 1) & 0xFF 170 | temp2 = (temp2 << 1) & 0xFF 171 | self.send_data(temp3) 172 | j += 1 173 | 174 | self.send_command(0x04) # POWER ON 175 | self.ReadBusy() 176 | self.send_command(0x12) # display refresh 177 | epdconfig.delay_ms(100) 178 | self.ReadBusy() 179 | 180 | def Clear(self): 181 | self.send_command(0x10) 182 | for i in range(0, int(self.width / 8 * self.height)): 183 | self.send_data(0x33) 184 | self.send_data(0x33) 185 | self.send_data(0x33) 186 | self.send_data(0x33) 187 | 188 | self.send_command(0x04) # POWER ON 189 | self.ReadBusy() 190 | self.send_command(0x12) # display refresh 191 | epdconfig.delay_ms(100) 192 | self.ReadBusy() 193 | 194 | def sleep(self): 195 | self.send_command(0x02) # POWER_OFF 196 | self.ReadBusy() 197 | self.send_command(0x07) # DEEP_SLEEP 198 | self.send_data(0xA5) # check code 199 | 200 | epdconfig.delay_ms(2000) 201 | epdconfig.module_exit() 202 | ### END OF FILE ### 203 | 204 | -------------------------------------------------------------------------------- /lib/epd7in5.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd7in5.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V4.0 8 | # * | Date : 2019-06-20 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | 31 | import logging 32 | from . import epdconfig 33 | 34 | # Display resolution 35 | EPD_WIDTH = 640 36 | EPD_HEIGHT = 384 37 | 38 | logger = logging.getLogger(__name__) 39 | 40 | class EPD: 41 | def __init__(self): 42 | self.reset_pin = epdconfig.RST_PIN 43 | self.dc_pin = epdconfig.DC_PIN 44 | self.busy_pin = epdconfig.BUSY_PIN 45 | self.cs_pin = epdconfig.CS_PIN 46 | self.width = EPD_WIDTH 47 | self.height = EPD_HEIGHT 48 | 49 | # Hardware reset 50 | def reset(self): 51 | epdconfig.digital_write(self.reset_pin, 1) 52 | epdconfig.delay_ms(200) 53 | epdconfig.digital_write(self.reset_pin, 0) 54 | epdconfig.delay_ms(5) 55 | epdconfig.digital_write(self.reset_pin, 1) 56 | epdconfig.delay_ms(200) 57 | 58 | def send_command(self, command): 59 | epdconfig.digital_write(self.dc_pin, 0) 60 | epdconfig.digital_write(self.cs_pin, 0) 61 | epdconfig.spi_writebyte([command]) 62 | epdconfig.digital_write(self.cs_pin, 1) 63 | 64 | def send_data(self, data): 65 | epdconfig.digital_write(self.dc_pin, 1) 66 | epdconfig.digital_write(self.cs_pin, 0) 67 | epdconfig.spi_writebyte([data]) 68 | epdconfig.digital_write(self.cs_pin, 1) 69 | 70 | def send_data2(self, data): 71 | epdconfig.digital_write(self.dc_pin, 1) 72 | epdconfig.digital_write(self.cs_pin, 0) 73 | epdconfig.spi_writebyte2(data) 74 | epdconfig.digital_write(self.cs_pin, 1) 75 | 76 | def ReadBusy(self): 77 | logger.debug("e-Paper busy") 78 | while(epdconfig.digital_read(self.busy_pin) == 0): # 0: idle, 1: busy 79 | epdconfig.delay_ms(100) 80 | logger.debug("e-Paper busy release") 81 | 82 | def init(self): 83 | if (epdconfig.module_init() != 0): 84 | return -1 85 | # EPD hardware init start 86 | self.reset() 87 | 88 | self.send_command(0x01) # POWER_SETTING 89 | self.send_data2([0x37, 0x00]) 90 | 91 | self.send_command(0x00) # PANEL_SETTING 92 | self.send_data2([0xCF, 0x08]) 93 | 94 | self.send_command(0x06) # BOOSTER_SOFT_START 95 | self.send_data2([0xc7, 0xcc, 0x28]) 96 | 97 | self.send_command(0x04) # POWER_ON 98 | self.ReadBusy() 99 | 100 | self.send_command(0x30) # PLL_CONTROL 101 | self.send_data(0x3c) 102 | 103 | self.send_command(0x41) # TEMPERATURE_CALIBRATION 104 | self.send_data(0x00) 105 | 106 | self.send_command(0x50) # VCOM_AND_DATA_INTERVAL_SETTING 107 | self.send_data(0x77) 108 | 109 | self.send_command(0x60) # TCON_SETTING 110 | self.send_data(0x22) 111 | 112 | self.send_command(0x61) # TCON_RESOLUTION 113 | self.send_data(EPD_WIDTH >> 8) #source 640 114 | self.send_data(EPD_WIDTH & 0xff) 115 | self.send_data(EPD_HEIGHT >> 8) #gate 384 116 | self.send_data(EPD_HEIGHT & 0xff) 117 | 118 | self.send_command(0x82) # VCM_DC_SETTING 119 | self.send_data(0x1E) # decide by LUT file 120 | 121 | self.send_command(0xe5) # FLASH MODE 122 | self.send_data(0x03) 123 | 124 | # EPD hardware init end 125 | return 0 126 | 127 | def getbuffer(self, image): 128 | img = image 129 | imwidth, imheight = img.size 130 | halfwidth = int(self.width / 2) 131 | buf = [0x33] * halfwidth * self.height 132 | 133 | if(imwidth == self.width and imheight == self.height): 134 | img = img.convert('1') 135 | elif(imwidth == self.height and imheight == self.width): 136 | img = img.rotate(90, expand=True).convert('1') 137 | imwidth, imheight = img.size 138 | else: 139 | logger.warning("Wrong image dimensions: must be " + str(self.width) + "x" + str(self.height)) 140 | # return a blank buffer 141 | return buf 142 | 143 | pixels = img.load() 144 | 145 | for y in range(imheight): 146 | offset = y * halfwidth 147 | for x in range(1, imwidth, 2): 148 | i = offset + x // 2 149 | if(pixels[x-1, y] > 191): 150 | if(pixels[x, y] > 191): 151 | buf[i] = 0x33 152 | else: 153 | buf[i] = 0x30 154 | else: 155 | if(pixels[x, y] > 191): 156 | buf[i] = 0x03 157 | else: 158 | buf[i] = 0x00 159 | return buf 160 | 161 | def display(self, image): 162 | self.send_command(0x10) 163 | self.send_data2(image) 164 | self.send_command(0x12) 165 | epdconfig.delay_ms(100) 166 | self.ReadBusy() 167 | 168 | def Clear(self): 169 | buf = [0x33] * int(self.width * self.height / 2) 170 | self.send_command(0x10) 171 | self.send_data2(buf) 172 | self.send_command(0x12) 173 | self.ReadBusy() 174 | 175 | def sleep(self): 176 | self.send_command(0x02) # POWER_OFF 177 | self.ReadBusy() 178 | 179 | self.send_command(0x07) # DEEP_SLEEP 180 | self.send_data(0XA5) 181 | 182 | epdconfig.delay_ms(2000) 183 | epdconfig.module_exit() 184 | ### END OF FILE ### 185 | 186 | -------------------------------------------------------------------------------- /lib/epd7in5_HD.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd7in5.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V4.0 8 | # * | Date : 2019-06-20 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | 31 | import logging 32 | from . import epdconfig 33 | 34 | # Display resolution 35 | EPD_WIDTH = 880 36 | EPD_HEIGHT = 528 37 | 38 | logger = logging.getLogger(__name__) 39 | 40 | class EPD: 41 | def __init__(self): 42 | self.reset_pin = epdconfig.RST_PIN 43 | self.dc_pin = epdconfig.DC_PIN 44 | self.busy_pin = epdconfig.BUSY_PIN 45 | self.cs_pin = epdconfig.CS_PIN 46 | self.width = EPD_WIDTH 47 | self.height = EPD_HEIGHT 48 | 49 | # Hardware reset 50 | def reset(self): 51 | epdconfig.digital_write(self.reset_pin, 1) 52 | epdconfig.delay_ms(200) 53 | epdconfig.digital_write(self.reset_pin, 0) 54 | epdconfig.delay_ms(2) 55 | epdconfig.digital_write(self.reset_pin, 1) 56 | epdconfig.delay_ms(200) 57 | 58 | def send_command(self, command): 59 | epdconfig.digital_write(self.dc_pin, 0) 60 | epdconfig.digital_write(self.cs_pin, 0) 61 | epdconfig.spi_writebyte([command]) 62 | epdconfig.digital_write(self.cs_pin, 1) 63 | 64 | def send_data(self, data): 65 | epdconfig.digital_write(self.dc_pin, 1) 66 | epdconfig.digital_write(self.cs_pin, 0) 67 | epdconfig.spi_writebyte([data]) 68 | epdconfig.digital_write(self.cs_pin, 1) 69 | 70 | def send_data2(self, data): 71 | epdconfig.digital_write(self.dc_pin, 1) 72 | epdconfig.digital_write(self.cs_pin, 0) 73 | epdconfig.spi_writebyte2(data) 74 | epdconfig.digital_write(self.cs_pin, 1) 75 | 76 | def ReadBusy(self): 77 | logger.debug("e-Paper busy") 78 | busy = epdconfig.digital_read(self.busy_pin) 79 | while(busy == 1): 80 | busy = epdconfig.digital_read(self.busy_pin) 81 | epdconfig.delay_ms(200) 82 | 83 | def init(self): 84 | if (epdconfig.module_init() != 0): 85 | return -1 86 | # EPD hardware init start 87 | self.reset() 88 | 89 | self.ReadBusy(); 90 | self.send_command(0x12); #SWRESET 91 | self.ReadBusy(); 92 | 93 | self.send_command(0x46); # Auto Write Red RAM 94 | self.send_data(0xf7); 95 | self.ReadBusy(); 96 | self.send_command(0x47); # Auto Write B/W RAM 97 | self.send_data(0xf7); 98 | self.ReadBusy(); 99 | 100 | self.send_command(0x0C); # Soft start setting 101 | self.send_data2([0xAE, 0xC7, 0xC3, 0xC0, 0x40]) 102 | 103 | self.send_command(0x01); # Set MUX as 527 104 | self.send_data2([0xAF, 0x02, 0x01]) 105 | 106 | self.send_command(0x11); # Data entry mode 107 | self.send_data(0x01); 108 | 109 | self.send_command(0x44); 110 | self.send_data2([0x00, 0x00, 0x6F, 0x03]) # RAM x address start at 0 111 | self.send_command(0x45); 112 | self.send_data2([0xAF, 0x02, 0x00, 0x00]) 113 | 114 | self.send_command(0x3C); # VBD 115 | self.send_data(0x05); # LUT1, for white 116 | 117 | self.send_command(0x18); 118 | self.send_data(0X80); 119 | 120 | 121 | self.send_command(0x22); 122 | self.send_data(0XB1); #Load Temperature and waveform setting. 123 | self.send_command(0x20); 124 | self.ReadBusy(); 125 | 126 | self.send_command(0x4E); # set RAM x address count to 0; 127 | self.send_data2([0x00, 0x00]) 128 | self.send_command(0x4F); 129 | self.send_data2([0x00, 0x00]) 130 | # EPD hardware init end 131 | return 0 132 | 133 | def getbuffer(self, image): 134 | img = image 135 | imwidth, imheight = img.size 136 | if(imwidth == self.width and imheight == self.height): 137 | img = img.convert('1') 138 | elif(imwidth == self.height and imheight == self.width): 139 | img = img.rotate(90, expand=True).convert('1') 140 | else: 141 | logger.warning("Wrong image dimensions: must be " + str(self.width) + "x" + str(self.height)) 142 | # return a blank buffer 143 | return [0xff] * int(self.width * self.height / 8) 144 | 145 | buf = bytearray(img.tobytes('raw')) 146 | return buf 147 | 148 | def display(self, image): 149 | self.send_command(0x4F); 150 | self.send_data2([0x00, 0x00]) 151 | self.send_command(0x24); 152 | self.send_data2(image) 153 | self.send_command(0x22); 154 | self.send_data(0xF7);#Load LUT from MCU(0x32) 155 | self.send_command(0x20); 156 | epdconfig.delay_ms(10); 157 | self.ReadBusy(); 158 | 159 | def Clear(self): 160 | buf = [0xff] * int(self.width * self.height / 8) 161 | self.send_command(0x4F); 162 | self.send_data2([0x00, 0x00]) 163 | self.send_command(0x24) 164 | self.send_data2(buf) 165 | 166 | self.send_command(0x26) 167 | self.send_data2(buf) 168 | 169 | self.send_command(0x22); 170 | self.send_data(0xF7);#Load LUT from MCU(0x32) 171 | self.send_command(0x20); 172 | epdconfig.delay_ms(10); 173 | self.ReadBusy(); 174 | 175 | def sleep(self): 176 | self.send_command(0x10); 177 | self.send_data(0x01); 178 | 179 | epdconfig.delay_ms(2000) 180 | epdconfig.module_exit() 181 | ### END OF FILE ### 182 | 183 | -------------------------------------------------------------------------------- /lib/epd7in5b_V2.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd7in5b_V2.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V4.1 8 | # * | Date : 2020-11-30 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | 31 | import logging 32 | from . import epdconfig 33 | 34 | # Display resolution 35 | EPD_WIDTH = 800 36 | EPD_HEIGHT = 480 37 | 38 | logger = logging.getLogger(__name__) 39 | 40 | class EPD: 41 | def __init__(self): 42 | self.reset_pin = epdconfig.RST_PIN 43 | self.dc_pin = epdconfig.DC_PIN 44 | self.busy_pin = epdconfig.BUSY_PIN 45 | self.cs_pin = epdconfig.CS_PIN 46 | self.width = EPD_WIDTH 47 | self.height = EPD_HEIGHT 48 | 49 | # Hardware reset 50 | def reset(self): 51 | epdconfig.digital_write(self.reset_pin, 1) 52 | epdconfig.delay_ms(200) 53 | epdconfig.digital_write(self.reset_pin, 0) 54 | epdconfig.delay_ms(4) 55 | epdconfig.digital_write(self.reset_pin, 1) 56 | epdconfig.delay_ms(200) 57 | 58 | def send_command(self, command): 59 | epdconfig.digital_write(self.dc_pin, 0) 60 | epdconfig.digital_write(self.cs_pin, 0) 61 | epdconfig.spi_writebyte([command]) 62 | epdconfig.digital_write(self.cs_pin, 1) 63 | 64 | def send_data(self, data): 65 | epdconfig.digital_write(self.dc_pin, 1) 66 | epdconfig.digital_write(self.cs_pin, 0) 67 | epdconfig.spi_writebyte([data]) 68 | epdconfig.digital_write(self.cs_pin, 1) 69 | 70 | def ReadBusy(self): 71 | logger.debug("e-Paper busy") 72 | self.send_command(0x71) 73 | busy = epdconfig.digital_read(self.busy_pin) 74 | while(busy == 0): 75 | self.send_command(0x71) 76 | busy = epdconfig.digital_read(self.busy_pin) 77 | epdconfig.delay_ms(200) 78 | logger.debug("e-Paper busy release") 79 | 80 | def init(self): 81 | if (epdconfig.module_init() != 0): 82 | return -1 83 | 84 | self.reset() 85 | 86 | # self.send_command(0x06) # btst 87 | # self.send_data(0x17) 88 | # self.send_data(0x17) 89 | # self.send_data(0x38) # If an exception is displayed, try using 0x38 90 | # self.send_data(0x17) 91 | 92 | self.send_command(0x01); #POWER SETTING 93 | self.send_data(0x07); 94 | self.send_data(0x07); #VGH=20V,VGL=-20V 95 | self.send_data(0x3f); #VDH=15V 96 | self.send_data(0x3f); #VDL=-15V 97 | 98 | self.send_command(0x04); #POWER ON 99 | epdconfig.delay_ms(100); 100 | self.ReadBusy(); 101 | 102 | self.send_command(0X00); #PANNEL SETTING 103 | self.send_data(0x0F); #KW-3f KWR-2F BWROTP 0f BWOTP 1f 104 | 105 | self.send_command(0x61); #tres 106 | self.send_data(0x03); #source 800 107 | self.send_data(0x20); 108 | self.send_data(0x01); #gate 480 109 | self.send_data(0xE0); 110 | 111 | self.send_command(0X15); 112 | self.send_data(0x00); 113 | 114 | self.send_command(0X50); #VCOM AND DATA INTERVAL SETTING 115 | self.send_data(0x11); 116 | self.send_data(0x07); 117 | 118 | self.send_command(0X60); #TCON SETTING 119 | self.send_data(0x22); 120 | 121 | self.send_command(0x65); 122 | self.send_data(0x00); 123 | self.send_data(0x00); 124 | self.send_data(0x00); 125 | self.send_data(0x00); 126 | 127 | return 0 128 | 129 | def getbuffer(self, image): 130 | # logger.debug("bufsiz = ",int(self.width/8) * self.height) 131 | buf = [0xFF] * (int(self.width/8) * self.height) 132 | image_monocolor = image.convert('1') 133 | imwidth, imheight = image_monocolor.size 134 | pixels = image_monocolor.load() 135 | logger.debug('imwidth = %d imheight = %d ',imwidth, imheight) 136 | if(imwidth == self.width and imheight == self.height): 137 | logger.debug("Horizontal") 138 | for y in range(imheight): 139 | for x in range(imwidth): 140 | # Set the bits for the column of pixels at the current position. 141 | if pixels[x, y] == 0: 142 | buf[int((x + y * self.width) / 8)] &= ~(0x80 >> (x % 8)) 143 | elif(imwidth == self.height and imheight == self.width): 144 | logger.debug("Vertical") 145 | for y in range(imheight): 146 | for x in range(imwidth): 147 | newx = y 148 | newy = self.height - x - 1 149 | if pixels[x, y] == 0: 150 | buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8)) 151 | return buf 152 | 153 | def display(self, imageblack, imagered): 154 | self.send_command(0x10) 155 | for i in range(0, int(self.width * self.height / 8)): 156 | self.send_data(imageblack[i]); 157 | 158 | self.send_command(0x13) 159 | for i in range(0, int(self.width * self.height / 8)): 160 | self.send_data(~imagered[i]); 161 | 162 | self.send_command(0x12) 163 | epdconfig.delay_ms(100) 164 | self.ReadBusy() 165 | 166 | def Clear(self): 167 | self.send_command(0x10) 168 | for i in range(0, int(self.width * self.height / 8)): 169 | self.send_data(0xff) 170 | 171 | self.send_command(0x13) 172 | for i in range(0, int(self.width * self.height / 8)): 173 | self.send_data(0x00) 174 | 175 | self.send_command(0x12) 176 | epdconfig.delay_ms(100) 177 | self.ReadBusy() 178 | 179 | def sleep(self): 180 | self.send_command(0x02) # POWER_OFF 181 | self.ReadBusy() 182 | 183 | self.send_command(0x07) # DEEP_SLEEP 184 | self.send_data(0XA5) 185 | 186 | epdconfig.delay_ms(2000) 187 | epdconfig.module_exit() 188 | ### END OF FILE ### 189 | 190 | -------------------------------------------------------------------------------- /lib/epd7in5bc.py: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * | File : epd7in5bc.py 3 | # * | Author : Waveshare team 4 | # * | Function : Electronic paper driver 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V4.0 8 | # * | Date : 2019-06-20 9 | # # | Info : python demo 10 | # ----------------------------------------------------------------------------- 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | 31 | import logging 32 | from . import epdconfig 33 | 34 | # Display resolution 35 | EPD_WIDTH = 640 36 | EPD_HEIGHT = 384 37 | 38 | logger = logging.getLogger(__name__) 39 | 40 | class EPD: 41 | def __init__(self): 42 | self.reset_pin = epdconfig.RST_PIN 43 | self.dc_pin = epdconfig.DC_PIN 44 | self.busy_pin = epdconfig.BUSY_PIN 45 | self.cs_pin = epdconfig.CS_PIN 46 | self.width = EPD_WIDTH 47 | self.height = EPD_HEIGHT 48 | 49 | # Hardware reset 50 | def reset(self): 51 | epdconfig.digital_write(self.reset_pin, 1) 52 | epdconfig.delay_ms(200) 53 | epdconfig.digital_write(self.reset_pin, 0) 54 | epdconfig.delay_ms(5) 55 | epdconfig.digital_write(self.reset_pin, 1) 56 | epdconfig.delay_ms(200) 57 | 58 | def send_command(self, command): 59 | epdconfig.digital_write(self.dc_pin, 0) 60 | epdconfig.digital_write(self.cs_pin, 0) 61 | epdconfig.spi_writebyte([command]) 62 | epdconfig.digital_write(self.cs_pin, 1) 63 | 64 | def send_data(self, data): 65 | epdconfig.digital_write(self.dc_pin, 1) 66 | epdconfig.digital_write(self.cs_pin, 0) 67 | epdconfig.spi_writebyte([data]) 68 | epdconfig.digital_write(self.cs_pin, 1) 69 | 70 | def ReadBusy(self): 71 | logger.debug("e-Paper busy") 72 | while(epdconfig.digital_read(self.busy_pin) == 0): # 0: idle, 1: busy 73 | epdconfig.delay_ms(100) 74 | logger.debug("e-Paper busy release") 75 | 76 | def init(self): 77 | if (epdconfig.module_init() != 0): 78 | return -1 79 | 80 | self.reset() 81 | 82 | self.send_command(0x01) # POWER_SETTING 83 | self.send_data(0x37) 84 | self.send_data(0x00) 85 | 86 | self.send_command(0x00) # PANEL_SETTING 87 | self.send_data(0xCF) 88 | self.send_data(0x08) 89 | 90 | self.send_command(0x30) # PLL_CONTROL 91 | self.send_data(0x3A) # PLL: 0-15:0x3C, 15+:0x3A 92 | 93 | self.send_command(0x82) # VCM_DC_SETTING 94 | self.send_data(0x28) #all temperature range 95 | 96 | self.send_command(0x06) # BOOSTER_SOFT_START 97 | self.send_data(0xc7) 98 | self.send_data(0xcc) 99 | self.send_data(0x15) 100 | 101 | self.send_command(0x50) # VCOM AND DATA INTERVAL SETTING 102 | self.send_data(0x77) 103 | 104 | self.send_command(0x60) # TCON_SETTING 105 | self.send_data(0x22) 106 | 107 | self.send_command(0x65) # FLASH CONTROL 108 | self.send_data(0x00) 109 | 110 | self.send_command(0x61) # TCON_RESOLUTION 111 | self.send_data(self.width >> 8) # source 640 112 | self.send_data(self.width & 0xff) 113 | self.send_data(self.height >> 8) # gate 384 114 | self.send_data(self.height & 0xff) 115 | 116 | self.send_command(0xe5) # FLASH MODE 117 | self.send_data(0x03) 118 | 119 | return 0 120 | 121 | def getbuffer(self, image): 122 | # logger.debug("bufsiz = ",int(self.width/8) * self.height) 123 | buf = [0xFF] * (int(self.width/8) * self.height) 124 | image_monocolor = image.convert('1') 125 | imwidth, imheight = image_monocolor.size 126 | pixels = image_monocolor.load() 127 | logger.debug('imwidth = %d imheight = %d ',imwidth, imheight) 128 | if(imwidth == self.width and imheight == self.height): 129 | logger.debug("Horizontal") 130 | for y in range(imheight): 131 | for x in range(imwidth): 132 | # Set the bits for the column of pixels at the current position. 133 | if pixels[x, y] == 0: 134 | buf[int((x + y * self.width) / 8)] &= ~(0x80 >> (x % 8)) 135 | elif(imwidth == self.height and imheight == self.width): 136 | logger.debug("Vertical") 137 | for y in range(imheight): 138 | for x in range(imwidth): 139 | newx = y 140 | newy = self.height - x - 1 141 | if pixels[x, y] == 0: 142 | buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8)) 143 | return buf 144 | 145 | def display(self, imageblack, imagered): 146 | self.send_command(0x10) 147 | for i in range(0, int(self.width / 8 * self.height)): 148 | temp1 = imageblack[i] 149 | temp2 = imagered[i] 150 | j = 0 151 | while (j < 8): 152 | if ((temp2 & 0x80) == 0x00): 153 | temp3 = 0x04 #red 154 | elif ((temp1 & 0x80) == 0x00): 155 | temp3 = 0x00 #black 156 | else: 157 | temp3 = 0x03 #white 158 | 159 | temp3 = (temp3 << 4) & 0xFF 160 | temp1 = (temp1 << 1) & 0xFF 161 | temp2 = (temp2 << 1) & 0xFF 162 | j += 1 163 | if((temp2 & 0x80) == 0x00): 164 | temp3 |= 0x04 #red 165 | elif ((temp1 & 0x80) == 0x00): 166 | temp3 |= 0x00 #black 167 | else: 168 | temp3 |= 0x03 #white 169 | temp1 = (temp1 << 1) & 0xFF 170 | temp2 = (temp2 << 1) & 0xFF 171 | self.send_data(temp3) 172 | j += 1 173 | 174 | self.send_command(0x04) # POWER ON 175 | self.ReadBusy() 176 | self.send_command(0x12) # display refresh 177 | epdconfig.delay_ms(100) 178 | self.ReadBusy() 179 | 180 | def Clear(self): 181 | self.send_command(0x10) 182 | for i in range(0, int(self.width / 8 * self.height)): 183 | self.send_data(0x33) 184 | self.send_data(0x33) 185 | self.send_data(0x33) 186 | self.send_data(0x33) 187 | 188 | self.send_command(0x04) # POWER ON 189 | self.ReadBusy() 190 | self.send_command(0x12) # display refresh 191 | epdconfig.delay_ms(100) 192 | self.ReadBusy() 193 | 194 | def sleep(self): 195 | self.send_command(0x02) # POWER_OFF 196 | self.ReadBusy() 197 | 198 | self.send_command(0x07) # DEEP_SLEEP 199 | self.send_data(0XA5) 200 | 201 | epdconfig.delay_ms(2000) 202 | epdconfig.module_exit() 203 | ### END OF FILE ### 204 | 205 | -------------------------------------------------------------------------------- /lib/epdconfig.py: -------------------------------------------------------------------------------- 1 | # /***************************************************************************** 2 | # * | File : epdconfig.py 3 | # * | Author : Waveshare team 4 | # * | Function : Hardware underlying interface 5 | # * | Info : 6 | # *---------------- 7 | # * | This version: V1.0 8 | # * | Date : 2019-06-21 9 | # * | Info : 10 | # ****************************************************************************** 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy 12 | # of this software and associated documnetation 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 | # furished 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 OR 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 | # 29 | 30 | import os 31 | import logging 32 | import sys 33 | import time 34 | 35 | logger = logging.getLogger(__name__) 36 | 37 | 38 | class RaspberryPi: 39 | # Pin definition 40 | RST_PIN = 17 41 | DC_PIN = 25 42 | CS_PIN = 8 43 | BUSY_PIN = 24 44 | 45 | def __init__(self): 46 | import spidev 47 | import RPi.GPIO 48 | 49 | self.GPIO = RPi.GPIO 50 | self.SPI = spidev.SpiDev() 51 | 52 | def digital_write(self, pin, value): 53 | self.GPIO.output(pin, value) 54 | 55 | def digital_read(self, pin): 56 | return self.GPIO.input(pin) 57 | 58 | def delay_ms(self, delaytime): 59 | time.sleep(delaytime / 1000.0) 60 | 61 | def spi_writebyte(self, data): 62 | self.SPI.writebytes(data) 63 | 64 | def spi_writebyte2(self, data): 65 | self.SPI.writebytes2(data) 66 | 67 | def module_init(self): 68 | self.GPIO.setmode(self.GPIO.BCM) 69 | self.GPIO.setwarnings(False) 70 | self.GPIO.setup(self.RST_PIN, self.GPIO.OUT) 71 | self.GPIO.setup(self.DC_PIN, self.GPIO.OUT) 72 | self.GPIO.setup(self.CS_PIN, self.GPIO.OUT) 73 | self.GPIO.setup(self.BUSY_PIN, self.GPIO.IN) 74 | 75 | # SPI device, bus = 0, device = 0 76 | self.SPI.open(0, 0) 77 | self.SPI.max_speed_hz = 4000000 78 | self.SPI.mode = 0b00 79 | return 0 80 | 81 | def module_exit(self): 82 | logger.debug("spi end") 83 | self.SPI.close() 84 | 85 | logger.debug("close 5V, Module enters 0 power consumption ...") 86 | self.GPIO.output(self.RST_PIN, 0) 87 | self.GPIO.output(self.DC_PIN, 0) 88 | 89 | self.GPIO.cleanup() 90 | 91 | 92 | class JetsonNano: 93 | # Pin definition 94 | RST_PIN = 17 95 | DC_PIN = 25 96 | CS_PIN = 8 97 | BUSY_PIN = 24 98 | 99 | def __init__(self): 100 | import ctypes 101 | find_dirs = [ 102 | os.path.dirname(os.path.realpath(__file__)), 103 | '/usr/local/lib', 104 | '/usr/lib', 105 | ] 106 | self.SPI = None 107 | for find_dir in find_dirs: 108 | so_filename = os.path.join(find_dir, 'sysfs_software_spi.so') 109 | if os.path.exists(so_filename): 110 | self.SPI = ctypes.cdll.LoadLibrary(so_filename) 111 | break 112 | if self.SPI is None: 113 | raise RuntimeError('Cannot find sysfs_software_spi.so') 114 | 115 | import Jetson.GPIO 116 | self.GPIO = Jetson.GPIO 117 | 118 | def digital_write(self, pin, value): 119 | self.GPIO.output(pin, value) 120 | 121 | def digital_read(self, pin): 122 | return self.GPIO.input(self.BUSY_PIN) 123 | 124 | def delay_ms(self, delaytime): 125 | time.sleep(delaytime / 1000.0) 126 | 127 | def spi_writebyte(self, data): 128 | self.SPI.SYSFS_software_spi_transfer(data[0]) 129 | 130 | def module_init(self): 131 | self.GPIO.setmode(self.GPIO.BCM) 132 | self.GPIO.setwarnings(False) 133 | self.GPIO.setup(self.RST_PIN, self.GPIO.OUT) 134 | self.GPIO.setup(self.DC_PIN, self.GPIO.OUT) 135 | self.GPIO.setup(self.CS_PIN, self.GPIO.OUT) 136 | self.GPIO.setup(self.BUSY_PIN, self.GPIO.IN) 137 | self.SPI.SYSFS_software_spi_begin() 138 | return 0 139 | 140 | def module_exit(self): 141 | logger.debug("spi end") 142 | self.SPI.SYSFS_software_spi_end() 143 | 144 | logger.debug("close 5V, Module enters 0 power consumption ...") 145 | self.GPIO.output(self.RST_PIN, 0) 146 | self.GPIO.output(self.DC_PIN, 0) 147 | 148 | self.GPIO.cleanup() 149 | 150 | 151 | if os.path.exists('/sys/bus/platform/drivers/gpiomem-bcm2835'): 152 | implementation = RaspberryPi() 153 | else: 154 | implementation = JetsonNano() 155 | 156 | for func in [x for x in dir(implementation) if not x.startswith('_')]: 157 | setattr(sys.modules[__name__], func, getattr(implementation, func)) 158 | 159 | 160 | ### END OF FILE ### 161 | -------------------------------------------------------------------------------- /lib/info.txt: -------------------------------------------------------------------------------- 1 | This libary is from waveshare: https://github.com/waveshare/e-Paper/tree/master/RaspberryPi_JetsonNano/python/lib/waveshare_epd 2 | -------------------------------------------------------------------------------- /lib/sysfs_gpio.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/lib/sysfs_gpio.so -------------------------------------------------------------------------------- /lib/sysfs_software_spi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineersNeedArt/SystemSix/99060efb9dcfe666e62e8c51577654840dadd093/lib/sysfs_software_spi.so -------------------------------------------------------------------------------- /moon_module.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | """Functions for calculating moon phase.""" 3 | 4 | import datetime 5 | import math 6 | import sys 7 | import collections 8 | 9 | 10 | def get_moon_phase(date): 11 | """ 12 | Get decimal moon phase for a date. 13 | Date should be in the format YYYY-MM-DD. 14 | Returns the day of the lunar cycle (0-29). 15 | Algorithm influenced by Ben Daglish: 16 | http://www.ben-daglish.net/moon.shtml 17 | """ 18 | phase_len = 2551443 19 | year, month, day = date.split("-", 2) 20 | epoch = datetime.datetime(1970, 1, 1) 21 | new_moon = (datetime.datetime(1970, 1, 7) - epoch).total_seconds() 22 | user_date = (datetime.datetime(int(year), int(month), int(day)) - epoch).total_seconds() 23 | phase = (user_date - new_moon) % phase_len 24 | 25 | return math.floor(phase / (24 * 3600) + 1) 26 | 27 | 28 | def interpret_moon_phase(phase): 29 | """Translate phase into common language for moon phases.""" 30 | if phase == 0 or phase == 30: 31 | return "New Moon" 32 | if phase > 0 and phase < 7.5: 33 | return "Waxing Crescent" 34 | if phase > 7.5 and phase < 15: 35 | return "Waxing Gibbous" 36 | if phase == 15: 37 | return "Full Moon" 38 | if phase > 15 and phase < 22.5: 39 | return "Waning Gibbous" 40 | if phase > 22.5 and phase < 30: 41 | return "Waning Crescent" 42 | 43 | 44 | def get_next_phase(phase): 45 | """Get next full or new moon time.""" 46 | if phase == 0 or phase == 30 or phase == 15: 47 | return None 48 | NextPhase = collections.namedtuple("NextPhase", ["next_phase", "days"]) 49 | if phase < 15: 50 | NextPhase.days = int(15 - phase) 51 | NextPhase.next_phase = "Full Moon" 52 | return NextPhase 53 | if phase < 30: 54 | NextPhase.days = int(30 - phase) 55 | NextPhase.next_phase = "New Moon" 56 | return NextPhase 57 | 58 | 59 | def main(): 60 | """Run program if called directly.""" 61 | if len(sys.argv) == 2: 62 | user_date = sys.argv[1] 63 | else: 64 | now = datetime.datetime.now() 65 | user_date = (str(now.year) + "-" + str(now.month).zfill(2) + "-" + str(now.day).zfill(2)) 66 | phase = get_moon_phase(user_date) 67 | print(user_date + ": " + interpret_moon_phase(phase) + " (" + str(phase) + " days into cycle)") 68 | NextPhase = get_next_phase(phase) 69 | if NextPhase: 70 | print(NextPhase.next_phase + " in " + str(NextPhase.days) + " days.") 71 | 72 | if __name__ == "__main__": 73 | main() -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | dateutil 2 | icalevents 3 | lxml 4 | numpy 5 | pillow 6 | requests 7 | schedule 8 | vobject 9 | -------------------------------------------------------------------------------- /run_systemsix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd $(dirname $0) 3 | python3 ./systemsix.py -------------------------------------------------------------------------------- /settings.py: -------------------------------------------------------------------------------- 1 | # Edit this file to contain your personal settings. Below are just placeholder values. 2 | LOCALE = "en_US.UTF-8" 3 | 4 | LATITUDE = 41.2853 5 | LONGITUDE = -96.2050 6 | 7 | # Monday = 1, ... Sunday = 7; None = never show full; other value = random. 8 | TRASH_DAY = 1 9 | 10 | # See README.md on instructions to assign your WebDAV Calendar URL. 11 | WEBDAV_CALENDAR_URL = None 12 | WEBDAV_IS_APPLE = True 13 | -------------------------------------------------------------------------------- /settings.py.sample: -------------------------------------------------------------------------------- 1 | LOCALE = "en_US.UTF-8" 2 | 3 | # Latitude and longitude to get local weather data. 4 | LATITUDE = 41.2523 5 | LONGITUDE = -95.9979 6 | 7 | # Monday = 1, ... Sunday = 7; None = never show trash full; other value = random trash day. 8 | TRASH_DAY = 1 9 | 10 | # Settings for retrieving calendar data, see README.md for details. 11 | WEBDAV_CALENDAR_URL = "webcal://..." 12 | WEBDAV_IS_APPLE = True 13 | -------------------------------------------------------------------------------- /weather_module.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import logging 3 | import json 4 | import sys 5 | if (sys.version_info > (3,0)): 6 | import urllib.request 7 | else: 8 | import urllib 9 | import requests # conda install requests or pip install requests 10 | from settings import LATITUDE, LONGITUDE 11 | 12 | 13 | logger = logging.getLogger('app') 14 | 15 | # Global variables. 16 | forecast_url = None 17 | 18 | 19 | def get_forecast_URL_from_lat_long(latitude: int, longitude: int): 20 | """ 21 | Make a request to api.weather.gov specifying latitude and longitude. 22 | The response should give us, among other things, the URL for the local weather forecast. 23 | """ 24 | # Param check. 25 | if (latitude is None) or (longitude is None): 26 | logger.warning('weather_module.get_forecast_URL_from_lat_long(); missing latitude or longitude.') 27 | return None 28 | 29 | logger.info('weather_module.get_forecast_URL_from_lat_long(); trying...') 30 | api_url_base = 'https://api.weather.gov' 31 | current_obs_url = '{0}/points/{1},{2}'.format(api_url_base, latitude, longitude) 32 | response = requests.get(current_obs_url) 33 | if response.status_code == 200: 34 | forecast_data = json.loads(response.content.decode('utf-8')) 35 | if forecast_data['properties']['forecast']: 36 | logger.info('weather_module.get_forecast_URL_from_lat_long(); returning forecast URL.') 37 | return forecast_data['properties']['forecast'] 38 | else: 39 | logger.warning('weather_module.get_forecast_URL_from_lat_long(); no URL to return.') 40 | return None 41 | else: 42 | logger.warning('[?] Unexpected Error: [HTTP {0}]: Content: {1}'.format(response.status_code, response.content)) 43 | return None 44 | 45 | 46 | def get_weather_forecast_from_URL(forecast_URL: str): 47 | """ 48 | Make a request to api.weather.gov using a URL that should return local the weather forecast. 49 | We trim down the response and return only the list of 'periods' for the weather forecast. 50 | The 'periods' seem to be in pairs corresponding to day and night forecasts for the coming days. 51 | """ 52 | 53 | # Param check. 54 | if forecast_URL is None: 55 | logger.warning('weather_module.get_weather_forecast_from_URL(); missing URL.') 56 | return None 57 | 58 | logger.info("weather_module.get_weather_forecast_from_URL(); trying....") 59 | response = requests.get(forecast_URL) 60 | if response.status_code == 200: 61 | forecast_data = json.loads(response.content.decode('utf-8')) 62 | if forecast_data['properties']['periods']: 63 | logger.info("weather_module.get_weather_forecast_from_URL(); got forecast data.") 64 | return forecast_data['properties']['periods'] 65 | else: 66 | logger.info("weather_module.get_weather_forecast_from_URL(); no data to return.") 67 | return None 68 | else: 69 | logger.warning('[?] Unexpected Error: [HTTP {0}]: Content: {1}'.format(response.status_code, response.content)) 70 | return None 71 | 72 | 73 | def get_weather_forecast(): 74 | """ 75 | Calls above functions to get a list of 'period' weather forecast data from api.weather.gov. 76 | LATITUDE and LONGITUDE are expected to be present in a settings.py file. 77 | """ 78 | 79 | global forecast_url 80 | 81 | # Get the forecast URL from latitude and longitude. 82 | if forecast_url is None: 83 | forecast_url = get_forecast_URL_from_lat_long(LATITUDE, LONGITUDE) 84 | 85 | # Get current forecast periods. 86 | return get_weather_forecast_from_URL(forecast_url) 87 | 88 | --------------------------------------------------------------------------------