You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Dave Marples <da...@marples.net> on 2020/01/28 12:46:26 UTC

Generic SPI interface to LCD

Greg,

Here's a patch^h^h^h^h^htxt which allows the use of a generic spi 
interface for controlling an LCD display.  It has been tested with the 
ili9341 but should work with others without too much pain...hopefully 
this will be useful to Ben, who I know has been looking for such a thing.

To use it;

1) include nuttx/lcd/lcddrv_spiif.h

2) Create an spi device;

struct spi_dev_s *g_bound_spi  = imxrt_spi_register(2);

3) Instantiate the interface;

struct lcddrv_lcd_s *dev = lcddrv_spiif_initialize( g_bound_spi );

4) Bind the interface to the lcd;

g_lcd = ili9341_initialize((struct ili9341_lcd_s *)dev, 
CONFIG_IMXRT_VB_ILI9341_LCDDEVICE);

You should then be able to use the lcd as normal. Comments and brickbats 
welcome.

Regards

DAVE