diff --git a/configs/stm32f429i-disco/Kconfig b/configs/stm32f429i-disco/Kconfig index dddb2a5d11..f79ec5ac98 100644 --- a/configs/stm32f429i-disco/Kconfig +++ b/configs/stm32f429i-disco/Kconfig @@ -133,4 +133,45 @@ config PM_SLEEP_WAKEUP_NSEC ---help--- Number of additional nanoseconds to wait in PM_SLEEP before going to PM_STANDBY mode. +config STM32F429I_DISCO_ILI9341 + bool "LCD driver for ILI9341 Liquid Crystal Display Controller" + default n + ---help--- + Enables support for a connected display based on ili9341 LCD Single Chip + Driver. This sub driver supports only communication with the display driver + connected via 4-wire serial (spi) mcu interface. + +config STM32F429I_DISCO_ILI9341_SPIFREQUENCY + int "SPI frequency" + default 12000000 + depends on STM32F429I_DISCO_ILI9341 + ---help--- + Define the bus freqency of the spi device. + +config STM32F429I_DISCO_ILI9341_SPIBITS16 + bool "Enable 16 bit pixel read/write" + default n + depends on STM32F429I_DISCO_ILI9341 + ---help--- + This enables faster 16-bit spi mode for transmitting or receiving pixel data + to or from the display gram. But uses default 8-bit spi mode for all other + display operations. + +config STM32F429I_DISCO_ILI9341_LCDIFACE + bool "Enable support for nuttx lcd interface" + default n + depends on STM32F429I_DISCO_ILI9341 && LCD_ILI9341 + ---help--- + Enable lcd driver support for the nuttx lcd interface. + +config STM32F429I_DISCO_ILI9341_LCDDEVICE + int "LCD interface" + default 0 + range 0 1 + depends on STM32F429I_DISCO_ILI9341_LCDIFACE + ---help--- + Define the lcd interface which should be used. This must be + corresponding to the configured ili9341 lcd device in the driver + section. + endif diff --git a/configs/stm32f429i-disco/src/Makefile b/configs/stm32f429i-disco/src/Makefile index 126dee35ed..aa69b1d33e 100644 --- a/configs/stm32f429i-disco/src/Makefile +++ b/configs/stm32f429i-disco/src/Makefile @@ -72,6 +72,14 @@ ifeq ($(CONFIG_STM32_OTGFHS),y) CSRCS += stm32_usb.c endif +ifeq ($(CONFIG_STM32F429I_DISCO_ILI9341),y) +CSRCS += stm32_ili93414ws.c +endif + +ifeq ($(CONFIG_STM32F429I_DISCO_ILI9341_LCDIFACE),y) +CSRCS += stm32_lcd.c +endif + ifeq ($(CONFIG_ARCH_FPU),y) CSRCS += stm32_ostest.c endif diff --git a/configs/stm32f429i-disco/src/stm32_spi.c b/configs/stm32f429i-disco/src/stm32_spi.c index 67e6ee02ce..2cda281789 100644 --- a/configs/stm32f429i-disco/src/stm32_spi.c +++ b/configs/stm32f429i-disco/src/stm32_spi.c @@ -2,7 +2,8 @@ * configs/stm32f429i-disco/src/stm32_spi.c * * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Authors: Gregory Nutt + * Marco Krahl * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -189,7 +190,7 @@ void stm32_spi5select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sele { spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); -#if defined(CONFIG_STM32_LTDC) +#if defined(CONFIG_STM32F429I_DISCO_ILI9341) if (devid == SPIDEV_DISPLAY) { stm32_gpiowrite(GPIO_CS_LCD, !selected); @@ -263,16 +264,15 @@ int stm32_spi4cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd) #ifdef CONFIG_STM32_SPI5 int stm32_spi5cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd) { -#if defined(CONFIG_STM32_LTDC) +#if defined(CONFIG_STM32F429I_DISCO_ILI9341) if (devid == SPIDEV_DISPLAY) { - /* "This is the Data/Command control pad which determines whether the + /* This is the Data/Command control pad which determines whether the * data bits are data or a command. */ -# if defined(CONFIG_STM32_LTDC) (void)stm32_gpiowrite(GPIO_LCD_DC, !cmd); -# endif + return OK; } #endif