From 154b456f1191b77b94482dd7e17b14be939cceb1 Mon Sep 17 00:00:00 2001 From: devsaurus Date: Thu, 17 Sep 2015 22:37:31 +0200 Subject: [PATCH] extend ucg example with ST7735 display --- app/include/ucg_config.h | 1 + lua_examples/ucglib/GraphicsTest.lua | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/include/ucg_config.h b/app/include/ucg_config.h index 91b580f5..2620a50b 100644 --- a/app/include/ucg_config.h +++ b/app/include/ucg_config.h @@ -39,6 +39,7 @@ #define UCG_DISPLAY_TABLE_ENTRY(binding, device, extension) #define UCG_DISPLAY_TABLE \ UCG_DISPLAY_TABLE_ENTRY(ili9341_18x240x320_hw_spi, ucg_dev_ili9341_18x240x320, ucg_ext_ili9341_18) \ + UCG_DISPLAY_TABLE_ENTRY(st7735_18x128x160_hw_spi, ucg_dev_st7735_18x128x160, ucg_ext_st7735_18) \ #undef UCG_DISPLAY_TABLE_ENTRY // diff --git a/lua_examples/ucglib/GraphicsTest.lua b/lua_examples/ucglib/GraphicsTest.lua index ebb9795b..f3c94a28 100644 --- a/lua_examples/ucglib/GraphicsTest.lua +++ b/lua_examples/ucglib/GraphicsTest.lua @@ -9,7 +9,11 @@ function init_spi_display() local res = 0 -- GPIO16 spi.setup(1, spi.MASTER, spi.CPOL_LOW, spi.CPHA_LOW, spi.DATABITS_8, 0) - disp = ucg.ili9341_18x240x320_hw_spi(cs, dc, res) + + -- initialize the matching driver for your display + -- see app/include/ucg_config.h + --disp = ucg.ili9341_18x240x320_hw_spi(cs, dc, res) + disp = ucg.st7735_18x128x160_hw_spi(cs, dc, res) end