Lightweight status screen for ST7920

- This status screen uses the ST7920 character generator to greatly reduce SPI traffic and MCU load when updating the status screen.

- Has been tested with the RepRapDiscount Full Graphics Smart Controller but should work with any LCD that uses an ST7920 or fully compatible controller.
This commit is contained in:
Scott Lahteine
2018-02-22 00:03:40 -06:00
parent 967076b080
commit 1c95c13224
9 changed files with 1506 additions and 431 deletions

View File

@@ -119,10 +119,12 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo
ST7920_CS();
u8g_Delay(120); //initial delay for boot up
ST7920_SET_CMD();
ST7920_WRITE_BYTE(0x20); //non-extended mode
ST7920_WRITE_BYTE(0x08); //display off, cursor+blink off
ST7920_WRITE_BYTE(0x01); //clear CGRAM ram
u8g_Delay(15); //delay for CGRAM clear
ST7920_WRITE_BYTE(0x3E); //extended mode + GDRAM active
ST7920_WRITE_BYTE(0x01); //clear DDRAM ram
u8g_Delay(15); //delay for DDRAM clear
ST7920_WRITE_BYTE(0x24); //extended mode
ST7920_WRITE_BYTE(0x26); //extended mode + GDRAM active
for (y = 0; y < (LCD_PIXEL_HEIGHT) / 2; y++) { //clear GDRAM
ST7920_WRITE_BYTE(0x80 | y); //set y
ST7920_WRITE_BYTE(0x80); //set x = 0
@@ -181,6 +183,12 @@ class U8GLIB_ST7920_128X64_RRD : public U8GLIB {
U8GLIB_ST7920_128X64_RRD(uint8_t dummy) : U8GLIB(&u8g_dev_st7920_128x64_rrd_sw_spi) { UNUSED(dummy); }
};
#if ENABLED(LIGHTWEIGHT_UI)
// We have to include the code for the lightweight UI here
// as it relies on macros that are only defined in this file.
#include "status_screen_lite_ST7920_spi.h"
#endif
#pragma GCC reset_options
#endif // ULCDST7920_H