FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno) { FAR struct spi_dev_s *spi; FAR struct lcd_dev_s *dev; /* Configure the LCD GPIOs */ lcd_dumpgpio("up_nxdrvinit: On entry"); lpc17_configgpio(LPC1766STK_LCD_RST); lpc17_configgpio(LPC1766STK_LCD_BL); lcd_dumpgpio("up_nxdrvinit: After GPIO setup"); /* Reset the LCD */ lpc17_gpiowrite(LPC1766STK_LCD_RST, false); up_udelay(10); lpc17_gpiowrite(LPC1766STK_LCD_RST, true); up_mdelay(5); /* Configure PWM1 to support the backlight */ nokia_blinitialize(); /* Get the SSP port (configure as a Freescale SPI port) */ spi = up_spiinitialize(0); if (!spi) { glldbg("Failed to initialize SSP port 0\n"); } else { /* Bind the SSP port to the LCD */ dev = nokia_lcdinitialize(spi, devno); if (!dev) { glldbg("Failed to bind SSP port 0 to LCD %d: %d\n", devno); } else { gllvdbg("Bound SSP port 0 to LCD %d\n", devno); /* And turn the LCD on (CONFIG_LCD_MAXPOWER should be 1) */ (void)dev->setpower(dev, CONFIG_LCD_MAXPOWER); return dev; } } return NULL; }
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno) { FAR struct spi_dev_s *spi; FAR struct lcd_dev_s *dev; /* Configure the OLED GPIOs. For the SPI interface, insert jumpers in J42, * J43, J45 pin1-2 and J46 pin 1-2. */ oledcs_dumpgpio("up_nxdrvinit: After OLED CS setup"); oleddc_dumpgpio("up_nxdrvinit: On entry"); (void)lpc17_configgpio(LPCXPRESSO_OLED_POWER); /* OLED 11V power */ (void)lpc17_configgpio(LPCXPRESSO_OLED_DC); /* OLED Command/Data */ oleddc_dumpgpio("up_nxdrvinit: After OLED Power/DC setup"); /* Get the SSI port (configure as a Freescale SPI port) */ spi = up_spiinitialize(1); if (!spi) { glldbg("Failed to initialize SSI port 1\n"); } else { /* Bind the SSI port to the OLED */ dev = ug_initialize(spi, devno); if (!dev) { glldbg("Failed to bind SSI port 1 to OLED %d: %d\n", devno); } else { gllvdbg("Bound SSI port 1 to OLED %d\n", devno); /* And turn the OLED on (dim) */ (void)dev->setpower(dev, UG_POWER_DIM); return dev; } } return NULL; }
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) { FAR struct spi_dev_s *spi; FAR struct lcd_dev_s *dev; /* Configure the OLED GPIOs */ oledcs_dumpgpio("board_graphics_setup: After OLEDCS setup"); oleddc_dumpgpio("board_graphics_setup: On entry"); tiva_configgpio(OLEDDC_GPIO); /* PC7: OLED display data/control select (D/Cn) */ tiva_configgpio(OLEDEN_GPIO); /* PC6: Enable +15V needed by OLED (EN+15V) */ oleddc_dumpgpio("board_graphics_setup: After OLEDDC/EN setup"); /* Get the SSI port (configure as a Freescale SPI port) */ spi = up_spiinitialize(0); if (!spi) { glldbg("Failed to initialize SSI port 0\n"); } else { /* Bind the SSI port to the OLED */ dev = rit_initialize(spi, devno); if (!dev) { glldbg("Failed to bind SSI port 0 to OLED %d: %d\n", devno); } else { gllvdbg("Bound SSI port 0 to OLED %d\n", devno); /* And turn the OLED on (CONFIG_LCD_MAXPOWER should be 1) */ (void)dev->setpower(dev, CONFIG_LCD_MAXPOWER); return dev; } } return NULL; }
FAR struct lcd_dev_s *board_lcd_getdev(int lcddev) { g_lcddev = st7567_initialize(g_spidev, lcddev); if (!g_lcddev) { glldbg("Failed to bind SSI port 0 to OLCD %d: %d\n", lcddev); } else { gllvdbg("Bound SSI port 0 to OLCD %d\n", lcddev); /* And turn the OLCD on (CONFIG_LCD_MAXPOWER should be 1) */ (void)g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); return g_lcddev; } return NULL; }
int board_lcd_initialize(void) { lpc17_configgpio(ZKITARM_OLED_RST); lpc17_configgpio(ZKITARM_OLED_RS); lpc17_gpiowrite(ZKITARM_OLED_RST, 1); lpc17_gpiowrite(ZKITARM_OLED_RS, 1); zkit_sspdev_initialize(); g_spidev = lpc17_sspbus_initialize(0); if (!g_spidev) { glldbg("Failed to initialize SSP port 0\n"); return 0; } lpc17_gpiowrite(ZKITARM_OLED_RST, 0); up_mdelay(1); lpc17_gpiowrite(ZKITARM_OLED_RST, 1); return 1; }
int up_lcdinitialize(void) { lpc17_configgpio(ZKITARM_OLED_RST); lpc17_configgpio(ZKITARM_OLED_RS); lpc17_gpiowrite(ZKITARM_OLED_RST, 1); lpc17_gpiowrite(ZKITARM_OLED_RS, 1); zkit_sspinitialize(); spi = lpc17_sspinitialize(0); if (!spi) { glldbg("Failed to initialize SSP port 0\n"); return 0; } lpc17_gpiowrite(ZKITARM_OLED_RST, 0); up_mdelay(1); lpc17_gpiowrite(ZKITARM_OLED_RST, 1); return 1; }