drivers: remove lcd stubs
authorsunghan <sh924.chang@samsung.com>
Wed, 20 Sep 2017 10:08:40 +0000 (19:08 +0900)
committersunghan <sh924.chang@samsung.com>
Wed, 20 Sep 2017 10:08:40 +0000 (19:08 +0900)
The lcd is imcomplete and unnecessary. Let's remove it.

os/drivers/Kconfig
os/drivers/Makefile
os/drivers/lcd/Kconfig [deleted file]
os/drivers/lcd/Make.defs [deleted file]
os/drivers/lcd/ili9341.c [deleted file]
os/include/tinyara/lcd/ili9341.h [deleted file]

index b391645..40e7650 100644 (file)
@@ -357,22 +357,6 @@ if ANALOG
 source drivers/analog/Kconfig
 endif # ANALOG
 
-menuconfig LCD
-       bool "LCD Driver Support"
-       default n
-       select NX_LCDDRIVER
-       ---help---
-               Drivers for parallel and serial LCD and OLED type devices.  These
-               drivers support interfaces as defined in include/tinyara/lcd/lcd.h
-
-               This selection is necessary to enable support for LCD drivers in
-               drivers/lcd as well as for board-specific LCD drivers in the configs/
-               subdirectories.
-
-if LCD
-source drivers/lcd/Kconfig
-endif # LCD
-
 menuconfig NETDEVICES
        bool "Network Device/PHY Support"
        default n if !ARCH_HAVE_PHY
index 0154f7d..2e7a769 100644 (file)
@@ -70,7 +70,6 @@ include analog$(DELIM)Make.defs
 include bch$(DELIM)Make.defs
 include i2c$(DELIM)Make.defs
 include audio$(DELIM)Make.defs
-include lcd$(DELIM)Make.defs
 include net$(DELIM)Make.defs
 include pipes$(DELIM)Make.defs
 include power$(DELIM)Make.defs
