SAM4E-EK: Remove bogus LCD driver; replace with information that might be useful to someone who wants to develop an LCD driver for the SAM4E-EK
This commit is contained in:
parent
a37c158659
commit
d8b2011218
@ -62,4 +62,17 @@ config SAM4EEK_HSMCI_BLOCKDEVICE
|
||||
|
||||
endchoice # AT25 serial FLASH configuration
|
||||
|
||||
config SAM4EEK_ILI9325
|
||||
bool "ILI9325-based LCD"
|
||||
default n
|
||||
depends on EXPERIMENTAL
|
||||
select NX
|
||||
select NX_LCDDRIVER
|
||||
---help---
|
||||
This option enables support for the SAM4E-EK on-board LCD. The
|
||||
SAM4E-EK carries a TFT transmissive LCD module with touch panel,
|
||||
FTM280C34D. Its integrated driver IC is ILI9325. The LCD display
|
||||
area is 2.8 inches diagonally measured, with a native resolution
|
||||
of 240 x 320 dots.
|
||||
|
||||
endif # ARCH_BOARD_SAM4EEK
|
||||
|
@ -24,6 +24,7 @@ Contents
|
||||
- USB Full-Speed Device
|
||||
- HSMCI
|
||||
- Touchscreen
|
||||
- ILI9325-Based LCD
|
||||
- SAM4E-EK-specific Configuration Options
|
||||
- Configurations
|
||||
|
||||
@ -845,49 +846,160 @@ HSMCI
|
||||
Touchscreen
|
||||
===========
|
||||
|
||||
The NSH configuration can be used to verify the ADS7843E touchscreen on
|
||||
the SAM4E-EK LCD. With these modifications, you can include the touchscreen
|
||||
test program at apps/examples/touchscreen as an NSH built-in application.
|
||||
You can enable the touchscreen and test by modifying the default
|
||||
configuration in the following ways:
|
||||
The NSH configuration can be used to verify the ADS7843E touchscreen on
|
||||
the SAM4E-EK LCD. With these modifications, you can include the touchscreen
|
||||
test program at apps/examples/touchscreen as an NSH built-in application.
|
||||
You can enable the touchscreen and test by modifying the default
|
||||
configuration in the following ways:
|
||||
|
||||
Device Drivers
|
||||
CONFIG_SPI=y : Enable SPI support
|
||||
CONFIG_SPI_EXCHANGE=y : The exchange() method is supported
|
||||
CONFIG_SPI_OWNBUS=y : Smaller code if this is the only SPI device
|
||||
Device Drivers
|
||||
CONFIG_SPI=y : Enable SPI support
|
||||
CONFIG_SPI_EXCHANGE=y : The exchange() method is supported
|
||||
CONFIG_SPI_OWNBUS=y : Smaller code if this is the only SPI device
|
||||
|
||||
CONFIG_INPUT=y : Enable support for input devices
|
||||
CONFIG_INPUT_ADS7843E=y : Enable support for the XPT2046
|
||||
CONFIG_ADS7843E_SPIDEV=2 : Use SPI CS 2 for communication
|
||||
CONFIG_ADS7843E_SPIMODE=0 : Use SPI mode 0
|
||||
CONFIG_ADS7843E_FREQUENCY=1000000 : SPI BAUD 1MHz
|
||||
CONFIG_ADS7843E_SWAPXY=y : If landscape orientation
|
||||
CONFIG_ADS7843E_THRESHX=51 : These will probably need to be tuned
|
||||
CONFIG_ADS7843E_THRESHY=39
|
||||
CONFIG_INPUT=y : Enable support for input devices
|
||||
CONFIG_INPUT_ADS7843E=y : Enable support for the XPT2046
|
||||
CONFIG_ADS7843E_SPIDEV=2 : Use SPI CS 2 for communication
|
||||
CONFIG_ADS7843E_SPIMODE=0 : Use SPI mode 0
|
||||
CONFIG_ADS7843E_FREQUENCY=1000000 : SPI BAUD 1MHz
|
||||
CONFIG_ADS7843E_SWAPXY=y : If landscape orientation
|
||||
CONFIG_ADS7843E_THRESHX=51 : These will probably need to be tuned
|
||||
CONFIG_ADS7843E_THRESHY=39
|
||||
|
||||
System Type -> Peripherals:
|
||||
CONFIG_SAM34_SPI0=y : Enable support for SPI
|
||||
System Type -> Peripherals:
|
||||
CONFIG_SAM34_SPI0=y : Enable support for SPI
|
||||
|
||||
System Type:
|
||||
CONFIG_SAM34_GPIO_IRQ=y : GPIO interrupt support
|
||||
CONFIG_SAM34_GPIOA_IRQ=y : Enable GPIO interrupts from port A
|
||||
System Type:
|
||||
CONFIG_SAM34_GPIO_IRQ=y : GPIO interrupt support
|
||||
CONFIG_SAM34_GPIOA_IRQ=y : Enable GPIO interrupts from port A
|
||||
|
||||
RTOS Features:
|
||||
CONFIG_DISABLE_SIGNALS=n : Signals are required
|
||||
RTOS Features:
|
||||
CONFIG_DISABLE_SIGNALS=n : Signals are required
|
||||
|
||||
Library Support:
|
||||
CONFIG_SCHED_WORKQUEUE=y : Work queue support required
|
||||
Library Support:
|
||||
CONFIG_SCHED_WORKQUEUE=y : Work queue support required
|
||||
|
||||
Application Configuration:
|
||||
CONFIG_EXAMPLES_TOUCHSCREEN=y : Enable the touchscreen built-in test
|
||||
Application Configuration:
|
||||
CONFIG_EXAMPLES_TOUCHSCREEN=y : Enable the touchscreen built-in test
|
||||
|
||||
Defaults should be okay for related touchscreen settings. Touchscreen
|
||||
debug output on UART0 can be enabled with:
|
||||
Defaults should be okay for related touchscreen settings. Touchscreen
|
||||
debug output on UART0 can be enabled with:
|
||||
|
||||
Build Setup:
|
||||
CONFIG_DEBUG=y : Enable debug features
|
||||
CONFIG_DEBUG_VERBOSE=y : Enable verbose debug output
|
||||
CONFIG_DEBUG_INPUT=y : Enable debug output from input devices
|
||||
Build Setup:
|
||||
CONFIG_DEBUG=y : Enable debug features
|
||||
CONFIG_DEBUG_VERBOSE=y : Enable verbose debug output
|
||||
CONFIG_DEBUG_INPUT=y : Enable debug output from input devices
|
||||
|
||||
STATUS
|
||||
2014-3-27: As of this writing, the touchscreen is untested.
|
||||
|
||||
ILI9325-Based LCD
|
||||
=================
|
||||
|
||||
The SAM4E-EK carries a TFT transmissive LCD module with touch panel,
|
||||
FTM280C34D. Its integrated driver IC is ILI9325. The LCD display area is
|
||||
2.8 inches diagonally measured, with a native resolution of 240 x 320
|
||||
dots.
|
||||
|
||||
No driver has been developed for the SAM4E-EK LCD as of this writing.
|
||||
Some technical information follows might be useful to anyone who is
|
||||
inspired to develop that driver:
|
||||
|
||||
Connectivity
|
||||
------------
|
||||
|
||||
The SAM4E16 communicates with the LCD through PIOC where an 8-bit
|
||||
parallel "8080-like" protocol data bus has to be implemented in
|
||||
software.
|
||||
|
||||
---- ----- --------- --------------------------------
|
||||
PIN PIO SIGNAL NOTES
|
||||
---- ----- --------- --------------------------------
|
||||
1 VDD
|
||||
2 PC7 DB17
|
||||
3 PC6 DB16
|
||||
4 PC5 DB15
|
||||
5 PC4 DB14
|
||||
6 PC3 DB13
|
||||
7 PC2 DB12
|
||||
8 PC1 DB11
|
||||
9 PC0 DB10
|
||||
10 DB9 Pulled low
|
||||
11 DB8 Pulled low
|
||||
12 DB7 Pulled low
|
||||
13 DB6 Pulled low
|
||||
14 DB5 Pulled low
|
||||
15 DB4 Pulled low
|
||||
16 DB3 Pulled low
|
||||
17 DB2 Pulled low
|
||||
18 DB1 Pulled low
|
||||
19 DB0 Pulled low
|
||||
---- ----- --------- --------------------------------
|
||||
20 VDD
|
||||
21 PC11 RD
|
||||
22 PC8 WR
|
||||
23 PC19 RS
|
||||
24 PD18 CS Via J8, pulled high. Connects to NRST.
|
||||
25 RESET Connects to NSRST
|
||||
26 IM0 Pulled high
|
||||
27 IM1 Grounded
|
||||
28 GND
|
||||
---- ----- --------- --------------------------------
|
||||
29 [PC13] LED-A Backlight controls: PC13 enables
|
||||
30 [PC13] LEDK1 AAT3155 charge pump that drives
|
||||
31 [PC13] LEDK2 the backlight LEDs
|
||||
32 [PC13] LEDK3
|
||||
33 [PC13] LEDK4
|
||||
34 [PC13] LEDK1
|
||||
---- ----- --------- --------------------------------
|
||||
35 Y+ These go to the ADS7843
|
||||
36 Y- touchscreen controller.
|
||||
37 X+
|
||||
38 X-
|
||||
39 NC
|
||||
---- ----- --------- --------------------------------
|
||||
|
||||
The ILI9325 IM0 and IM1 lines are pulled up and down, respectively.
|
||||
This puts the ILI9325 in the mode "i80-system 16-bit interface DB[17:10],
|
||||
DB[8:1]". As you can see above, the LCD DB[17:10] connect to PC[0:7];
|
||||
I don't understand why DB[8:1] are grounded???
|
||||
|
||||
Backlight
|
||||
---------
|
||||
|
||||
LCD backlight is made of 4 white chip LEDs in parallel, driven by an
|
||||
AAT3155 charge pump, MN4. The AAT3155 is controlled by the SAM3U4E
|
||||
through a single line Simple Serial Control (S2Cwire) interface, which
|
||||
permits to enable, disable, and set the LED drive current (LED
|
||||
brightness control) from a 32-level logarithmic scale. Four resistors
|
||||
R93/R94/R95/R96 are implemented for optional current limitation.
|
||||
|
||||
Resources
|
||||
---------
|
||||
|
||||
If you want to implement LCD support, here are some references that may
|
||||
help you:
|
||||
|
||||
1. Atmel Sample Code (ASF). There is no example for the SAM4E-EK, but
|
||||
there is for the SAM4S-EK. The LCD and its processor connectivity
|
||||
appear to be equivalent to the SAM4E-EK so this sample code should be
|
||||
a good place to begin. NOTE that the clock frequencies may be
|
||||
different and pin usage may be different. So it may be necessary to
|
||||
adjust the SAM configuration to use this example.
|
||||
|
||||
2. There is an example of an LCD driver for the SAM3U at
|
||||
configs/sam4u-ek/src/up_lcd.c. That LCD driver is for an LCD with a
|
||||
different LCD controller but should provide the NuttX SAM framework
|
||||
for an LCD driver.
|
||||
|
||||
3. There are other LCD drivers for different MCUs that do support the
|
||||
ILI9325 LCD. Look at configs/shenzhou/src/up_ili93xx.c,
|
||||
configs/stm3220g-eval/src/up_lcd.c, and
|
||||
configs/stm3240g-eval/src/up_lcd.c. I believe that the Shenzhou
|
||||
driver is the most recent.
|
||||
|
||||
STATUS:
|
||||
2014-3-27: Not implemented.
|
||||
|
||||
SAM4E-EK-specific Configuration Options
|
||||
=======================================
|
||||
|
@ -46,8 +46,8 @@ ifeq ($(CONFIG_HAVE_CXXINITIALIZE),y)
|
||||
CSRCS += sam_cxxinitialize.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD),y)
|
||||
CSRCS += sam_lcd.c
|
||||
ifeq ($(CONFIG_SAM4EEK_ILI9325),y)
|
||||
CSRCS += sam_ili9325.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NSH_ARCHINIT),y)
|
||||
|
227
configs/sam4e-ek/src/sam_ili9523.c
Normal file
227
configs/sam4e-ek/src/sam_ili9523.c
Normal file
@ -0,0 +1,227 @@
|
||||
/**************************************************************************************
|
||||
* configs/sam4e-ek/src/sam_ili9325.c
|
||||
*
|
||||
* Copyright (C) 2014 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.
|
||||
*
|
||||
**************************************************************************************/
|
||||
|
||||
/**************************************************************************************
|
||||
*
|
||||
* The SAM4E-EK carries a TFT transmissive LCD module with touch panel, FTM280C34D.
|
||||
* Its integrated driver IC is ILI9325. The LCD display area is 2.8 inches diagonally
|
||||
* measured, with a native resolution of 240 x 320 dots.
|
||||
*
|
||||
* The SAM4E16 communicates with the LCD through PIOC where an 8-bit parallel "8080-
|
||||
* like" protocol data bus has to be implemented in software.
|
||||
*
|
||||
* ---- ----- --------- --------------------------------
|
||||
* PIN PIO SIGNAL NOTES
|
||||
* ---- ----- --------- --------------------------------
|
||||
* 1 VDD
|
||||
* 2 PC7 DB17
|
||||
* 3 PC6 DB16
|
||||
* 4 PC5 DB15
|
||||
* 5 PC4 DB14
|
||||
* 6 PC3 DB13
|
||||
* 7 PC2 DB12
|
||||
* 8 PC1 DB11
|
||||
* 9 PC0 DB10
|
||||
* 10 DB9 Pulled low
|
||||
* 11 DB8 Pulled low
|
||||
* 12 DB7 Pulled low
|
||||
* 13 DB6 Pulled low
|
||||
* 14 DB5 Pulled low
|
||||
* 15 DB4 Pulled low
|
||||
* 16 DB3 Pulled low
|
||||
* 17 DB2 Pulled low
|
||||
* 18 DB1 Pulled low
|
||||
* 19 DB0 Pulled low
|
||||
* ---- ----- --------- --------------------------------
|
||||
* 20 VDD
|
||||
* 21 PC11 RD
|
||||
* 22 PC8 WR
|
||||
* 23 PC19 RS
|
||||
* 24 PD18 CS Via J8, pulled high. Connects to NRST.
|
||||
* 25 RESET Connects to NSRST
|
||||
* 26 IM0 Pulled high
|
||||
* 27 IM1 Grounded
|
||||
* 28 GND
|
||||
* ---- ----- --------- --------------------------------
|
||||
* 29 [PC13] LED-A Backlight controls: PC13 enables
|
||||
* 30 [PC13] LEDK1 AAT3155 charge pump that drives
|
||||
* 31 [PC13] LEDK2 the backlight LEDs
|
||||
* 32 [PC13] LEDK3
|
||||
* 33 [PC13] LEDK4
|
||||
* 34 [PC13] LEDK1
|
||||
* ---- ----- --------- --------------------------------
|
||||
* 35 Y+ These go to the ADS7843
|
||||
* 36 Y- touchscreen controller.
|
||||
* 37 X+
|
||||
* 38 X-
|
||||
* 39 NC
|
||||
* ---- ----- --------- --------------------------------
|
||||
*
|
||||
* The ILI9325 IM0 and IM1 lines are pulled up and down, respectively. This puts
|
||||
* the ILI9325 in the mode "i80-system 16-bit interface DB[17:10], DB[8:1]". As
|
||||
* you can see above, the LCD DB[17:10] connect to PC[0:7]; I don't understand why
|
||||
* DB[8:1] are grounded???
|
||||
*
|
||||
* LCD backlight is made of 4 white chip LEDs in parallel, driven by an AAT3155
|
||||
* charge pump, MN4. The AAT3155 is controlled by the SAM3U4E through a single line
|
||||
* Simple Serial Control (S2Cwire) interface, which permits to enable, disable, and
|
||||
* set the LED drive current (LED brightness control) from a 32-level logarithmic
|
||||
* scale. Four resistors R93/R94/R95/R96 are implemented for optional current
|
||||
* limitation.
|
||||
*
|
||||
**************************************************************************************/
|
||||
|
||||
/**************************************************************************************
|
||||
* Included Files
|
||||
**************************************************************************************/
|
||||
|
||||
/**************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
**************************************************************************************/
|
||||
|
||||
/* Configuration **********************************************************************/
|
||||
|
||||
/* Define the following to enable register-level debug output */
|
||||
|
||||
#undef CONFIG_LCD_REGDEBUG
|
||||
|
||||
/* Verbose debug must also be enabled */
|
||||
|
||||
#ifndef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# undef CONFIG_DEBUG_LED
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_DEBUG_VERBOSE
|
||||
# undef CONFIG_LCD_REGDEBUG
|
||||
#endif
|
||||
|
||||
/* Debug ******************************************************************************/
|
||||
|
||||
#ifdef CONFIG_LCD_REGDEBUG
|
||||
# define regdbg(format, arg...) vdbg(format, ##arg)
|
||||
#else
|
||||
# define regdbg(x...)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_LCD
|
||||
# define lcddbg(format, arg...) dbg(format, ##arg)
|
||||
# define lcdvdbg(format, arg...) vdbg(format, ##arg)
|
||||
#else
|
||||
# define lcddbg(x...)
|
||||
# define lcdvdbg(x...)
|
||||
#endif
|
||||
|
||||
/**************************************************************************************
|
||||
* Private Type Definition
|
||||
**************************************************************************************/
|
||||
|
||||
/**************************************************************************************
|
||||
* Private Function Prototypes
|
||||
**************************************************************************************/
|
||||
|
||||
/**************************************************************************************
|
||||
* Private Data
|
||||
**************************************************************************************/
|
||||
|
||||
/**************************************************************************************
|
||||
* Private Functions
|
||||
**************************************************************************************/
|
||||
|
||||
/**************************************************************************************
|
||||
* Public Functions
|
||||
**************************************************************************************/
|
||||
|
||||
/**************************************************************************************
|
||||
* Name: up_lcdinitialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the LCD video hardware. The initial state of the LCD is fully
|
||||
* initialized, display memory cleared, and the LCD ready to use, but with the power
|
||||
* setting at 0 (full off).
|
||||
*
|
||||
**************************************************************************************/
|
||||
|
||||
int up_lcdinitialize(void)
|
||||
{
|
||||
/* Not implemented
|
||||
*
|
||||
* If you want to implement LCD support, here are some references:
|
||||
*
|
||||
* 1. Atmel Sample Code (ASF). There is no example for the SAM4E-EK, but there is for
|
||||
* the SAM4S-EK. The LCD and its processor connectivity appear to be equivalent
|
||||
* to the SAM4E-EK so this sample code should be a good place to begin. NOTE that
|
||||
* the clock frequencies may be different and pin usage may be different. So it
|
||||
* may be necessary to adjust the SAM configuration to use this example.
|
||||
* 2. There is an example of an LCD driver for the SAM3U at configs/sam4u-ek/src/up_lcd.c.
|
||||
* That LCD driver is for an LCD with a different LCD controller but should provide
|
||||
* the NuttX SAM framework for an LCD driver.
|
||||
* 3. There are other LCD drivers for different MCUs that do support the ILI9325
|
||||
* LCD. Look at configs/shenzhou/src/up_ili93xx.c, configs/stm3220g-eval/src/up_lcd.c,
|
||||
* and configs/stm3240g-eval/src/up_lcd.c. I believe that the Shenzhou driver is
|
||||
* the most recent.
|
||||
*/
|
||||
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
/**************************************************************************************
|
||||
* Name: up_lcdgetdev
|
||||
*
|
||||
* Description:
|
||||
* Return a a reference to the LCD object for the specified LCD. This allows
|
||||
* support for multiple LCD devices.
|
||||
*
|
||||
**************************************************************************************/
|
||||
|
||||
FAR struct lcd_dev_s *up_lcdgetdev(int lcddev)
|
||||
{
|
||||
/* Not implemented */
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**************************************************************************************
|
||||
* Name: up_lcduninitialize
|
||||
*
|
||||
* Description:
|
||||
* Unitialize the framebuffer support.
|
||||
*
|
||||
**************************************************************************************/
|
||||
|
||||
void up_lcduninitialize(void)
|
||||
{
|
||||
/* Not implemented */
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user