extend ucg example with ST7735 display

This commit is contained in:
devsaurus 2015-09-17 22:37:31 +02:00
parent db1162015d
commit 154b456f11
2 changed files with 6 additions and 1 deletions

View File

@ -39,6 +39,7 @@
#define UCG_DISPLAY_TABLE_ENTRY(binding, device, extension) #define UCG_DISPLAY_TABLE_ENTRY(binding, device, extension)
#define UCG_DISPLAY_TABLE \ #define UCG_DISPLAY_TABLE \
UCG_DISPLAY_TABLE_ENTRY(ili9341_18x240x320_hw_spi, ucg_dev_ili9341_18x240x320, ucg_ext_ili9341_18) \ 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 #undef UCG_DISPLAY_TABLE_ENTRY
// //

View File

@ -9,7 +9,11 @@ function init_spi_display()
local res = 0 -- GPIO16 local res = 0 -- GPIO16
spi.setup(1, spi.MASTER, spi.CPOL_LOW, spi.CPHA_LOW, spi.DATABITS_8, 0) 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 end