sam3u LCD driver is code complete (but untested)

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2619 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2010-04-20 02:20:42 +00:00
parent 734fcb88a5
commit fead704f62
8 changed files with 552 additions and 39 deletions
+9 -1
View File
@@ -12,7 +12,7 @@
<h1><big><font color="#3c34ec">
<i>NuttX RTOS Porting Guide</i>
</font></big></h1>
<p>Last Updated: April 16, 2010</p>
<p>Last Updated: April 19, 2010</p>
</td>
</tr>
</table>
@@ -2855,6 +2855,14 @@ extern void up_ledoff(int led);
By default, NX builds to use a framebuffer driver (see <code>include/nuttx/fb.h</code>).
If this option is defined, NX will build to use an LCD driver (see <code>include/nuttx/lcd.h</code>).
</li>
<li>
<code>CONFIG_LCD_MAXPOWER/code>:
The full-on power setting for an LCD device.
</li>
<li>
<code>CONFIG_LCD_MAXCONTRAST/code>:
The maximum contrast value for an LCD device.
</li>
<li>
<code>CONFIG_NX_MOUSE</code>:
Build in support for mouse input.
+4
View File
@@ -522,6 +522,10 @@ defconfig -- This is a configuration file similar to the Linux
By default, NX builds to use a framebuffer driver (see
include/nuttx/fb.h). If this option is defined, NX will
build to use an LCD driver (see include/nuttx/lcd.h).
CONFIG_LCD_MAXPOWER - The full-on power setting for an LCD
device.
CONFIG_LCD_MAXCONTRAST - The maximum contrast value for an
LCD device.
CONFIG_NX_MOUSE
Build in support for mouse input.
CONFIG_NX_KBD
+4
View File
@@ -664,6 +664,8 @@ CONFIG_USBSTRG_REMOVABLE=y
# By default, NX builds to use a framebuffer driver (see
# include/nuttx/fb.h). If this option is defined, NX will
# build to use an LCD driver (see include/nuttx/lcd.h).
# CONFIG_LCD_MAXPOWER - The full-on power setting for an LCD device.
# CONFIG_LCD_MAXCONTRAST - The maximum contrast value for an LCD device.
# CONFIG_NX_MOUSE
# Build in support for mouse input
# CONFIG_NX_KBD
@@ -711,6 +713,8 @@ CONFIG_NX_DISABLE_24BPP=y
CONFIG_NX_DISABLE_32BPP=y
CONFIG_NX_PACKEDMSFIRST=n
CONFIG_NX_LCDDRIVER=y
CONFIG_LCD_MAXPOWER=31
CONFIG_LCD_MAXCONTRAST=1
CONFIG_NX_MOUSE=n
CONFIG_NX_KBD=n
#CONFIG_NXTK_BORDERWIDTH=4
+14
View File
@@ -57,6 +57,11 @@
#define LCD_BASE SAM3U_EXTCS2_BASE
/* Touchscreen controller (TSC) */
#define CONFIG_TSC_ADS7843 1 /* ADS7843 present on board */
#define CONFIG_TSC_SPI 0 /* On SPI0 */
/* SAM3U-EK GPIO Pin Definitions ****************************************************/
/* LCD:
@@ -131,6 +136,11 @@
#define GPIO_LCD_BKL (GPIO_OUTPUT|GPIO_CFG_DEFAULT|GPIO_OUTPUT_CLEAR|GPIO_PORT_PIOC|GPIO_PIN19)
/* Touchscreen controller (TSC) */
#define GPIO_TCS_IRQ (PIO_INPUT|GPIO_CFG_PULLUP|GPIO_PORT_PIOA|GPIO_PIN6)
#define GPIO_TCS_BUSY (PIO_INPUT|GPIO_CFG_PULLUP|GPIO_PORT_PIOA|GPIO_PIN6)
/* LEDs */
#define GPIO_LED0 (GPIO_OUTPUT|GPIO_CFG_DEFAULT|GPIO_PORT_PIOB|GPIO_OUTPUT_CLEAR|GPIO_PIN0)
@@ -151,6 +161,10 @@
/* SPI Chip Selects */
/* Chip select pin connected to the touchscreen controller. */
#define GPIO_TSC_NPCS GPIO_SPI0_NPCS2_PC14
/************************************************************************************
* Public Types
************************************************************************************/
File diff suppressed because it is too large Load Diff
+7 -1
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* examples/nx/nx_main.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2010 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -431,6 +431,8 @@ static inline int nxeg_suinitialize(void)
return ERROR;
}
/* Get the device instance */
dev = up_lcdgetdev(CONFIG_EXAMPLES_NX_DEVNO);
if (!dev)
{
@@ -438,6 +440,10 @@ static inline int nxeg_suinitialize(void)
g_exitcode = NXEXIT_LCDGETDEV;
return ERROR;
}
/* Turn the LCD on at 75% power */
(void)dev->setpower(dev, (3*CONFIG_LCD_MAXPOWER/4));
#else
/* Initialize the frame buffer device */
+5 -2
View File
@@ -490,7 +490,10 @@ EXTERN void fb_uninitialize(void);
* If an architecture supports a parallel or serial LCD, then it must
* provide APIs to access the LCD as follows:
*
* up_lcdinitialize - Initialize the LCD video hardware
* up_lcdinitialize - 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).
* up_lcdgetdev - Return a a reference to the LCD object for
* the specified LCD. This allows support for
* multiple LCD devices.
@@ -501,7 +504,7 @@ EXTERN void fb_uninitialize(void);
struct lcd_dev_s; /* See nuttx/lcd.h */
EXTERN int up_lcdinitialize(void);
EXTERN FAR struct lcd_dev_s *up_lcdgetdev(int lcdddev);
EXTERN FAR struct lcd_dev_s *up_lcdgetdev(int lcddev);
EXTERN void up_lcduninitialize(void);
/****************************************************************************
+24 -4
View File
@@ -48,6 +48,24 @@
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
#ifndef CONFIG_LCD_MAXPOWER
# error "CONFIG_LCD_MAXPOWER is not defined"
#endif
#ifndef CONFIG_LCD_MAXCONTRAST
# error "CONFIG_LCD_MAXCONTRAST is not defined"
#endif
/* Friendlier names */
#define LCD_FULL_OFF (0)
#define LCD_FULL_ON CONFIG_LCD_MAXPOWER
#define LCD_MIN_CONTRAST (0)
#define LCD_MAX_CONTRAST CONFIG_LCD_MAXCONTRAST
/****************************************************************************
* Type Definitions
****************************************************************************/
@@ -147,14 +165,16 @@ struct lcd_dev_s
#endif
/* LCD Specific Controls **************************************************/
/* Get the LCD panel power status (0: full off - CONFIG_LCD_MAXPOWER:
* full on
/* 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.
*/
int (*getpower)(struct lcd_dev_s *dev);
/* Enable/disable LCD panel power (0: full off - CONFIG_LCD_MAXPOWERL:
* full on)
/* Enable/disable LCD panel power (0: full off - CONFIG_LCD_MAXPOWER: full
* on). On backlit LCDs, this setting may correspond to the backlight
* setting.
*/
int (*setpower)(struct lcd_dev_s *dev, int power);