diff --git a/os/drivers/lcd/Kconfig b/os/drivers/lcd/Kconfig
deleted file mode 100644 (file)
index 3239efb..0000000
+++ /dev/null
@@ -1,378 +0,0 @@
-#
-# For a description of the syntax of this configuration file,
-# see kconfig-language at https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt
-#
-
-comment "Common LCD Settings"
-
-config LCD_NOGETRUN
-       bool "Write-only LCD"
-       default n
-       ---help---
-               Many LCD hardware interfaces provide only minimal graphics capability.  In
-               particulary, many simple LCD interfaces are write only.  That is we, can
-               write graphics data to the LCD device memory, but we cannot read it back.
-               If the LCD hardware does not support reading the graphics memory, then
-               this option should be defined so that the NX layer can taking alternative
-               measures when the LCD is not readable.  For example, if the LCD is not
-               readable, then NX will not attempt to support transparency.
-
-               See also NX_WRITEONLY in the graphics support menu.
-
-config LCD_MAXCONTRAST
-       int "LCD maximum contrast"
-       default 63 if NOKIA6100_S1D15G10 || LCD_SHARP_MEMLCD
-       default 127 if NOKIA6100_PCF8833
-       default 255 if LCD_P14201 || LCD_LCD1602
-       default 63
-       range 1 255
-       ---help---
-               must be 63 with the Epson controller and 127 with
-               the Phillips controller.
-
-config LCD_MAXPOWER
-       int "LCD maximum power"
-       default 255 if LCD_LCD1602
-       default 1
-       range 1 255
-       ---help---
-               Maximum value of LCD power setting.  This normally equates to brightness:
-               The brighter the screen, the hight the power usage.
-
-               On LCDs that have a backlight, this value corresponds directly to that
-               backlight setting.  Board-specific logic may place restrictions on this
-               value.
-
-comment "Graphic LCD Devices"
-
-
-
-config LCD_ST7567
-       bool "ST7567 LCD Display Module"
-       default n
-       ---help---
-               LCD Display Module, ST7567, Univision Technology Inc.  Used
-               with the LPCXpresso and Embedded Artists base board.
-
-               Required LCD driver settings:
-               LCD_MAXCONTRAST should be 255, but any value >0 and <=255 will be accepted.
-               LCD_MAXPOWER should be 1:  0=off, 1=on
-
-               Required SPI driver settings:
-               SPI_CMDDATA - Include support for cmd/data selection.
-
-if LCD_ST7567
-
-config ST7567_SPIMODE
-       int "ST7567 SPI Mode"
-       default 0
-       range 0 3
-       ---help---
-               Controls the SPI mode
-
-config ST7567_FREQUENCY
-       int "ST7567 SPI Frequency"
-       default 3500000
-       ---help---
-               Define to use a different bus frequency
-
-config ST7567_NINTERFACES
-       int "Number of ST7567 Devices"
-       default 1
-       ---help---
-               Specifies the number of physical ST7567 devices that will be
-               supported.  NOTE:  At present, this must be undefined or defined to be 1.
-
-config ST7567_POWER
-       bool "Power control"
-       default n
-       ---help---
-               If the hardware supports a controllable LCD a power supply, this
-               configuration should be defined.  In this case the system must
-               provide an interface ug_power().
-
-config ST7567_XRES
-       int "ST7567 X Resolution"
-       default 128
-       ---help---
-               Specifies the X resolution of the LCD.
-
-config ST7567_YRES
-       int "ST7567 Y Resolution"
-       default 64
-       ---help---
-               Specifies the Y resolution of the LCD.
-
-endif # LCD_ST7567
-
-config LCD_UG2864AMBAG01
-       bool "UG-2864AMBAG01 OLED Display Module"
-       default n
-       ---help---
-               OLED Display Module, UG-2864AMBAG01, Univision Technology Inc.
-
-               Required LCD driver settings:
-               LCD_MAXCONTRAST should be 255, but any value >0 and <=255 will be accepted.
-               LCD_MAXPOWER should be 1:  0=off, 1=on
-
-               Required SPI driver settings:
-               SPI_CMDDATA - Include support for cmd/data selection.
-
-if LCD_UG2864AMBAG01
-
-config UG2864AMBAG01_SPIMODE
-       int "UG-2864AMBAG01 SPI Mode"
-       default 3
-       range 0 3
-       ---help---
-               Controls the SPI mode
-
-config UG2864AMBAG01_FREQUENCY
-       int "UG-2864AMBAG01 SPI Frequency"
-       default 3500000
-       ---help---
-               Define to use a different bus frequency
-
-config UG2864AMBAG01_NINTERFACES
-       int "Number of UG-2864AMBAG01 Devices"
-       default 1
-       ---help---
-               Specifies the number of physical UG-9664HSWAG01 devices that will be
-               supported.  NOTE:  At present, this must be undefined or defined to be 1.
-
-endif
-
-config LCD_SSD1289
-       bool "LCD Based on SSD1289 Controller"
-       default n
-       ---help---
-               Enables generic support for any LCD based on the Solomon Systech,
-               Ltd, SSD1289 Controller.  Use of this driver will usually require so
-               detailed customization of the LCD initialization code as necessary
-               for the specific LCD driven by the SSD1289 controller.
-
-if LCD_SSD1289
-
-choice
-       prompt "SSD1289 Initialization Profile"
-       default SSD1289_PROFILE1
-
-config SSD1289_PROFILE1
-       bool "Profile 1"
-
-config SSD1289_PROFILE2
-       bool "Profile 2"
-
-config SSD1289_PROFILE3
-       bool "Profile 3"
-
-endchoice
-endif
-
-config LCD_SHARP_MEMLCD
-       bool "Sharp Memory LCD Suite"
-       default n
-       ---help---
-               memlcd.c. Driver for Sharp Memory LCD Suite.
-
-if LCD_SHARP_MEMLCD
-
-choice MEMLCD_MODEL
-       prompt "Choose Model"
-       default MEMLCD_LS013B7DH03
-
-config MEMLCD_LS013B7DH01
-       bool "LS013B7DH01"
-       ---help---
-               Selects the LS013B7DH01 model
-
-config MEMLCD_LS013B7DH03
-       bool "LS013B7DH03"
-       ---help---
-               Selects the LS013B7DH03 model
-
-endchoice
-
-config MEMLCD_NINTERFACES
-       int "Number of physical Memory LCD devices"
-       default 1
-       range 1 1
-       ---help---
-               Specifies the number of physical Memory LCD devices that will
-               be supported.
-
-config MEMLCD_EXTCOMIN_MODE_HW
-       bool "Use hardware mode for EXTCOMIN"
-       default n
-       ---help---
-               If use hardware mode to toggle VCOM, we need to send specific
-               command at a constant frequency to trigger the LCD intenal
-               hardware logic.  While use software mode, we set up a timer to
-               toggle EXTCOMIN connected IO, basically, it is a hardware
-               timer to ensure a constant frequency.
-
-config MEMLCD_SPI_FREQUENCY
-       int "SPI frequency"
-       default 3500000
-       ---help---
-               Define to use a different bus frequency, FIXME DEFAULT VALUE OK?
-
-endif
-
-choice
-       prompt "LCD Orientation"
-       default LCD_LANDSCAPE
-       depends on LCD
-       ---help---
-               Some LCD drivers may support displays in different orientations.
-               If the LCD driver supports this capability, than these are configuration
-               options to select that display orientation.
-
-config LCD_LANDSCAPE
-       bool "Landscape orientation"
-       ---help---
-               Define for "landscape" orientation support.  Landscape mode refers one
-               of two orientations where the display is wider than it is tall
-               (LCD_RLANDSCAPE is the other).  This is the default orientation.
-
-config LCD_PORTRAIT
-       bool "Portrait orientation"
-       ---help---
-               Define for "portrait" orientation support.  Portrait mode refers one
-               of two orientations where the display is taller than it is wide
-               (LCD_RPORTAIT is the other).
-
-config LCD_RPORTRAIT
-       bool "Reverse portrait display"
-       ---help---
-               Define for "reverse portrait" orientation support.  Reverse portrait mode
-               refers one of two orientations where the display is taller than it is
-               wide (LCD_PORTAIT is the other).
-
-config LCD_RLANDSCAPE
-       bool "Reverse landscape orientation"
-       ---help---
-               Define for "reverse landscape" orientation support.  Reverse landscape mode
-               refers one of two orientations where the display is wider than it is
-               tall (LCD_LANDSCAPE is the other).
-
-endchoice
-
-config LCD_ILI9341
-       bool "ILI9341 LCD Single Chip Driver"
-       default n
-       ---help---
-               LCD Single Chip Driver, ILI9341, ILI Technology Corp. Used
-               with the STM32F429i Discovery Board.
-
-               Required LCD driver settings:
-               LCD_MAXCONTRAST should be 255, but any value >0 and <=255 will be accepted.
-               LCD_MAXPOWER should be 1:  0=off, 1=on
-
-config LCD_ILI9341_NINTERFACES
-       int "Number of supported display driver"
-       range 1 2
-       default 1
-    depends on LCD_ILI9341
-       ---help---
-               Define the number of supported  displays driven by a ili9341 LCD Single
-               Chip Driver.
-
-config LCD_ILI9341_IFACE0
-       bool "(1) LCD Display"
-       depends on LCD_ILI9341_NINTERFACES = 1 || LCD_ILI9341_NINTERFACES = 2
-       ---help---
-               Configure first LCD Display.
-
-if LCD_ILI9341_IFACE0
-choice
-       prompt "LCD Orientation"
-       default LCD_ILI9341_IFACE0_LANDSCAPE
-       ---help---
-               Configure display orientation.
-
-config LCD_ILI9341_IFACE0_LANDSCAPE
-       bool "Landscape orientation"
-       ---help---
-               Define for "landscape" orientation support.
-
-config LCD_ILI9341_IFACE0_PORTRAIT
-       bool "Portrait orientation"
-       ---help---
-               Define for "portrait" orientation support.
-
-config LCD_ILI9341_IFACE0_RLANDSCAPE
-       bool "Reverse landscape orientation"
-       ---help---
-               Define for "reverse landscape" orientation support.
-
-config LCD_ILI9341_IFACE0_RPORTRAIT
-       bool "Reverse portrait display"
-       ---help---
-               Define for "reverse portrait" orientation support.
-
-endchoice
-
-choice
-       prompt "Color format"
-       default LCD_ILI9341_IFACE0_RGB565
-       ---help---
-               LCD color format.
-
-config LCD_ILI9341_IFACE0_RGB565
-       bool "16 bpp RGB565 color format"
-       ---help---
-               16 bpp RGB565 color format
-
-endchoice
-endif
-
-config LCD_ILI9341_IFACE1
-       bool "(2) LCD Display"
-       depends on LCD_ILI9341_NINTERFACES = 2
-       ---help---
-               Configure second LCD Display.
-
-if LCD_ILI9341_IFACE1
-choice
-       prompt "LCD Orientation"
-       default LCD_ILI9341_IFACE1_LANDSCAPE
-       ---help---
-               Configure display orientation.
-
-config LCD_ILI9341_IFACE1_LANDSCAPE
-       bool "Landscape orientation"
-       ---help---
-               Define for "landscape" orientation support.
-
-config LCD_ILI9341_IFACE1_PORTRAIT
-       bool "Portrait orientation"
-       ---help---
-               Define for "portrait" orientation support.
-
-config LCD_ILI9341_IFACE1_RLANDSCAPE
-       bool "Reverse landscape orientation"
-       ---help---
-               Define for "reverse landscape" orientation support.
-
-config LCD_ILI9341_IFACE1_RPORTRAIT
-       bool "Reverse portrait display"
-       ---help---
-               Define for "reverse portrait" orientation support.
-
-endchoice
-
-choice
-       prompt "Color format"
-       default LCD_ILI9341_IFACE1_RGB565
-       ---help---
-               LCD color format.
-
-config LCD_ILI9341_IFACE1_RGB565
-       bool "16 bpp RGB565 color format"
-       ---help---
-               16 bpp RGB565 color format
-
-endchoice
-endif
-
diff --git a/os/drivers/lcd/Make.defs b/os/drivers/lcd/Make.defs
deleted file mode 100644 (file)
index d54ce8a..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-###########################################################################
-#
-# Copyright 2016 Samsung Electronics All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
-# either express or implied. See the License for the specific
-# language governing permissions and limitations under the License.
-#
-###########################################################################
-############################################################################
-# drivers/lcd/Make.defs
-#
-#   Copyright (C) 2010-2012 Gregory Nutt. All rights reserved.
-#   Author: Gregory Nutt <gnutt@nuttx.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in
-#    the documentation and/or other materials provided with the
-#    distribution.
-# 3. Neither the name NuttX nor the names of its contributors may be
-#    used to endorse or promote products derived from this software
-#    without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-############################################################################
-
-# Don't build anything if there is no NX support for LCD drivers
-
-ifeq ($(CONFIG_NX_LCDDRIVER),y)
-
-# Include LCD drivers
-
-ifeq ($(CONFIG_LCD_P14201),y)
-  CSRCS += p14201.c
-endif
-
-ifeq ($(CONFIG_LCD_NOKIA6100),y)
-  CSRCS += nokia6100.c
-endif
-
-ifeq ($(CONFIG_LCD_UG2864AMBAG01),y)
-  CSRCS += ug-2864ambag01.c
-endif
-
-ifeq ($(CONFIG_LCD_UG9664HSWAG01),y)
-  CSRCS += ug-9664hswag01.c
-endif
-
-ifeq ($(CONFIG_LCD_SSD1306),y)
-  CSRCS += ssd1306.c
-endif
-
-ifeq ($(CONFIG_LCD_SSD1289),y)
-  CSRCS += ssd1289.c
-endif
-
-ifeq ($(CONFIG_LCD_MIO283QT2),y)
-  CSRCS += mio283qt2.c
-endif
-
-ifeq ($(CONFIG_LCD_MIO283QT9A),y)
-  CSRCS += mio283qt9a.c
-endif
-
-ifeq ($(CONFIG_LCD_ST7565),y)
-  CSRCS += st7565.c
-endif
-
-ifeq ($(CONFIG_LCD_ST7567),y)
-  CSRCS += st7567.c
-endif
-
-ifeq ($(CONFIG_LCD_SHARP_MEMLCD),y)
-  CSRCS += memlcd.c
-endif
-
-ifeq ($(CONFIG_LCD_ILI9341),y)
-  CSRCS += ili9341.c
-endif
-
-# Include LCD driver build support
-
-DEPPATH += --dep-path lcd
-VPATH += :lcd
-CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)lcd}
-endif
-
diff --git a/os/drivers/lcd/ili9341.c b/os/drivers/lcd/ili9341.c
deleted file mode 100644 (file)
index 9cacbf9..0000000
+++ /dev/null
@@ -1,1223 +0,0 @@
-/****************************************************************************
- *
- * Copyright 2016 Samsung Electronics All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- ****************************************************************************/
-/******************************************************************************
- * drivers/lcd/ili9341.c
- *
- * LCD driver for the ILI9341 LCD Single Chip Driver
- *
- *   Copyright (C) 2014 Marco Krahl. All rights reserved.
- *   Author: Marco Krahl <ocram.lhark@gmail.com>
- *
- * References: ILI9341_DS_V1.10.pdf (Rev: 1.10), "a-Si TFT LCD Single Chip
- *             Driver 240RGBx320 Resolution and 262K color",
- *             ILI TECHNOLOGY CORP., http://www.ilitek.com.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- *    used to endorse or promote products derived from this software
- *    without specific prior writen permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ******************************************************************************/
-
-/******************************************************************************
- * Included Files
- ******************************************************************************/
-
-#include <tinyara/config.h>
-
-#include <sys/types.h>
-#include <stdint.h>
-#include <stdbool.h>
-#include <string.h>
-#include <errno.h>
-#include <debug.h>
-
-#include <tinyara/arch.h>
-#include <tinyara/lcd/lcd.h>
-#include <tinyara/lcd/ili9341.h>
-
-#include <arch/irq.h>
-
-/******************************************************************************
- * Pre-processor Definitions
- ******************************************************************************/
-
-/*
- * This is the generic lcd driver interface for the ili9341 Single Chip LCD
- * driver. The driver supports multiple displays, each connected with an own
- * ili9341 Single Chip LCD driver. The communication with the LCD single chip
- * driver must be provide by a subdriver accessable trough the ili9341_dev_s
- * structure which is platform and MCU interface specific.
- *
- * Supported MCU interfaces (planed to support)
- *
- * Interface I
- *
- * 8080 MCU 8-bit bus interface
- * 8080 MCU 16-bit bus interface
- * 8080 MCU 9-bit bus interface
- * 8080 MCU 18-bit bus interface
- * 3-wire 9-bit data serial interface
- * 4-wire 8-bit data serial interface
- *
- * Interface II
- *
- * 8080 MCU 8-bit bus interface
- * 8080 MCU 16-bit bus interface
- * 8080 MCU 9-bit bus interface
- * 8080 MCU 18-bit bus interface
- * 3-wire 9-bit data serial Interface
- * 4-wire 8-bit data serial Interface
- *
- * Note! RGB interface will not supported by the lcd driver.
- * It should be use with the platform specific RGB grapic controller and the
- * TinyAra framebuffer interface.
- *
- */
-
-/* Fundamental command and parameter definition */
-
-/* Interface control (IFCTL)
- *
- *
- * Parameter 1:  0x0001
- *
- * MY_EOR:  0
- * MX_EOR:  0
- * MV_EOR:  0
- * BGR_EOR: 0
- * WEMODE:  1   Reset column and page if data transfer exceeds
- */
-#define ILI9341_IFCTL_MYEOR     0
-#define ILI9341_IFCTL_MXEOR     0
-#define ILI9341_IFCTL_MVEOR     0
-#define ILI9341_IFCTL_BGREOR    0
-#define ILI9341_IFCTL_WEMODE    ILI9341_INTERFACE_CONTROL_WEMODE
-
-#define ILI9341_IFCTL_PARAM1    ILI9341_IFCTL_MYEOR | ILI9341_IFCTL_MXEOR | \
-                                                               ILI9341_IFCTL_MVEOR | ILI9341_IFCTL_BGREOR | \
-                                                               ILI9341_IFCTL_WEMODE
-
-/* Parameter 2: 0x0000
- *
- * EPF:     0   65k color format for RGB interface, not used set to default
- * MDT:     0   Display data transfer mode, not used
- *
- * Note! If RGB666 and 16-bit 8080-I interface supported by the driver, MDT must
- * be defined for each selected driver instance. Leave it empty for now.
- */
-
-#define ILI9341_IFCTL_EPF       ILI9341_INTERFACE_CONTROL_EPF(0)
-#define ILI9341_IFCTL_MDT       ILI9341_INTERFACE_CONTROL_MDT(0)
-
-#define ILI9341_IFCTL_PARAM2    ILI9341_IFCTL_EPF | ILI9341_IFCTL_MDT
-
-/* Parameter 3: 0x0000/0x0020
- *
- * ENDIAN:  0/1 Depending on endian mode of the mcu?
- * DM:      0   Internal clock operation
- * RM:      0   System interface/VSYNC interface
- * RIM:     0   RGB interface mode, unimportant set to default
- *
- */
-
-#ifdef CONFIG_ENDIAN_BIG
-#define ILI9341_IFCTL_ENDIAN  0
-#else
-#define ILI9341_IFCTL_ENDIAN  ILI9341_INTERFACE_CONTROL_ENDIAN
-#endif
-#define ILI9341_IFCTL_DM        ILI9341_INTERFACE_CONTROL_DM(0)
-#define ILI9341_IFCTL_RM        0
-#define ILI9341_IFCTL_RIM       0
-
-#define ILI9341_IFCTL_PARAM3    ILI9341_IFCTL_RIM | ILI9341_IFCTL_RM | \
-                                                               ILI9341_IFCTL_DM | ILI9341_IFCTL_ENDIAN
-
-/* Memory access control (MADCTL) */
-
-/*
- * Landscape:   00100000 / 00101000 / h28
- *
- * MY:          0
- * MX:          0
- * MV:          1
- * ML:          0
- * BGR:         0/1 Depending on endian mode of the mcu?
- * MH:          0
- */
-
-#define ILI9341_MADCTL_LANDSCAPE_MY     0
-#define ILI9341_MADCTL_LANDSCAPE_MX     0
-#define ILI9341_MADCTL_LANDSCAPE_MV     ILI9341_MEMORY_ACCESS_CONTROL_MV
-#define ILI9341_MADCTL_LANDSCAPE_ML     0
-#ifdef CONFIG_BIG_ENDIAN
-#define ILI9341_MADCTL_LANDSCAPE_BGR  0
-#else
-#define ILI9341_MADCTL_LANDSCAPE_BGR  ILI9341_MEMORY_ACCESS_CONTROL_BGR
-#endif
-#define ILI9341_MADCTL_LANDSCAPE_MH     0
-
-#define ILI9341_MADCTL_LANDSCAPE_PARAM1 (ILI9341_MADCTL_LANDSCAPE_MY | \
-                                                                               ILI9341_MADCTL_LANDSCAPE_MX | \
-                                                                               ILI9341_MADCTL_LANDSCAPE_MV | \
-                                                                               ILI9341_MADCTL_LANDSCAPE_ML | \
-                                                                               ILI9341_MADCTL_LANDSCAPE_BGR | \
-                                                                               ILI9341_MADCTL_LANDSCAPE_MH)
-
-/*
- * Portrait:    00000000 / 00001000 / h08
- *
- * MY:          0
- * MX:          0
- * MV:          0
- * ML:          0
- * BGR:         0/1 Depending on endian mode of the mcu?
- * MH:          0
- */
-
-#define ILI9341_MADCTL_PORTRAIT_MY      0
-#define ILI9341_MADCTL_PORTRAIT_MX      0
-#define ILI9341_MADCTL_PORTRAIT_MV      0
-#define ILI9341_MADCTL_PORTRAIT_ML      0
-#ifdef CONFIG_BIG_ENDIAN
-#define ILI9341_MADCTL_PORTRAIT_BGR   0
-#else
-#define ILI9341_MADCTL_PORTRAIT_BGR   ILI9341_MEMORY_ACCESS_CONTROL_BGR
-#endif
-#define ILI9341_MADCTL_PORTRAIT_MH      0
-
-#define ILI9341_MADCTL_PORTRAIT_PARAM1  (ILI9341_MADCTL_PORTRAIT_MY | \
-                                                                               ILI9341_MADCTL_PORTRAIT_MX | \
-                                                                               ILI9341_MADCTL_PORTRAIT_MV | \
-                                                                               ILI9341_MADCTL_PORTRAIT_ML | \
-                                                                               ILI9341_MADCTL_PORTRAIT_BGR | \
-                                                                               ILI9341_MADCTL_PORTRAIT_MH)
-/*
- * RLandscape:  01100000 / 01101000 / h68
- *
- * MY:          0
- * MX:          1
- * MV:          1
- * ML:          0
- * BGR:         0/1 Depending on endian mode of the mcu?
- * MH:          0
- */
-
-#define ILI9341_MADCTL_RLANDSCAPE_MY    0
-#define ILI9341_MADCTL_RLANDSCAPE_MX    ILI9341_MEMORY_ACCESS_CONTROL_MX
-#define ILI9341_MADCTL_RLANDSCAPE_MV    ILI9341_MEMORY_ACCESS_CONTROL_MV
-#define ILI9341_MADCTL_RLANDSCAPE_ML    0
-#ifdef CONFIG_BIG_ENDIAN
-#define ILI9341_MADCTL_RLANDSCAPE_BGR 0
-#else
-#define ILI9341_MADCTL_RLANDSCAPE_BGR ILI9341_MEMORY_ACCESS_CONTROL_BGR
-#endif
-#define ILI9341_MADCTL_RLANDSCAPE_MH    0
-
-#define ILI9341_MADCTL_RLANDSCAPE_PARAM1 \
-                                                                               (ILI9341_MADCTL_RLANDSCAPE_MY | \
-                                                                               ILI9341_MADCTL_RLANDSCAPE_MX | \
-                                                                               ILI9341_MADCTL_RLANDSCAPE_MV | \
-                                                                               ILI9341_MADCTL_RLANDSCAPE_ML | \
-                                                                               ILI9341_MADCTL_RLANDSCAPE_BGR | \
-                                                                               ILI9341_MADCTL_RLANDSCAPE_MH)
-
-/*
- * RPortrait:   11000000 / 11001000 / hc8
- *
- * MY:          1
- * MX:          1
- * MV:          0
- * ML:          0
- * BGR:         0/1 Depending on endian mode of the mcu?
- * MH:          0
- *
- */
-
-#define ILI9341_MADCTL_RPORTRAIT_MY     ILI9341_MEMORY_ACCESS_CONTROL_MY
-#define ILI9341_MADCTL_RPORTRAIT_MX     ILI9341_MEMORY_ACCESS_CONTROL_MX
-#define ILI9341_MADCTL_RPORTRAIT_MV     0
-#define ILI9341_MADCTL_RPORTRAIT_ML     0
-#ifdef CONFIG_BIG_ENDIAN
-#define ILI9341_MADCTL_RPORTRAIT_BGR  0
-#else
-#define ILI9341_MADCTL_RPORTRAIT_BGR  ILI9341_MEMORY_ACCESS_CONTROL_BGR
-#endif
-#define ILI9341_MADCTL_RPORTRAIT_MH     0
-
-#define ILI9341_MADCTL_RPORTRAIT_PARAM1 (ILI9341_MADCTL_RPORTRAIT_MY | \
-                                                                               ILI9341_MADCTL_RPORTRAIT_MX | \
-                                                                               ILI9341_MADCTL_RPORTRAIT_MV | \
-                                                                               ILI9341_MADCTL_RPORTRAIT_ML | \
-                                                                               ILI9341_MADCTL_RPORTRAIT_BGR | \
-                                                                               ILI9341_MADCTL_RPORTRAIT_MH)
-
-/* Pixel Format Set (COLMOD)
- *
- * Note! RGB interface settings (DPI) is unimportant for the MCU interface
- * mode but set the register to the defined state equal to the MCU interface
- * pixel format.
- *
- * 16 Bit MCU:  01010101 / h55
- *
- * DPI:         5 (RGB16-565 RGB interface, not used)
- * DBI:         5 (RGB16-565 MCU interface
- */
-
-#define ILI9341_PIXSET_16BITDPI         ILI9341_PIXEL_FORMAT_SET_DPI(5)
-#define ILI9341_PIXSET_16BITDBI         ILI9341_PIXEL_FORMAT_SET_DBI(5)
-
-#define ILI9341_PIXSET_16BITMCU_PARAM1  (ILI9341_PIXSET_16BITDPI | \
-                                                                               ILI9341_PIXSET_16BITDBI)
-
-/*
- * 18-bit MCU:  01100110 / h66 (not supported by TinyAra until now)
- *
- * DPI:         6  (RGB18-666 RGB interface)
- * DBI:         6  (RGB18-666 MCU interface)
- */
-
-#define ILI9341_PIXSET_18BITDPI         ILI9341_PIXEL_FORMAT_SET_DPI(6)
-#define ILI9341_PIXSET_18BITDBI         ILI9341_PIXEL_FORMAT_SET_DBI(6)
-
-#define ILI9341_PIXSET_18BITMCU_PARAM1  (ILI9341_PIXSET_18BITDPI | \
-                                                                               ILI9341_PIXSET_18BITDBI)
-
-/* General fix display resolution */
-
-#define ILI9341_XRES           240
-#define ILI9341_YRES           320
-
-/* Validate configuration */
-
-#if CONFIG_LCD_ILI9341_NINTERFACES < 1
-#undef CONFIG_LCD_ILI9341_IFACE0
-#elif CONFIG_LCD_ILI9341_NINTERFACES < 2
-#undef CONFIG_LCD_ILI9341_IFACE1
-#endif
-
-/* First LCD display */
-
-#ifdef CONFIG_LCD_ILI9341_IFACE0
-#ifdef CONFIG_LCD_ILI9341_IFACE0_LANDSCAPE
-#define ILI9341_IFACE0_ORIENT     ILI9341_MADCTL_LANDSCAPE_PARAM1
-#define ILI9341_IFACE0_STRIDE     ILI9341_YRES
-#elif CONFIG_LCD_ILI9341_IFACE0_PORTRAIT
-#define ILI9341_IFACE0_ORIENT     ILI9341_MADCTL_PORTRAIT_PARAM1
-#define ILI9341_IFACE0_STRIDE     ILI9341_XRES
-#elif CONFIG_LCD_ILI9341_IFACE0_RLANDSCAPE
-#define ILI9341_IFACE0_ORIENT     ILI9341_MADCTL_RLANDSCAPE_PARAM1
-#define ILI9341_IFACE0_STRIDE     ILI9341_YRES
-#elif CONFIG_LCD_ILI9341_IFACE0_RPORTRAIT
-#define ILI9341_IFACE0_ORIENT     ILI9341_MADCTL_RPORTRAIT_PARAM1
-#define ILI9341_IFACE0_STRIDE     ILI9341_XRES
-#endif
-#ifdef CONFIG_LCD_ILI9341_IFACE0_RGB565
-#define ILI9341_IFACE0_PXFMT      FB_FMT_RGB16_565
-#define ILI9341_IFACE0_BPP        16
-#define ILI9341_IFACE0_BUFFER     ILI9341_IFACE0_STRIDE
-#else
-#error "undefined pixel format for lcd interface 0"
-#endif
-#endif
-
-/* Second LCD display */
-
-#ifdef CONFIG_LCD_ILI9341_IFACE1
-#ifdef CONFIG_LCD_ILI9341_IFACE1_LANDSCAPE
-#define ILI9341_IFACE1_ORIENT     ILI9341_MADCTL_LANDSCAPE_PARAM1
-#define ILI9341_IFACE1_STRIDE     ILI9341_YRES
-#elif CONFIG_LCD_ILI9341_IFACE1_PORTRAIT
-#define ILI9341_IFACE1_ORIENT     ILI9341_MADCTL_PORTRAIT_PARAM1
-#define ILI9341_IFACE1_STRIDE     ILI9341_XRES
-#elif CONFIG_LCD_ILI9341_IFACE1_RLANDSCAPE
-#define ILI9341_IFACE1_ORIENT     ILI9341_MADCTL_RLANDSCAPE_PARAM1
-#define ILI9341_IFACE1_STRIDE     ILI9341_YRES
-#elif CONFIG_LCD_ILI9341_IFACE1_RPORTRAIT
-#define ILI9341_IFACE1_ORIENT     ILI9341_MADCTL_RPORTRAIT_PARAM1
-#define ILI9341_IFACE1_STRIDE     ILI9341_XRES
-#endif
-#ifdef CONFIG_LCD_ILI9341_IFACE1_RGB565
-#define ILI9341_IFACE1_PXFMT      FB_FMT_RGB16_565
-#define ILI9341_IFACE1_BPP        16
-#define ILI9341_IFACE1_BUFFER     ILI9341_IFACE1_STRIDE
-#else
-#error "undefined pixel format for lcd interface 1"
-#endif
-#endif
-
-/* Add next LCD display */
-
-/* Debug option */
-
-#ifdef CONFIG_DEBUG_LCD
-#define lcddbg       dbg
-#define lcdvdbg      vdbg
-#else
-#define lcddbg(x...)
-#define lcdvdbg(x...)
-#endif
-
-/******************************************************************************
- * Private Type Definition
- ******************************************************************************/
-
-/*
- * Each single connected ili9341 LCD driver needs an own driver instance
- * to provide a unique getrun and putrun method. Also store fundamental
- * parameter in driver internal structure. This minimal overhead should be
- * acceptable.
- */
-
-struct ili9341_dev_s {
-       /* Publically visible device structure */
-
-       struct lcd_dev_s dev;
-
-       /* Private driver-specific information follows */
-
-       FAR struct ili9341_lcd_s *lcd;
-
-       /* Driver specific putrun function */
-
-       int (*putrun)(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, size_t npixels);
-#ifndef CONFIG_LCD_NOGETRUN
-       /* Driver specific getrun function */
-
-       int (*getrun)(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, size_t npixels);
-#endif
-       /* Run buffer for the device */
-
-       uint16_t *runbuffer;
-
-       /* Display orientation, e.g. Landscape, Portrait */
-
-       uint8_t orient;
-
-       /* LCD driver pixel format */
-
-       uint8_t pxfmt;
-
-       /* LCD driver color depth */
-
-       uint8_t bpp;
-
-       /* Current power state of the device */
-
-       uint8_t power;
-};
-
-/******************************************************************************
- * Private Function Protototypes
- ******************************************************************************/
-
-/* Internal low level helpers */
-
-static inline uint16_t ili9341_getxres(FAR struct ili9341_dev_s *dev);
-static inline uint16_t ili9341_getyres(FAR struct ili9341_dev_s *dev);
-
-/* lcd data transfer methods */
-
-static int ili9341_putrun(int devno, fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, size_t npixels);
-#ifndef CONFIG_LCD_NOGETRUN
-static int ili9341_getrun(int devno, fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, size_t npixels);
-#endif
-/*
- * Definition of the public visible getrun / putrun methods
- * each for a single LCD driver
- */
-
-#ifdef CONFIG_LCD_ILI9341_IFACE0
-static int ili9341_putrun0(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, size_t npixsels);
-#endif
-#ifdef CONFIG_LCD_ILI9341_IFACE1
-static int ili9341_putrun1(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, size_t npixsels);
-#endif
-
-#ifndef CONFIG_LCD_NOGETRUN
-#ifdef CONFIG_LCD_ILI9341_IFACE0
-static int ili9341_getrun0(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, size_t npixsels);
-#endif
-#ifdef CONFIG_LCD_ILI9341_IFACE1
-static int ili9341_getrun1(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, size_t npixsels);
-#endif
-#endif
-
-/* lcd configuration */
-
-static int ili9341_getvideoinfo(FAR struct lcd_dev_s *dev, FAR struct fb_videoinfo_s *vinfo);
-static int ili9341_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno, FAR struct lcd_planeinfo_s *pinfo);
-
-/* lcd specific controls */
-
-static int ili9341_getpower(struct lcd_dev_s *dev);
-static int ili9341_setpower(struct lcd_dev_s *dev, int power);
-static int ili9341_getcontrast(struct lcd_dev_s *dev);
-static int ili9341_setcontrast(struct lcd_dev_s *dev, unsigned int contrast);
-
-/******************************************************************************
- * Private Data
- ******************************************************************************/
-
-/* Initialize driver instance 1 < LCD_ILI9341_NINTERFACES */
-
-#ifdef CONFIG_LCD_ILI9341_IFACE0
-static uint16_t g_runbuffer0[ILI9341_IFACE0_BUFFER];
-#endif
-#ifdef CONFIG_LCD_ILI9341_IFACE1
-static uint16_t g_runbuffer1[ILI9341_IFACE1_BUFFER];
-#endif
-
-static struct ili9341_dev_s g_lcddev[CONFIG_LCD_ILI9341_NINTERFACES] = {
-#ifdef CONFIG_LCD_ILI9341_IFACE0
-       {
-               .lcd = 0,
-               .putrun = ili9341_putrun0,
-#ifndef CONFIG_LCD_NOGETRUN
-               .getrun = ili9341_getrun0,
-#endif
-               .runbuffer = g_runbuffer0,
-               .orient = ILI9341_IFACE0_ORIENT,
-               .pxfmt = ILI9341_IFACE0_PXFMT,
-               .bpp = ILI9341_IFACE0_BPP,
-               .power = 0,
-       },
-#endif
-#ifdef CONFIG_LCD_ILI9341_IFACE1
-       {
-               .lcd = 0,
-               .putrun = ili9341_putrun1,
-#ifndef CONFIG_LCD_NOGETRUN
-               .getrun = ili9341_getrun1,
-#endif
-               .runbuffer = g_runbuffer1,
-               .orient = ILI9341_IFACE1_ORIENT,
-               .pxfmt = ILI9341_IFACE1_PXFMT,
-               .bpp = ILI9341_IFACE1_BPP,
-               .power = 0,
-       },
-#endif
-};
-
-/******************************************************************************
- * Private Functions
- ******************************************************************************/
-
-/******************************************************************************
- * Name:  ili9341_getxres
- *
- * Description:
- *   Get horicontal resolution of the connected LCD driver depending on the
- *   configured display orientation.
- *
- * Parameters:
- *   dev   - Reference to private driver structure
- *
- * Return Value:
- *
- *   Horicontal resolution
- *
- ******************************************************************************/
-
-static inline uint16_t ili9341_getxres(FAR struct ili9341_dev_s *dev)
-{
-       if (dev->orient == ILI9341_MADCTL_LANDSCAPE_PARAM1 || dev->orient == ILI9341_MADCTL_RLANDSCAPE_PARAM1) {
-               return ILI9341_YRES;
-       }
-
-       return ILI9341_XRES;
-}
-
-/*******************************************************************************
- * Name:  ili9341_getyres
- *
- * Description:
- *   Get vertical resolution of the connected LCD driver depending on the
- *   configured display orientation.
- *
- * Parameter:
- *   dev   - Reference to private driver structure
- *
- * Return Value:
- *
- *   Vertical resolution
- *
- ******************************************************************************/
-
-static inline uint16_t ili9341_getyres(FAR struct ili9341_dev_s *dev)
-{
-       if (dev->orient == ILI9341_MADCTL_LANDSCAPE_PARAM1 || dev->orient == ILI9341_MADCTL_RLANDSCAPE_PARAM1) {
-               return ILI9341_XRES;
-       }
-
-       return ILI9341_YRES;
-}
-
-/*******************************************************************************
- * Name:  ili9341_selectarea
- *
- * Description:
- *   Select the active area for displaying pixel
- *
- * Parameter:
- *   lcd       - Reference to private driver structure
- *   x0        - Start x position
- *   y0        - Start y position
- *   x1        - End x position
- *   y1        - End y position
- *
- ******************************************************************************/
-
-static void ili9341_selectarea(FAR struct ili9341_lcd_s *lcd, uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1)
-{
-       /* Select column */
-
-       lcd->sendcmd(lcd, ILI9341_COLUMN_ADDRESS_SET);
-       lcd->sendparam(lcd, (x0 >> 8));
-       lcd->sendparam(lcd, (x0 & 0xff));
-       lcd->sendparam(lcd, (x1 >> 8));
-       lcd->sendparam(lcd, (x1 & 0xff));
-
-       /* Select page */
-
-       lcd->sendcmd(lcd, ILI9341_PAGE_ADDRESS_SET);
-       lcd->sendparam(lcd, (y0 >> 8));
-       lcd->sendparam(lcd, (y0 & 0xff));
-       lcd->sendparam(lcd, (y1 >> 8));
-       lcd->sendparam(lcd, (y1 & 0xff));
-}
-
-/*******************************************************************************
- * Name:  ili9341_putrun
- *
- * Description:
- *   Write a partial raster line to the LCD.
- *
- * Parameters:
- *   devno   - Number of lcd device
- *   row     - Starting row to write to (range: 0 <= row < yres)
- *   col     - Starting column to write to (range: 0 <= col <= xres-npixels)
- *   buffer  - The buffer containing the run to be writen to the LCD
- *   npixels - The number of pixels to write to the
- *             (range: 0 < npixels <= xres-col)
- *
- * Returned Value:
- *
- *   On success - OK
- *   On error   - -EINVAL
- *
- ******************************************************************************/
-
-static int ili9341_putrun(int devno, fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, size_t npixels)
-{
-       FAR struct ili9341_dev_s *dev = &g_lcddev[devno];
-       FAR struct ili9341_lcd_s *lcd = dev->lcd;
-       FAR const uint16_t *src = (const uint16_t *)buffer;
-
-       DEBUGASSERT(buffer && ((uintptr_t)buffer & 1) == 0);
-
-       /* Check if position outside of area */
-       if (col + npixels > ili9341_getxres(dev) || row > ili9341_getyres(dev)) {
-               return -EINVAL;
-       }
-
-       /* Select lcd driver */
-
-       lcd->select(lcd);
-
-       /* Select column and area similar to the partial raster line */
-
-       ili9341_selectarea(lcd, col, row, col + npixels - 1, row);
-
-       /* Send memory write cmd */
-
-       lcd->sendcmd(lcd, ILI9341_MEMORY_WRITE);
-
-       /* Send pixel to gram */
-
-       lcd->sendgram(lcd, src, npixels);
-
-       /* Deselect the lcd driver */
-
-       lcd->deselect(lcd);
-
-       return OK;
-}
-
-/*******************************************************************************
- * Name:  ili9341_getrun
- *
- * Description:
- *   Read a partial raster line from the LCD.
- *
- * Parameter:
- *   devno   - Number of the lcd device
- *   row     - Starting row to read from (range: 0 <= row < yres)
- *   col     - Starting column to read read (range: 0 <= col <= xres-npixels)
- *   buffer  - The buffer in which to return the run read from the LCD
- *   npixels - The number of pixels to read from the LCD
- *            (range: 0 < npixels <= xres-col)
- *
- * Returned Value:
- *
- *   On success - OK
- *   On error   - -EINVAL
- *
- ******************************************************************************/
-
-#ifndef CONFIG_LCD_NOGETRUN
-static int ili9341_getrun(int devno, fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, size_t npixels)
-{
-       FAR struct ili9341_dev_s *dev = &g_lcddev[devno];
-       FAR struct ili9341_lcd_s *lcd = dev->lcd;
-       FAR uint16_t *dest = (uint16_t *)buffer;
-
-       DEBUGASSERT(buffer && ((uintptr_t)buffer & 1) == 0);
-
-       /* Check if position outside of area */
-       if (col + npixels > ili9341_getxres(dev) || row > ili9341_getyres(dev)) {
-               return -EINVAL;
-       }
-
-       /* Select lcd driver */
-
-       lcd->select(lcd);
-
-       /* Select column and area similar to the partial raster line */
-
-       ili9341_selectarea(lcd, col, row, col + npixels - 1, row);
-
-       /* Send memory read cmd */
-
-       lcd->sendcmd(lcd, ILI9341_MEMORY_READ);
-
-       /* Receive pixel to gram */
-
-       lcd->recvgram(lcd, dest, npixels);
-
-       /* Deselect the lcd driver */
-
-       lcd->deselect(lcd);
-
-       return OK;
-}
-#endif
-
-/*******************************************************************************
- * Name:  ili9341_hwinitialize
- *
- * Description:
- *   Initialize and configure the ILI9341 LCD driver hardware.
- *
- * Parameter:
- *   dev - A reference to the driver specific structure
- *
- * Returned Value:
- *
- *   On success - OK
- *   On error - EINVAL
- *
- ******************************************************************************/
-
-static int ili9341_hwinitialize(FAR struct ili9341_dev_s *dev)
-{
-#ifdef CONFIG_DEBUG_LCD
-       uint8_t param;
-#endif
-       FAR struct ili9341_lcd_s *lcd = dev->lcd;
-
-       /* Select spi device */
-
-       lcddbg("Initialize lcd driver\n");
-       lcd->select(lcd);
-
-#ifdef CONFIG_DEBUG_LCD
-       /* Read display identification */
-
-       lcd->sendcmd(lcd, ILI9341_READ_ID1);
-       lcd->recvparam(lcd, &param);
-       lcddbg("ili9341 LCD driver: LCD modules manufacturer ID: %d\n", param);
-       lcd->sendcmd(lcd, ILI9341_READ_ID2);
-       lcd->recvparam(lcd, &param);
-       lcddbg("ili9341 LCD driver: LCD modules driver version ID: %d\n", param);
-       lcd->sendcmd(lcd, ILI9341_READ_ID3);
-       lcd->recvparam(lcd, &param);
-       lcddbg("ili9341 LCD driver: LCD modules driver ID: %d\n", param);
-#endif
-
-       /* Reset the lcd display to the default state */
-
-       lcdvdbg("ili9341 LCD driver: Software Reset\n");
-       lcd->sendcmd(lcd, ILI9341_SOFTWARE_RESET);
-       up_mdelay(5);
-
-       lcdvdbg("ili9341 LCD driver: set Memory Access Control: %04x\n", dev->orient);
-       lcd->sendcmd(lcd, ILI9341_MEMORY_ACCESS_CONTROL);
-       lcd->sendparam(lcd, dev->orient);
-
-       /* Select column and area */
-
-       ili9341_selectarea(lcd, 0, 0, ILI9341_XRES, ILI9341_YRES);
-
-       /* Pixel Format set */
-
-       lcd->sendcmd(lcd, ILI9341_PIXEL_FORMAT_SET);
-
-       /* 16 bit RGB565 */
-
-       lcdvdbg("ili9341 LCD driver: Set Pixel Format: %04x\n", ILI9341_PIXSET_16BITMCU_PARAM1);
-       lcd->sendparam(lcd, ILI9341_PIXSET_16BITMCU_PARAM1);
-
-       /* 18 bit RGB666, add settings here */
-
-       lcdvdbg("ili9341 LCD driver: Set Interface control\n");
-       lcd->sendcmd(lcd, ILI9341_INTERFACE_CONTROL);
-       lcd->sendparam(lcd, ILI9341_IFCTL_PARAM1);
-       lcd->sendparam(lcd, ILI9341_IFCTL_PARAM2);
-       lcd->sendparam(lcd, ILI9341_IFCTL_PARAM3);
-
-       /* Sleep out */
-
-       lcdvdbg("ili9341 LCD driver: Sleep Out\n");
-       lcd->sendcmd(lcd, ILI9341_SLEEP_OUT);
-       up_mdelay(120);
-
-       /* Deselect the device */
-
-       lcd->deselect(lcd);
-
-       /* Switch display off */
-
-       ili9341_setpower(&dev->dev, 0);
-
-       return OK;
-}
-
-/*******************************************************************************
- * Public Functions
- ******************************************************************************/
-
-/*******************************************************************************
- * Name:  ili9341_putrunx
- *
- * Description:
- *   Write a partial raster line to the LCD.
- *
- * Parameter:
- *   row     - Starting row to write to (range: 0 <= row < yres)
- *   col     - Starting column to write to (range: 0 <= col <= xres-npixels)
- *   buffer  - The buffer containing the run to be writen to the LCD
- *   npixels - The number of pixels to write to the
- *             (range: 0 < npixels <= xres-col)
- *
- * Returned Value:
- *
- *   On success - OK
- *   On error   - -EINVAL
- *
- ******************************************************************************/
-
-#ifdef CONFIG_LCD_ILI9341_IFACE0
-static int ili9341_putrun0(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, size_t npixels)
-{
-       return ili9341_putrun(0, row, col, buffer, npixels);
-}
-#endif
-
-#ifdef CONFIG_LCD_ILI9341_IFACE1
-static int ili9341_putrun1(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, size_t npixels)
-{
-       return ili9341_putrun(1, row, col, buffer, npixels);
-}
-#endif
-
-/*******************************************************************************
- * Name:  ili9341_getrunx
- *
- * Description:
- *   Read a partial raster line from the LCD.
- *
- * Parameter:
- *   row     - Starting row to read from (range: 0 <= row < yres)
- *   col     - Starting column to read from (range: 0 <= col <= xres-npixels)
- *   buffer  - The buffer containing the run to be writen to the LCD
- *   npixels - The number of pixels to read from the
- *             (range: 0 < npixels <= xres-col)
- *
- * Returned Value:
- *
- *   On success - OK
- *   On error   - -EINVAL
- *
- ******************************************************************************/
-
-#ifndef CONFIG_LCD_NOGETRUN
-#ifdef CONFIG_LCD_ILI9341_IFACE0
-static int ili9341_getrun0(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, size_t npixels)
-{
-       return ili9341_getrun(0, row, col, buffer, npixels);
-}
-#endif
-
-#ifdef CONFIG_LCD_ILI9341_IFACE1
-static int ili9341_getrun1(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, size_t npixels)
-{
-       return ili9341_getrun(1, row, col, buffer, npixels);
-}
-#endif
-#endif
-
-/*******************************************************************************
- * Name:  ili9341_getvideoinfo
- *
- * Description:
- *   Get information about the LCD video controller configuration.
- *
- * Parameter:
- *   dev - A reference to the driver specific structure
- *   vinfo - A reference to the videoinfo structure
- *
- * Returned Value:
- *
- *  On success - OK
- *  On error   - -EINVAL
- *
- ******************************************************************************/
-
-static int ili9341_getvideoinfo(FAR struct lcd_dev_s *dev, FAR struct fb_videoinfo_s *vinfo)
-{
-       if (dev && vinfo) {
-               FAR struct ili9341_dev_s *priv = (FAR struct ili9341_dev_s *)dev;
-
-               vinfo->fmt = priv->pxfmt;
-               vinfo->xres = ili9341_getxres(priv);
-               vinfo->yres = ili9341_getyres(priv);
-               vinfo->nplanes = 1;
-
-               lcdvdbg("fmt: %d xres: %d yres: %d nplanes: %d\n", vinfo->fmt, vinfo->xres, vinfo->yres, vinfo->nplanes);
-
-               return OK;
-       }
-
-       return -EINVAL;
-}
-
-/*******************************************************************************
- * Name:  ili9341_getplaneinfo
- *
- * Description:
- *   Get information about the configuration of each LCD color plane.
- *
- * Parameter:
- *   dev     - A reference to the driver specific structure
- *   planeno - The plane number
- *   pinfo   - A reference to the planeinfo structure
- *
- * Returned Value:
- *
- *  On success - OK
- *  On error   - -EINVAL
- *
- ******************************************************************************/
-
-static int ili9341_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno, FAR struct lcd_planeinfo_s *pinfo)
-{
-       if (dev && pinfo && planeno == 0) {
-               FAR struct ili9341_dev_s *priv = (FAR struct ili9341_dev_s *)dev;
-
-               pinfo->putrun = priv->putrun;
-#ifndef CONFIG_LCD_NOGETRUN
-               pinfo->getrun = priv->getrun;
-#endif
-               pinfo->bpp = priv->bpp;
-               pinfo->buffer = (uint8_t *)priv->runbuffer;     /* Run scratch buffer */
-
-               lcdvdbg("planeno: %d bpp: %d\n", planeno, pinfo->bpp);
-
-               return OK;
-       }
-
-       return -EINVAL;
-}
-
-/*******************************************************************************
- * Name:  ili9341_getpower
- *
- * Description:
- *   Get the LCD panel power status (0: full off - CONFIG_LCD_MAXPOWER: full on.
- *   On backlit LCDs, this setting may correspond to the backlight setting.
- *
- * Parameter:
- *   dev     - A reference to the driver specific structure
- *
- * Returned Value:
- *
- *  On success - OK
- *  On error   - -EINVAL
- *
- ******************************************************************************/
-
-static int ili9341_getpower(FAR struct lcd_dev_s *dev)
-{
-       FAR struct ili9341_dev_s *priv = (FAR struct ili9341_dev_s *)dev;
-
-       if (priv) {
-               lcddbg("%d\n", priv->power);
-
-               return priv->power;
-       }
-
-       return -EINVAL;
-}
-
-/*******************************************************************************
- * Name:  ili9341_setpower
- *
- * Description:
- *   Enable/disable LCD panel power (0: full off - CONFIG_LCD_MAXPOWER: full on).
- *   On backlight LCDs, this setting may correspond to the backlight setting.
- *
- * Parameter:
- *   dev   - A reference to the driver specific structure
- *   power - Value of the power
- *
- * Returned Value:
- *
- *  On success - OK
- *  On error   - -EINVAL
- *
- ******************************************************************************/
-
-static int ili9341_setpower(FAR struct lcd_dev_s *dev, int power)
-{
-       FAR struct ili9341_dev_s *priv = (FAR struct ili9341_dev_s *)dev;
-       FAR struct ili9341_lcd_s *lcd = priv->lcd;
-
-       if (dev) {
-               lcddbg("%d\n", power);
-
-               lcd->select(lcd);
-
-               if (power > 0) {
-                       /* Set backlight level */
-
-                       lcd->backlight(lcd, power);
-
-                       /* And switch LCD on */
-
-                       lcd->sendcmd(lcd, ILI9341_DISPLAY_ON);
-                       up_mdelay(120);
-               } else {
-                       /* Switch LCD off */
-
-                       lcd->sendcmd(lcd, ILI9341_DISPLAY_OFF);
-               }
-
-               lcd->deselect(lcd);
-
-               priv->power = power;
-
-               return OK;
-       }
-
-       return -EINVAL;
-}
-
-/*******************************************************************************
- * Name:  ili9341_getcontrast
- *
- * Description:
- *   Get the current contrast setting (0-CONFIG_LCD_MAXCONTRAST).
- *
- * Parameter:
- *   dev   - A reference to the lcd driver structure
- *
- * Returned Value:
- *
- *  On success - current contrast value
- *  On error   - -ENOSYS, not supported by the ili9341.
- *
- ******************************************************************************/
-
-static int ili9341_getcontrast(struct lcd_dev_s *dev)
-{
-       lcdvdbg("Not implemented\n");
-       return -ENOSYS;
-}
-
-/*******************************************************************************
- * Name:  ili9341_setcontrast
- *
- * Description:
- *   Set LCD panel contrast (0-CONFIG_LCD_MAXCONTRAST).
- *
- * Parameter:
- *   dev   - A reference to the lcd driver structure
- *
- * Returned Value:
- *
- *  On success - OK
- *  On error   - -ENOSYS, not supported by the ili9341.
- *
- ******************************************************************************/
-
-static int ili9341_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
-{
-       lcdvdbg("contrast: %d\n", contrast);
-       return -ENOSYS;
-}
-
-/*******************************************************************************
- * Name:  ili9341_initialize
- *
- * Description:
- *   Initialize the LCD video driver internal sturcture. Also initialize the
- *   lcd hardware if not done. The control of the LCD driver is depend on the
- *   selected MCU interface and part of the platform specific subdriver (see
- *   config/stm32f429i-disco/src/stm32_ili93414ws.c)
- *
- * Input Parameters:
- *
- *   lcd - A reference to the platform specific driver instance to control the
- *     ili9341 display driver.
- *   devno - A value in the range of 0 through CONFIG_ILI9341_NINTERFACES-1.
- *     This allows support for multiple LCD devices.
- *
- * Returned Value:
- *
- *   On success, this function returns a reference to the LCD driver object for
- *   the specified LCD driver. NULL is returned on any failure.
- *
- ******************************************************************************/
-
-FAR struct lcd_dev_s *ili9341_initialize(FAR struct ili9341_lcd_s *lcd, int devno)
-{
-       if (lcd && devno >= 0 && devno < CONFIG_LCD_ILI9341_NINTERFACES) {
-               FAR struct ili9341_dev_s *priv = &g_lcddev[devno];
-
-               /* Check if initialized */
-
-               if (!priv->lcd) {
-                       FAR struct lcd_dev_s *dev = &priv->dev;
-                       int ret;
-
-                       /* Initialize internal structure */
-
-                       dev->getvideoinfo = ili9341_getvideoinfo;
-                       dev->getplaneinfo = ili9341_getplaneinfo;
-                       dev->getpower = ili9341_getpower;
-                       dev->setpower = ili9341_setpower;
-                       dev->getcontrast = ili9341_getcontrast;
-                       dev->setcontrast = ili9341_setcontrast;
-                       priv->lcd = lcd;
-
-                       /* Initialze the LCD driver */
-
-                       ret = ili9341_hwinitialize(priv);
-
-                       if (ret == OK) {
-                               return &priv->dev;
-                       }
-
-                       errno = EINVAL;
-               }
-       }
-
-       return NULL;
-}
-
-/******************************************************************************
- * Name:  ili9341_clear
- *
- * Description:
- *   This is a non-standard LCD interface.  Because of the various rotations,
- *   clearing the display in the normal way by writing a sequences of runs that
- *   covers the entire display can be very slow. Here the display is cleared by
- *   simply setting all GRAM memory to the specified color.
- *
- * Parameter:
- *   dev   - A reference to the lcd driver structure
- *   color - The background color
- *
- * Returned Value:
- *
- *  On success - OK
- *  On error   - -EINVAL
- *
- ******************************************************************************/
-
-int ili9341_clear(FAR struct lcd_dev_s *dev, uint16_t color)
-{
-       FAR struct ili9341_dev_s *priv = (FAR struct ili9341_dev_s *)dev;
-       FAR struct ili9341_lcd_s *lcd = priv->lcd;
-       uint16_t xres = ili9341_getxres(priv);
-       uint16_t yres = ili9341_getyres(priv);
-       uint32_t n;
-
-       if (!lcd) {
-               return -EINVAL;
-       }
-
-       /* Select lcd driver */
-
-       lcd->select(lcd);
-
-       /* Select column and area similar to the visible area */
-
-       ili9341_selectarea(lcd, 0, 0, xres, yres);
-
-       /* Send memory write cmd */
-
-       lcd->sendcmd(lcd, ILI9341_MEMORY_WRITE);
-
-       /* clear the visible area */
-
-       for (n = 0; n < xres * yres; n++) {
-               /* Send pixel to gram */
-
-               lcd->sendgram(lcd, &color, 1);
-       }
-
-       /* Deselect the lcd driver */
-
-       lcd->deselect(lcd);
-
-       return OK;
-}
diff --git a/os/include/tinyara/lcd/ili9341.h b/os/include/tinyara/lcd/ili9341.h
deleted file mode 100644 (file)
index a796ede..0000000
+++ /dev/null
@@ -1,322 +0,0 @@
-/****************************************************************************
- *
- * Copyright 2016 Samsung Electronics All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- ****************************************************************************/
-/**************************************************************************************
- * include/tinyara/lcd/ili9341.h
- *
- *   Copyright (C) 2014 Gregory Nutt. All rights reserved.
- *   Authors: Gregory Nutt <gnutt@nuttx.org>
- *            Marco Krahl <ocram.lhark@gmail.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- *    used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- **************************************************************************************/
-
-#ifndef __INCLUDE_TINYARA_LCD_ILI9341_H
-#define __INCLUDE_TINYARA_LCD_ILI9341_H
-
-/**************************************************************************************
- * Included Files
- **************************************************************************************/
-
-#include <tinyara/config.h>
-
-/**************************************************************************************
- * Pre-processor Definitions
- **************************************************************************************/
-/* ILI9341 ID code */
-
-#define ILI9341_DEVICE_CODE                    0x9341
-
-/* ILI9341 LCD Register Addresses *****************************************************/
-
-/* Level 1 commands */
-
-#define ILI9341_NOP                            0x00    /* Nop operation */
-#define ILI9341_SOFTWARE_RESET                 0x01    /* Software reset */
-#define ILI9341_READ_DISP_ID                   0x04    /* Read Display Identification information */
-#define ILI9341_READ_DISP_STATUS               0x09    /* Read display status */
-#define ILI9341_READ_DISP_POWER_MODE           0x0a    /* Read display power mode */
-#define ILI9341_READ_DISP_MADCTRL              0x0b    /* Read display MADCTL */
-#define ILI9341_READ_DISP_PIXEL_FORMAT         0x0c    /* Read display pixel forma */
-#define ILI9341_READ_DISP_IMAGE_FORMAT         0x0d    /* Read display image format */
-#define ILI9341_READ_DISP_SIGNAL_MODE          0x0e    /* Read display signal mode */
-#define ILI9341_READ_DISP_SELF_DIAGNOSTIC      0x0f    /* Read display self-diagnostic result */
-#define ILI9341_ENTER_SLEEP_MODE               0x10    /* Enter sleep mode */
-#define ILI9341_SLEEP_OUT                      0x11    /* Sleep out */
-#define ILI9341_PARTIAL_MODE_ON                0x12    /* Partial mode on */
-#define ILI9341_NORMAL_DISP_MODE_ON            0x13    /* Normal display mode on */
-#define ILI9341_DISP_INVERSION_OFF             0x20    /* Display inversion off */
-#define ILI9341_DISP_INVERSION_ON              0x21    /* Display inversion on */
-#define ILI9341_GAMMA_SET                      0x26    /* Gamma set */
-#define ILI9341_DISPLAY_OFF                    0x28    /* Display off */
-#define ILI9341_DISPLAY_ON                     0x29    /* Display on */
-#define ILI9341_COLUMN_ADDRESS_SET             0x2a    /* Column address set */
-#define ILI9341_PAGE_ADDRESS_SET               0x2b    /* Page address set */
-#define ILI9341_MEMORY_WRITE                   0x2c    /* Memory write */
-#define ILI9341_COLOR_SET                      0x2d    /* Color set */
-#define ILI9341_MEMORY_READ                    0x2e    /* Memory read */
-#define ILI9341_PARTIAL_AREA                   0x30    /* Partial area */
-#define ILI9341_VERT_SCROLL_DEFINITION         0x33    /* Vertical scrolling definition */
-#define ILI9341_TEARING_EFFECT_LINE_OFF        0x34    /* Tearing effect line off */
-#define ILI9341_TEARING_EFFECT_LINE_ON         0x35    /* Tearing effect line on */
-#define ILI9341_MEMORY_ACCESS_CONTROL          0x36    /* Memory Access control */
-#define ILI9341_VERT_SCROLL_START_ADDRESS      0x37    /* Vertical scrolling start address */
-#define ILI9341_IDLE_MODE_OFF                  0x38    /* Idle mode off */
-#define ILI9341_IDLE_MODE_ON                   0x39    /* Idle mode on */
-#define ILI9341_PIXEL_FORMAT_SET               0x3a    /* Pixel Format set */
-#define ILI9341_WRITE_MEMORY_CONTINUE          0x3c    /* Write memory continue */
-#define ILI9341_READ_MEMORY_CONTINUE           0x3e    /* Read memory continue */
-#define ILI9341_SET_TEAR_SCANLINE              0x44    /* Set tear scanline */
-#define ILI9341_GET_SCANLINE                   0x45    /* Get scanline */
-#define ILI9341_WRITE_DISPLAY_BRIGHTNESS       0x51    /* Write display brightness */
-#define ILI9341_READ_DISPLAY_BRIGHTNESS        0x52    /* Read display brightness */
-#define ILI9341_WRITE_CTRL_DISPLAY             0x53    /* Write control display */
-#define ILI9341_READ_CTRL_DISPLAY              0x54    /* Read control display */
-#define ILI9341_WRITE_CONTENT_ADAPT_BRIGHTNESS 0x55    /* write content adaptive brightness control */
-#define ILI9341_READ_CONTENT_ADAPT_BRIGHTNESS  0x56    /* Read content adaptive brightness control */
-#define ILI9341_WRITE_MIN_CAB_LEVEL            0x5e    /* Write CABC minimum brightness */
-#define ILI9341_READ_MIN_CAB_LEVEL             0x5f    /* Read CABC minimum brightness */
-#define ILI9341_READ_ID1                       0xda    /* Read ID1 */
-#define ILI9341_READ_ID2                       0xdb    /* Read ID2 */
-#define ILI9341_READ_ID3                       0xdc    /* Read ID3 */
-
-/* Level 2 Commands */
-
-#define ILI9341_RGB_SIGNAL_CONTROL             0xb0    /* RGB interface signal control */
-#define ILI9341_FRAME_RATE_CONTROL_NORMAL      0xb1    /* Frame control */
-#define ILI9341_FRAME_RATE_CONTROL_IDLE_8COLOR 0xb2    /* Frame control in idle mode */
-#define ILI9341_FRAME_RATE_CONTROL_PARTIAL     0xb3    /* Frame control in partial mode */
-#define ILI9341_DISPLAY_INVERSION_CONTROL      0xb4    /* Display inversion control */
-#define ILI9341_BLANKING_PORCH_CONTROL         0xb5    /* Blanking porch control */
-#define ILI9341_DISPLAY_FUNCTION_CTL           0xb6    /* Display function control */
-#define ILI9341_ENTRY_MODE_SET                 0xb7    /* Entry mode set */
-#define ILI9341_BACKLIGHT_CONTROL_1            0xb8    /* Backlight control1 */
-#define ILI9341_BACKLIGHT_CONTROL_2            0xb9    /* Backlight control2 */
-#define ILI9341_BACKLIGHT_CONTROL_3            0xba    /* Backlight control3 */
-#define ILI9341_BACKLIGHT_CONTROL_4            0xbb    /* Backlight control 4 */
-#define ILI9341_BACKLIGHT_CONTROL_5            0xbc    /* Backlight control 5 */
-#define ILI9341_BACKLIGHT_CONTROL_7            0xbe    /* Backlight control 7 */
-#define ILI9341_BACKLIGHT_CONTROL_8            0xbf    /* Backlight control 8 */
-#define ILI9341_POWER_CONTROL_1                0xc0    /* Power control 1 */
-#define ILI9341_POWER_CONTROL_2                0xc1    /* Power control 2 */
-#define ILI9341_VCOM_CONTROL_1                 0xc5    /* VCOM control 1 */
-#define ILI9341_VCOM_CONTROL_2                 0xc7    /* VCOM control 2 */
-#define ILI9341_POWER_CONTROL_A                0xcb    /* Power control A */
-#define ILI9341_POWER_CONTROL_B                0xcf    /* Power control B */
-#define ILI9341_NVMEM_WRITE                    0xd0    /* NV memory write */
-#define ILI9341_NVMEM_PROTECTION_KEY           0xd1    /* NV memory protection key */
-#define ILI9341_NVMEM_STATUS_READ              0xd2    /* NV memory status read */
-#define ILI9341_READ_ID4                       0xd3    /* Read ID4 */
-#define ILI9341_POSITIVE_GAMMA_CORRECTION      0xe0    /* Positive gamma correction */
-#define ILI9341_NEGATIVE_GAMMA_CORRECTION      0xe1    /* Negative gamma correction */
-#define ILI9341_DIGITAL_GAMMA_CONTROL_1        0xe2    /* Digital gamma control 1 */
-#define ILI9341_DIGITAL_GAMMA_CONTROL_2        0xe3    /* Digital gamma control 2 */
-#define ILI9341_DRIVER_TIMING_CTL_A            0xe8    /* Driver timing control A */
-#define ILI9341_DRIVER_TIMING_CTL_B            0xea    /* Driver timing control B */
-#define ILI9341_POWER_ON_SEQUENCE_CONTROL      0xed    /* Power-on sequence control */
-#define ILI9341_ENABLE_3_GAMMA_CONTROL         0xf2    /* Enable 3g gamma control */
-#define ILI9341_INTERFACE_CONTROL              0xf6    /* Interface control */
-#define ILI9341_PUMP_RATIO_CONTROL             0xf7    /* Pump ration control */
-
-/* ILI9341 LCD Register Bit Definitions ***********************************************/
-/* Pixel format set */
-#define ILI9341_PIXEL_FORMAT_SET_DPI_SHIFT     (4)
-#define ILI9341_PIXEL_FORMAT_SET_DPI_MASK      (7 << ILI9341_PIXEL_FORMAT_SET_DPI_SHIFT)
-#define ILI9341_PIXEL_FORMAT_SET_DPI(n)        ((n) << ILI9341_PIXEL_FORMAT_SET_DPI_SHIFT)
-#define ILI9341_PIXEL_FORMAT_SET_DBI_SHIFT     (0)
-#define ILI9341_PIXEL_FORMAT_SET_DBI_MASK      (7 << ILI9341_PIXEL_FORMAT_SET_DBI_SHIFT)
-#define ILI9341_PIXEL_FORMAT_SET_DBI(n)        ((n) << ILI9341_PIXEL_FORMAT_SET_DBI_SHIFT)
-
-/* Memory Access control */
-
-#define ILI9341_MEMORY_ACCESS_CONTROL_MH       (1 << 2)        /* Horizontal refresh order */
-#define ILI9341_MEMORY_ACCESS_CONTROL_BGR      (1 << 3)        /* RGB/BGR order */
-#define ILI9341_MEMORY_ACCESS_CONTROL_ML       (1 << 4)        /* Vertical refresh order */
-#define ILI9341_MEMORY_ACCESS_CONTROL_MV       (1 << 5)        /* Row/column exchange */
-#define ILI9341_MEMORY_ACCESS_CONTROL_MX       (1 << 6)        /* Column address order */
-#define ILI9341_MEMORY_ACCESS_CONTROL_MY       (1 << 7)        /* Row address order */
-
-/* Display function control */
-
-#define ILI9341_DISP_FUNC_CTL_ISC_SHIFT        (0)
-#define ILI9341_DISP_FUNC_CTL_ISC_MASK         (15 << ILI9341_DISP_FUNC_CTL_ISC_SHIFT)
-#define ILI9341_DISP_FUNC_CTL_ISC(n)         ((n) << ILI9341_DISP_FUNC_CTL_ISC_SHIFT)
-#define ILI9341_DISP_FUNC_CTL_SM               (1 << 4)
-#define ILI9341_DISP_FUNC_CTL_SS               (1 << 5)
-#define ILI9341_DISP_FUNC_CTL_GS               (1 << 6)
-#define ILI9341_DISP_FUNC_CTL_REV              (1 << 7)
-
-/* Interface function control */
-
-#define ILI9341_INTERFACE_CONTROL_WEMODE       (1)
-#define ILI9341_INTERFACE_CONTROL_BGREOR       (1 << 3)
-#define ILI9341_INTERFACE_CONTROL_MVEOR        (1 << 5)
-#define ILI9341_INTERFACE_CONTROL_MXEOR        (1 << 6)
-#define ILI9341_INTERFACE_CONTROL_MYEOR        (1 << 7)
-
-#define ILI9341_INTERFACE_CONTROL_MDT_SHIFT    (0)
-#define ILI9341_INTERFACE_CONTROL_MDT_MASK     (3 << ILI9341_INTERFACE_CONTROL_MDT_SHIFT)
-#define ILI9341_INTERFACE_CONTROL_MDT(n)       ((n) << ILI9341_INTERFACE_CONTROL_MDT_SHIFT)
-#define ILI9341_INTERFACE_CONTROL_EPF_SHIFT    (4)
-#define ILI9341_INTERFACE_CONTROL_EPF_MASK     (3 << ILI9341_INTERFACE_CONTROL_EPF_SHIFT)
-#define ILI9341_INTERFACE_CONTROL_EPF(n)       ((n) << ILI9341_INTERFACE_CONTROL_EPF_SHIFT)
-
-#define ILI9341_INTERFACE_CONTROL_RIM          (1)
-#define ILI9341_INTERFACE_CONTROL_RM           (1 << 1)
-#define ILI9341_INTERFACE_CONTROL_DM_SHIFT     (4)
-#define ILI9341_INTERFACE_CONTROL_DM_MASK      (2 << ILI9341_INTERFACE_CONTROL_DM_SHIFT)
-#define ILI9341_INTERFACE_CONTROL_DM(n)        ((n) << ILI9341_INTERFACE_CONTROL_DM_SHIFT)
-#define ILI9341_INTERFACE_CONTROL_ENDIAN       (1 << 5)
-
-/* Interface Mode control */
-
-#define ILI9341_INTERFACE_CONTROL_EPL          (1)
-#define ILI9341_INTERFACE_CONTROL_DPL          (1 << 1)
-#define ILI9341_INTERFACE_CONTROL_HSPL         (1 << 2)
-#define ILI9341_INTERFACE_CONTROL_VSPL         (1 << 3)
-#define ILI9341_INTERFACE_CONTROL_RCM_SHIFT    (5)
-#define ILI9341_INTERFACE_CONTROL_RCM_MASK     (2 << ILI9341_INTERFACE_CONTROL_RCM_SHIFT)
-#define ILI9341_INTERFACE_CONTROL_RCM(n)       ((n) << ILI9341_INTERFACE_CONTROL_RCM_SHIFT)
-#define ILI9341_INTERFACE_CONTROL_BPASS        (1 << 7)
-
-/**************************************************************************************
- * Public Types
- **************************************************************************************/
-
-struct ili9341_lcd_s {
-       /* Interface to control the ILI9341 lcd driver
-        *
-        *  - select      Select the device (as neccessary) before performing any operations.
-        *  - deselect    Deselect the device (as necessary).
-        *  - sendcmd     Send specific command to the LCD driver.
-        *  - sendparam   Send specific parameter to the LCD driver.
-        *  - recvparam   Receive specific parameter from the LCD driver.
-        *  - sendgram    Send pixel data to the LCD drivers gram.
-        *  - recvgram    Receive pixel data from the LCD drivers gram.
-        *  - backlight   Change the backlight level of the connected display.
-        *                In the context of the ili9341 that means change the
-        *                backlight level of the connected LED driver.
-        *                The implementation in detail is part of the platform
-        *                specific sub driver.
-        *
-        */
-
-       void (*select)(FAR struct ili9341_lcd_s *lcd);
-       void (*deselect)(FAR struct ili9341_lcd_s *lcd);
-       int (*sendcmd)(FAR struct ili9341_lcd_s *lcd, const uint8_t cmd);
-       int (*sendparam)(FAR struct ili9341_lcd_s *lcd, const uint8_t param);
-       int (*recvparam)(FAR struct ili9341_lcd_s *lcd, uint8_t *param);
-       int (*recvgram)(FAR struct ili9341_lcd_s *lcd, uint16_t *wd, uint32_t nwords);
-       int (*sendgram)(FAR struct ili9341_lcd_s *lcd, const uint16_t *wd, uint32_t nwords);
-       int (*backlight)(FAR struct ili9341_lcd_s *lcd, int level);
-
-       /* mcu interface specific data following */
-};
-
-/**************************************************************************************
- * Public Data
- **************************************************************************************/
-
-#ifdef __cplusplus
-#define EXTERN extern "C"
-extern "C" {
-#else
-#define EXTERN extern
-#endif
-
-/**************************************************************************************
- * Public Function Prototypes
- **************************************************************************************/
-
-/**************************************************************************************
- * Name:  ili9341_initialize
- *
- * Description:
- *   Initialize the LCD video driver internal sturcture. Also initialize the
- *   lcd hardware if not done. The control of the LCD driver is depend on the
- *   selected MCU interface and part of the platform specific subdriver (see
- *   config/stm32f429i-disco/src/stm32_ili93414ws.c)
- *
- * Input Parameters:
- *
- *   lcd - A reference to the platform specific driver instance to control the
- *     ili9341 display driver.
- *   devno - A value in the range of 0 through CONFIG_ILI9341_NINTERFACES-1.
- *     This allows support for multiple LCD devices.
- *
- * Returned Value:
- *
- *   On success, this function returns a reference to the LCD driver object for
- *   the specified LCD driver. NULL is returned on any failure.
- *
- **************************************************************************************/
-
-FAR struct lcd_dev_s *ili9341_initialize(FAR struct ili9341_lcd_s *lcd, int devno);
-
-/**************************************************************************************
- * Name:  ili9341_clear
- *
- * Description:
- *   This is a non-standard LCD interface.  Because of the various rotations, clearing
- *   the display in the normal way by writing a sequences of runs that covers the
- *   entire display can be very slow.  Here the display is cleared by simply setting
- *   all GRAM memory to the specified color.
- *
- * Parameter:
- *   dev   - A reference to the lcd driver structure
- *   color - The background color
- *
- * Returned Value:
- *
- *  On success - OK
- *  On error   - -EINVAL
- *
- **************************************************************************************/
-
-int ili9341_clear(FAR struct lcd_dev_s *dev, uint16_t color);
-#undef EXTERN
-#ifdef __cplusplus
-}
-#endif
-
-#endif                                                 /* __INCLUDE_TINYARA_LCD_ILI9341_H */