mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
LCD bug fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3166 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -1399,3 +1399,5 @@
|
|||||||
* drivers/lcd/nokia6100.c -- A driver for the Nokia 6100 LCD.
|
* drivers/lcd/nokia6100.c -- A driver for the Nokia 6100 LCD.
|
||||||
* configs/olimex-lpc1766stk/nx -- A NX graphics configuration for the Olimex
|
* configs/olimex-lpc1766stk/nx -- A NX graphics configuration for the Olimex
|
||||||
LPC1766-STK board using the Nokia 6100 LCD driver.
|
LPC1766-STK board using the Nokia 6100 LCD driver.
|
||||||
|
* include/nuttx/spi.h -- the SPI_SETBITS macro was calling the setmode method.
|
||||||
|
This is a very important bug-fix in some usages.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<tr align="center" bgcolor="#e4e4e4">
|
<tr align="center" bgcolor="#e4e4e4">
|
||||||
<td>
|
<td>
|
||||||
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
|
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
|
||||||
<p>Last Updated: December 4, 2010</p>
|
<p>Last Updated: December 6, 2010</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -1276,10 +1276,11 @@
|
|||||||
The NSH configuration support the Nucleus2G's microSD slot and additional configurations
|
The NSH configuration support the Nucleus2G's microSD slot and additional configurations
|
||||||
are available to exercise the the USB serial and USB mass storage devices.
|
are available to exercise the the USB serial and USB mass storage devices.
|
||||||
However, due to some technical reasons, neither the SPI nor the USB device drivers are fully verified.
|
However, due to some technical reasons, neither the SPI nor the USB device drivers are fully verified.
|
||||||
(Although it has been reported to me that the SPI microSD is functional on other platforms).
|
(Although they have since been verfiied on other platforms; this needs to be revisited on the Nucleus2G).
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Support for the mbed board was contributed by Dave Marples and released in NuttX-5.11.
|
Support for the mbed board was contributed by Dave Marples and released in NuttX-5.11.
|
||||||
|
This port includes a NuttX OS test configuration(see <code>examples/ostest</code>).
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Support for that Olimex-LPC1766-STK board was added to NuttX 5.13.
|
Support for that Olimex-LPC1766-STK board was added to NuttX 5.13.
|
||||||
@@ -1287,7 +1288,7 @@
|
|||||||
Verified configurations are now available for the NuttX OS test,
|
Verified configurations are now available for the NuttX OS test,
|
||||||
for the NuttShell (NSH, see the <a href="ttp://www.nuttx.org/NuttShell.html">NSH User Guide</a>),
|
for the NuttShell (NSH, see the <a href="ttp://www.nuttx.org/NuttShell.html">NSH User Guide</a>),
|
||||||
for the NuttX network test, and for the <a href="http://acme.com/software/thttpd">THTTPD</a> webserver.
|
for the NuttX network test, and for the <a href="http://acme.com/software/thttpd">THTTPD</a> webserver.
|
||||||
Additional drivers for USB device and MicroSD has also be added and verified are available in CVS;
|
Additional drivers for USB device and MicroSD have also be added and have been verified and are available in CVS;
|
||||||
A driver for the Nokia 6100 LCD has been added and is under test now.
|
A driver for the Nokia 6100 LCD has been added and is under test now.
|
||||||
All are expected to be released in NuttX-5.15.
|
All are expected to be released in NuttX-5.15.
|
||||||
</p>
|
</p>
|
||||||
@@ -2021,6 +2022,8 @@ nuttx-5.15 2010-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
|||||||
* drivers/lcd/nokia6100.c -- A driver for the Nokia 6100 LCD.
|
* drivers/lcd/nokia6100.c -- A driver for the Nokia 6100 LCD.
|
||||||
* configs/olimex-lpc1766stk/nx -- A NX graphics configuration for the Olimex
|
* configs/olimex-lpc1766stk/nx -- A NX graphics configuration for the Olimex
|
||||||
LPC1766-STK board using the Nokia 6100 LCD driver.
|
LPC1766-STK board using the Nokia 6100 LCD driver.
|
||||||
|
* include/nuttx/spi.h -- the SPI_SETBITS macro was calling the setmode method.
|
||||||
|
This is a very important bug-fix in some usages.
|
||||||
|
|
||||||
pascal-2.1 2010-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
pascal-2.1 2010-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
|
||||||
|
|||||||
@@ -2838,6 +2838,27 @@ build
|
|||||||
<li>
|
<li>
|
||||||
<code>CONFIG_NOKIA6100_BLINIT</code>: Initial backlight setting
|
<code>CONFIG_NOKIA6100_BLINIT</code>: Initial backlight setting
|
||||||
</li>
|
</li>
|
||||||
|
<p>
|
||||||
|
The following may need to be tuned for your hardware:
|
||||||
|
</p>
|
||||||
|
<li>
|
||||||
|
<code>CONFIG_NOKIA6100_INVERT</code>: Display inversion, 0 or 1, Default: 1
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<code>CONFIG_NOKIA6100_MY</code>: Display row direction, 0 or 1, Default: 0
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<code>CONFIG_NOKIA6100_MX</code>: Display column direction, 0 or 1, Default: 1
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<code>CONFIG_NOKIA6100_V</code>: Display address direction, 0 or 1, Default: 0
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<code>CONFIG_NOKIA6100_ML</code>: Display scan direction, 0 or 1, Default: 0
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<code>CONFIG_NOKIA6100_RGBORD</code>: Display RGB order, 0 or 1, Default: 0
|
||||||
|
</li>
|
||||||
<p>
|
<p>
|
||||||
Required LCD driver settings:
|
Required LCD driver settings:
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -434,13 +434,14 @@ static void ssp_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
sspdbg("Bad mode: %d\n", mode);
|
||||||
DEBUGASSERT(FALSE);
|
DEBUGASSERT(FALSE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ssp_putreg(priv, LPC17_SSP_CR0_OFFSET, regval);
|
ssp_putreg(priv, LPC17_SSP_CR0_OFFSET, regval);
|
||||||
|
|
||||||
/* Save the mode so that subsequent re-configuratins will be faster */
|
/* Save the mode so that subsequent re-configurations will be faster */
|
||||||
|
|
||||||
#ifndef CONFIG_SPI_OWNBUS
|
#ifndef CONFIG_SPI_OWNBUS
|
||||||
priv->mode = mode;
|
priv->mode = mode;
|
||||||
|
|||||||
+14
-6
@@ -430,14 +430,14 @@ defconfig -- This is a configuration file similar to the Linux
|
|||||||
CONFIG_PAGING_AT45DB - Use the at45db.c FLASH driver. If this is selected,
|
CONFIG_PAGING_AT45DB - Use the at45db.c FLASH driver. If this is selected,
|
||||||
then the MTD interface to the Atmel AT45DB device will be used to support
|
then the MTD interface to the Atmel AT45DB device will be used to support
|
||||||
paging.
|
paging.
|
||||||
CONFIG_PAGING_BINOFFSET - If CONFIG_PAGING_M25PX or is CONFIG_PAGING_AT45DB
|
CONFIG_PAGING_BINOFFSET - If CONFIG_PAGING_M25PX or is CONFIG_PAGING_AT45DB
|
||||||
defined then CONFIG_PAGING_BINOFFSET will be used to specify the offset
|
defined then CONFIG_PAGING_BINOFFSET will be used to specify the offset
|
||||||
in bytes into the FLASH device where the NuttX binary image is located.
|
in bytes into the FLASH device where the NuttX binary image is located.
|
||||||
Default: 0
|
Default: 0
|
||||||
CONFIG_PAGING_SPIPORT - If CONFIG_PAGING_M25PX CONFIG_PAGING_AT45DB is
|
CONFIG_PAGING_SPIPORT - If CONFIG_PAGING_M25PX CONFIG_PAGING_AT45DB is
|
||||||
defined and the device has multiple SPI busses (ports), then this
|
defined and the device has multiple SPI busses (ports), then this
|
||||||
configuration should be set to indicate which SPI port the device is
|
configuration should be set to indicate which SPI port the device is
|
||||||
connected. Default: 0
|
connected. Default: 0
|
||||||
|
|
||||||
The following can be used to disable categories of APIs supported
|
The following can be used to disable categories of APIs supported
|
||||||
by the OS. If the compiler supports weak functions, then it
|
by the OS. If the compiler supports weak functions, then it
|
||||||
@@ -557,6 +557,14 @@ defconfig -- This is a configuration file similar to the Linux
|
|||||||
CONFIG_NOKIA6100_PCF8833 - Selects the Phillips PCF8833 display controller
|
CONFIG_NOKIA6100_PCF8833 - Selects the Phillips PCF8833 display controller
|
||||||
CONFIG_NOKIA6100_BLINIT - Initial backlight setting
|
CONFIG_NOKIA6100_BLINIT - Initial backlight setting
|
||||||
|
|
||||||
|
The following may need to be tuned for your hardware:
|
||||||
|
CONFIG_NOKIA6100_INVERT - Display inversion, 0 or 1, Default: 1
|
||||||
|
CONFIG_NOKIA6100_MY - Display row direction, 0 or 1, Default: 0
|
||||||
|
CONFIG_NOKIA6100_MX - Display column direction, 0 or 1, Default: 1
|
||||||
|
CONFIG_NOKIA6100_V - Display address direction, 0 or 1, Default: 0
|
||||||
|
CONFIG_NOKIA6100_ML - Display scan direction, 0 or 1, Default: 0
|
||||||
|
CONFIG_NOKIA6100_RGBORD - Display RGB order, 0 or 1, Default: 0
|
||||||
|
|
||||||
Required LCD driver settings:
|
Required LCD driver settings:
|
||||||
CONFIG_LCD_NOKIA6100 - Enable Nokia 6100 support
|
CONFIG_LCD_NOKIA6100 - Enable Nokia 6100 support
|
||||||
CONFIG_LCD_MAXCONTRAST - must be 63 with the Epson controller and 127 with
|
CONFIG_LCD_MAXCONTRAST - must be 63 with the Epson controller and 127 with
|
||||||
|
|||||||
+114
-36
@@ -83,6 +83,14 @@
|
|||||||
* CONFIG_NOKIA6100_PCF8833 - Selects the Phillips PCF8833 display controller
|
* CONFIG_NOKIA6100_PCF8833 - Selects the Phillips PCF8833 display controller
|
||||||
* CONFIG_NOKIA6100_BLINIT - Initial backlight setting
|
* CONFIG_NOKIA6100_BLINIT - Initial backlight setting
|
||||||
*
|
*
|
||||||
|
* The following may need to be tuned for your hardware:
|
||||||
|
* CONFIG_NOKIA6100_INVERT - Display inversion, 0 or 1, Default: 1
|
||||||
|
* CONFIG_NOKIA6100_MY - Display row direction, 0 or 1, Default: 0
|
||||||
|
* CONFIG_NOKIA6100_MX - Display column direction, 0 or 1, Default: 1
|
||||||
|
* CONFIG_NOKIA6100_V - Display address direction, 0 or 1, Default: 0
|
||||||
|
* CONFIG_NOKIA6100_ML - Display scan direction, 0 or 1, Default: 0
|
||||||
|
* CONFIG_NOKIA6100_RGBORD - Display RGB order, 0 or 1, Default: 0
|
||||||
|
*
|
||||||
* Required LCD driver settings:
|
* Required LCD driver settings:
|
||||||
* CONFIG_LCD_NOKIA6100 - Enable Nokia 6100 support
|
* CONFIG_LCD_NOKIA6100 - Enable Nokia 6100 support
|
||||||
* CONFIG_LCD_MAXCONTRAST - must be 63 with the Epson controller and 127 with
|
* CONFIG_LCD_MAXCONTRAST - must be 63 with the Epson controller and 127 with
|
||||||
@@ -157,6 +165,32 @@
|
|||||||
# error "One of CONFIG_NOKIA6100_S1D15G10 or CONFIG_NOKIA6100_PCF8833 must be defined"
|
# error "One of CONFIG_NOKIA6100_S1D15G10 or CONFIG_NOKIA6100_PCF8833 must be defined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Delay geometry defaults */
|
||||||
|
|
||||||
|
#ifndef CONFIG_NOKIA6100_INVERT
|
||||||
|
# define CONFIG_NOKIA6100_INVERT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_NOKIA6100_MY
|
||||||
|
# define CONFIG_NOKIA6100_MY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_NOKIA6100_MX
|
||||||
|
# define CONFIG_NOKIA6100_MX 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_NOKIA6100_V
|
||||||
|
# define CONFIG_NOKIA6100_V 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_NOKIA6100_ML
|
||||||
|
# define CONFIG_NOKIA6100_ML 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_NOKIA6100_RGBORD
|
||||||
|
# define CONFIG_NOKIA6100_RGBORD 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Check contrast selection */
|
/* Check contrast selection */
|
||||||
|
|
||||||
#ifdef CONFIG_NOKIA6100_S1D15G10
|
#ifdef CONFIG_NOKIA6100_S1D15G10
|
||||||
@@ -200,11 +234,9 @@
|
|||||||
|
|
||||||
#define NOKIA_LCD_DATA (1 << 9)
|
#define NOKIA_LCD_DATA (1 << 9)
|
||||||
|
|
||||||
/* Define the following to enable register-level debug output */
|
/* Define CONFIG_LCD_REGDEBUG to enable register-level debug output.
|
||||||
|
* (Verbose debug must also be enabled)
|
||||||
#undef CONFIG_LCD_REGDEBUG
|
*/
|
||||||
|
|
||||||
/* Verbose debug must also be enabled */
|
|
||||||
|
|
||||||
#ifndef CONFIG_DEBUG
|
#ifndef CONFIG_DEBUG
|
||||||
# undef CONFIG_DEBUG_VERBOSE
|
# undef CONFIG_DEBUG_VERBOSE
|
||||||
@@ -258,10 +290,17 @@
|
|||||||
|
|
||||||
/* Handle any potential strange behavior at edges */
|
/* Handle any potential strange behavior at edges */
|
||||||
|
|
||||||
|
#if 0 /* REVISIT */
|
||||||
#define NOKIA_PGBIAS 2 /* May not be necessary */
|
#define NOKIA_PGBIAS 2 /* May not be necessary */
|
||||||
#define NOKIA_COLBIAS 0
|
#define NOKIA_COLBIAS 0
|
||||||
#define NOKIA_XBIAS 2 /* May not be necessary */
|
#define NOKIA_XBIAS 2 /* May not be necessary, if so need to subtract from XRES */
|
||||||
#define NOKIA_YBIAS 0
|
#define NOKIA_YBIAS 0
|
||||||
|
#else
|
||||||
|
#define NOKIA_PGBIAS 0
|
||||||
|
#define NOKIA_COLBIAS 0
|
||||||
|
#define NOKIA_XBIAS 0
|
||||||
|
#define NOKIA_YBIAS 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NOKIA_ENDPAGE 131
|
#define NOKIA_ENDPAGE 131
|
||||||
#define NOKIA_ENDCOL 131
|
#define NOKIA_ENDCOL 131
|
||||||
@@ -269,7 +308,7 @@
|
|||||||
/* Debug ******************************************************************************/
|
/* Debug ******************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_LCD_REGDEBUG
|
#ifdef CONFIG_LCD_REGDEBUG
|
||||||
# define lcddbg(format, arg...) vdbg(format, ##arg)
|
# define lcddbg(format, arg...) llvdbg(format, ##arg)
|
||||||
#else
|
#else
|
||||||
# define lcddbg(x...)
|
# define lcddbg(x...)
|
||||||
#endif
|
#endif
|
||||||
@@ -484,24 +523,33 @@ static const uint8_t g_pwrctr[] =
|
|||||||
* P3: Grayscale setup
|
* P3: Grayscale setup
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if CONFIG_NOKIA6100_BPP == 12
|
|
||||||
static const uint8_t g_datctl[] =
|
static const uint8_t g_datctl[] =
|
||||||
{
|
{
|
||||||
S1D15G10_DATCTL, /* Data control */
|
S1D15G10_DATCTL, /* Data control */
|
||||||
DATCTL_PGADDR_INV, /* Page addr inverted, col addr normal, addr scan in col direction */
|
0
|
||||||
//DATCTL_PGADDR_INV|DATCTL_COLADDR_REV /* Page addr inverted, col addr normal, addr scan in col direction */
|
#if CONFIG_NOKIA6100_MY != 0 /* Display row direction */
|
||||||
0, /* RGB->RGB */
|
|DATCTL_PGADDR_INV /* Page address inverted */
|
||||||
DATCTL_16GRAY_A /* Selects 16-bit color, Type A */
|
|
||||||
};
|
|
||||||
#else /* CONFIG_NOKIA6100_BPP == 8 */
|
|
||||||
static const uint8_t g_datctl[] =
|
|
||||||
{
|
|
||||||
S1D15G10_DATCTL, /* Data control */
|
|
||||||
0, /* Page addr normal, col addr normal, addr scan in col direction */
|
|
||||||
0, /* RGB->RGB */
|
|
||||||
DATCTL_8GRAY /* Selects 8-bit color */
|
|
||||||
};
|
|
||||||
#endif
|
#endif
|
||||||
|
#if CONFIG_NOKIA6100_MX != 0 /* Display column direction */
|
||||||
|
|DATCTL_COLADDR_REV /* Column address reversed */
|
||||||
|
#endif
|
||||||
|
#if CONFIG_NOKIA6100_V != 0 /* Display address direction */
|
||||||
|
|DATCTL_ADDR_PGDIR /* Address scan in page direction */
|
||||||
|
#endif
|
||||||
|
,
|
||||||
|
#if CONFIG_NOKIA6100_RGBORD != 0
|
||||||
|
DATCTL_BGR, /* RGB->BGR */
|
||||||
|
#else
|
||||||
|
0, /* RGB->RGB */
|
||||||
|
#endif
|
||||||
|
#if CONFIG_NOKIA6100_BPP == 8
|
||||||
|
DATCTL_16GRAY_A /* Selects 16-bit color, Type A */
|
||||||
|
#elif CONFIG_NOKIA6100_BPP == 12
|
||||||
|
DATCTL_8GRAY /* Selects 8-bit color */
|
||||||
|
#else
|
||||||
|
# error "16-bit mode not yet implemented"
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
/* Voltage control (contrast setting):
|
/* Voltage control (contrast setting):
|
||||||
* P1: Volume value
|
* P1: Volume value
|
||||||
@@ -570,7 +618,22 @@ static const uint8_t g_colmod[] =
|
|||||||
static const uint8_t g_madctl[] =
|
static const uint8_t g_madctl[] =
|
||||||
{
|
{
|
||||||
PCF8833_MADCTL, /* Memory data access control*/
|
PCF8833_MADCTL, /* Memory data access control*/
|
||||||
MADCTL_MX|MADCTL_MY|MADCTL_RGB /* Mirror x and y, reverse rgb */
|
0
|
||||||
|
#ifdef CONFIG_NOKIA6100_RGBORD != 0
|
||||||
|
|MADCTL_RGB /* RGB->BGR */
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_NOKIA6100_MY != 0 /* Display row direction */
|
||||||
|
|MADCTL_MY /* Mirror Y */
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_NOKIA6100_MX != 0 /* Display column direction */
|
||||||
|
|MADCTL_MX /* Mirror X */
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_NOKIA6100_V != 0 /* Display address direction */
|
||||||
|
|MADCTL_V /* ertical RAM write; in Y direction */
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_NOKIA6100_ML != 0 /* Display scan direction */
|
||||||
|
|MADCTL_LAO /* Line address order bottom to top */
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Set contrast (SETCON) */
|
/* Set contrast (SETCON) */
|
||||||
@@ -605,12 +668,8 @@ static const uint8_t g_setcon[] =
|
|||||||
|
|
||||||
static inline void nokia_configspi(FAR struct spi_dev_s *spi)
|
static inline void nokia_configspi(FAR struct spi_dev_s *spi)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_NOKIA6100_FREQUENCY
|
|
||||||
lcddbg("Mode: %d Bits: %d Frequency: %d\n",
|
lcddbg("Mode: %d Bits: %d Frequency: %d\n",
|
||||||
CONFIG_NOKIA6100_SPIMODE, CONFIG_NOKIA6100_WORDWIDTH, CONFIG_NOKIA6100_FREQUENCY);
|
CONFIG_NOKIA6100_SPIMODE, CONFIG_NOKIA6100_WORDWIDTH, CONFIG_NOKIA6100_FREQUENCY);
|
||||||
#else
|
|
||||||
lcddbg("Mode: %d Bits: 9\n", CONFIG_NOKIA6100_SPIMODE);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Configure SPI for the Nokia 6100. But only if we own the SPI bus. Otherwise, don't
|
/* Configure SPI for the Nokia 6100. But only if we own the SPI bus. Otherwise, don't
|
||||||
* bother because it might change.
|
* bother because it might change.
|
||||||
@@ -619,10 +678,8 @@ static inline void nokia_configspi(FAR struct spi_dev_s *spi)
|
|||||||
#ifdef CONFIG_SPI_OWNBUS
|
#ifdef CONFIG_SPI_OWNBUS
|
||||||
SPI_SETMODE(spi, CONFIG_NOKIA6100_SPIMODE);
|
SPI_SETMODE(spi, CONFIG_NOKIA6100_SPIMODE);
|
||||||
SPI_SETBITS(spi, CONFIG_NOKIA6100_WORDWIDTH);
|
SPI_SETBITS(spi, CONFIG_NOKIA6100_WORDWIDTH);
|
||||||
#ifdef CONFIG_NOKIA6100_FREQUENCY
|
|
||||||
SPI_SETFREQUENCY(spi, CONFIG_NOKIA6100_FREQUENCY)
|
SPI_SETFREQUENCY(spi, CONFIG_NOKIA6100_FREQUENCY)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************************
|
/**************************************************************************************
|
||||||
@@ -646,6 +703,7 @@ static inline void nokia_select(FAR struct spi_dev_s *spi)
|
|||||||
{
|
{
|
||||||
/* We own the SPI bus, so just select the chip */
|
/* We own the SPI bus, so just select the chip */
|
||||||
|
|
||||||
|
lcddbg("SELECTED\n");
|
||||||
SPI_SELECT(spi, SPIDEV_DISPLAY, true);
|
SPI_SELECT(spi, SPIDEV_DISPLAY, true);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -655,6 +713,7 @@ static void nokia_select(FAR struct spi_dev_s *spi)
|
|||||||
* devices competing for the SPI bus
|
* devices competing for the SPI bus
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
lcddbg("SELECTED\n");
|
||||||
SPI_LOCK(spi, true);
|
SPI_LOCK(spi, true);
|
||||||
SPI_SELECT(spi, SPIDEV_DISPLAY, true);
|
SPI_SELECT(spi, SPIDEV_DISPLAY, true);
|
||||||
|
|
||||||
@@ -664,9 +723,7 @@ static void nokia_select(FAR struct spi_dev_s *spi)
|
|||||||
|
|
||||||
SPI_SETMODE(spi, CONFIG_NOKIA6100_SPIMODE);
|
SPI_SETMODE(spi, CONFIG_NOKIA6100_SPIMODE);
|
||||||
SPI_SETBITS(spi, CONFIG_NOKIA6100_WORDWIDTH);
|
SPI_SETBITS(spi, CONFIG_NOKIA6100_WORDWIDTH);
|
||||||
#ifdef CONFIG_NOKIA6100_FREQUENCY
|
|
||||||
SPI_SETFREQUENCY(spi, CONFIG_NOKIA6100_FREQUENCY);
|
SPI_SETFREQUENCY(spi, CONFIG_NOKIA6100_FREQUENCY);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -691,6 +748,7 @@ static inline void nokia_deselect(FAR struct spi_dev_s *spi)
|
|||||||
{
|
{
|
||||||
/* We own the SPI bus, so just de-select the chip */
|
/* We own the SPI bus, so just de-select the chip */
|
||||||
|
|
||||||
|
lcddbg("DE-SELECTED\n");
|
||||||
SPI_SELECT(spi, SPIDEV_DISPLAY, false);
|
SPI_SELECT(spi, SPIDEV_DISPLAY, false);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -698,6 +756,7 @@ static void nokia_deselect(FAR struct spi_dev_s *spi)
|
|||||||
{
|
{
|
||||||
/* De-select Nokia 6100 chip and relinquish the SPI bus. */
|
/* De-select Nokia 6100 chip and relinquish the SPI bus. */
|
||||||
|
|
||||||
|
lcddbg("DE-SELECTED\n");
|
||||||
SPI_SELECT(spi, SPIDEV_DISPLAY, false);
|
SPI_SELECT(spi, SPIDEV_DISPLAY, false);
|
||||||
SPI_LOCK(spi, false);
|
SPI_LOCK(spi, false);
|
||||||
}
|
}
|
||||||
@@ -715,6 +774,7 @@ static void nokia_sndcmd(FAR struct spi_dev_s *spi, const uint8_t cmd)
|
|||||||
{
|
{
|
||||||
/* Select the LCD */
|
/* Select the LCD */
|
||||||
|
|
||||||
|
lcddbg("cmd: %02x\n", cmd);
|
||||||
nokia_select(spi);
|
nokia_select(spi);
|
||||||
|
|
||||||
/* Send the command. Bit 8 == 0 denotes a command */
|
/* Send the command. Bit 8 == 0 denotes a command */
|
||||||
@@ -737,14 +797,15 @@ static void nokia_sndcmd(FAR struct spi_dev_s *spi, const uint8_t cmd)
|
|||||||
static void nokia_cmddata(FAR struct spi_dev_s *spi, uint8_t cmd, int datlen,
|
static void nokia_cmddata(FAR struct spi_dev_s *spi, uint8_t cmd, int datlen,
|
||||||
const uint8_t *data)
|
const uint8_t *data)
|
||||||
{
|
{
|
||||||
uint16_t *linebuf = g_rowbuf;
|
uint16_t *rowbuf = g_rowbuf;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
lcddbg("cmd: %02x datlen: %d\n", cmd, datlen);
|
||||||
DEBUGASSERT(datlen <= NOKIA_STRIDE);
|
DEBUGASSERT(datlen <= NOKIA_STRIDE);
|
||||||
|
|
||||||
/* Copy the command into the line buffer. Bit 8 == 0 denotes a command. */
|
/* Copy the command into the line buffer. Bit 8 == 0 denotes a command. */
|
||||||
|
|
||||||
*linebuf++ = cmd;
|
*rowbuf++ = cmd;
|
||||||
|
|
||||||
/* Copy any data after the command into the line buffer */
|
/* Copy any data after the command into the line buffer */
|
||||||
|
|
||||||
@@ -752,7 +813,7 @@ static void nokia_cmddata(FAR struct spi_dev_s *spi, uint8_t cmd, int datlen,
|
|||||||
{
|
{
|
||||||
/* Bit 8 == 1 denotes data */
|
/* Bit 8 == 1 denotes data */
|
||||||
|
|
||||||
*linebuf++ = (uint16_t)*data++ | NOKIA_LCD_DATA;
|
*rowbuf++ = (uint16_t)*data++ | NOKIA_LCD_DATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Select the LCD */
|
/* Select the LCD */
|
||||||
@@ -791,6 +852,14 @@ static void nokia_ramwr(FAR struct spi_dev_s *spi, int datlen, const uint8_t *da
|
|||||||
|
|
||||||
static void nokia_cmdarray(FAR struct spi_dev_s *spi, int len, const uint8_t *cmddata)
|
static void nokia_cmdarray(FAR struct spi_dev_s *spi, int len, const uint8_t *cmddata)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_LCD_REGDEBUG
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < len; i++)
|
||||||
|
{
|
||||||
|
lcddbg("cmddata[%d]: %02x\n", i, cmddata[i]);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
nokia_cmddata(spi, cmddata[0], len-1, &cmddata[1]);
|
nokia_cmddata(spi, cmddata[0], len-1, &cmddata[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -804,7 +873,7 @@ static void nokia_cmdarray(FAR struct spi_dev_s *spi, int len, const uint8_t *cm
|
|||||||
|
|
||||||
static void nokia_clrram(FAR struct spi_dev_s *spi)
|
static void nokia_clrram(FAR struct spi_dev_s *spi)
|
||||||
{
|
{
|
||||||
uint16_t *linebuf = g_rowbuf;
|
uint16_t *rowbuf = g_rowbuf;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Set all zero data in the line buffer */
|
/* Set all zero data in the line buffer */
|
||||||
@@ -813,7 +882,7 @@ static void nokia_clrram(FAR struct spi_dev_s *spi)
|
|||||||
{
|
{
|
||||||
/* Bit 8 == 1 denotes data */
|
/* Bit 8 == 1 denotes data */
|
||||||
|
|
||||||
*linebuf++ = NOKIA_LCD_DATA;
|
*rowbuf++ = NOKIA_LCD_DATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Select the LCD and send the RAMWR command */
|
/* Select the LCD and send the RAMWR command */
|
||||||
@@ -862,7 +931,7 @@ static int nokia_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffe
|
|||||||
#if NOKIA_XBIAS > 0
|
#if NOKIA_XBIAS > 0
|
||||||
row += NOKIA_YBIAS;
|
row += NOKIA_YBIAS;
|
||||||
#endif
|
#endif
|
||||||
DEBUGASSERT(buffer && col < NOKIA_XRES && row >= 0 && );
|
DEBUGASSERT(buffer && col >=0 && (col + npixels) <= NOKIA_XRES && row >= 0 && row < NOKIA_YRES);
|
||||||
|
|
||||||
/* Set up to write the run. */
|
/* Set up to write the run. */
|
||||||
|
|
||||||
@@ -1070,7 +1139,11 @@ static int nokia_initialize(struct nokia_dev_s *priv)
|
|||||||
nokia_cmdarray(spi, sizeof(g_volctr), g_volctr); /* Volume control (contrast) */
|
nokia_cmdarray(spi, sizeof(g_volctr), g_volctr); /* Volume control (contrast) */
|
||||||
nokia_cmdarray(spi, sizeof(g_pwrctr), g_pwrctr); /* Turn on voltage regulators */
|
nokia_cmdarray(spi, sizeof(g_pwrctr), g_pwrctr); /* Turn on voltage regulators */
|
||||||
up_mdelay(100);
|
up_mdelay(100);
|
||||||
|
#ifdef CONFIG_NOKIA6100_INVERT
|
||||||
nokia_sndcmd(spi, S1D15G10_DISINV); /* Invert display */
|
nokia_sndcmd(spi, S1D15G10_DISINV); /* Invert display */
|
||||||
|
#else
|
||||||
|
nokia_sndcmd(spi, S1D15G10_DISNOR); /* Normal display */
|
||||||
|
#endif
|
||||||
nokia_cmdarray(spi, sizeof(g_datctl), g_datctl); /* Data control */
|
nokia_cmdarray(spi, sizeof(g_datctl), g_datctl); /* Data control */
|
||||||
#if CONFIG_NOKIA6100_BPP == 8
|
#if CONFIG_NOKIA6100_BPP == 8
|
||||||
nokia_cmdarray(spi, sizeof(g_rgbset8), g_rgbset8); /* Set up color lookup table */
|
nokia_cmdarray(spi, sizeof(g_rgbset8), g_rgbset8); /* Set up color lookup table */
|
||||||
@@ -1091,7 +1164,11 @@ static int nokia_initialize(struct nokia_dev_s *priv)
|
|||||||
|
|
||||||
nokia_sndcmd(spi, PCF8833_SLEEPOUT); /* Exit sleep mode */
|
nokia_sndcmd(spi, PCF8833_SLEEPOUT); /* Exit sleep mode */
|
||||||
nokia_sndcmd(spi, PCF8833_BSTRON); /* Turn on voltage booster */
|
nokia_sndcmd(spi, PCF8833_BSTRON); /* Turn on voltage booster */
|
||||||
|
#ifdef CONFIG_NOKIA6100_INVERT
|
||||||
nokia_sndcmd(spi, PCF8833_INVON); /* Invert display */
|
nokia_sndcmd(spi, PCF8833_INVON); /* Invert display */
|
||||||
|
#else
|
||||||
|
nokia_sndcmd(spi, PCF8833_INVOFF); /* Don't invert display */
|
||||||
|
#endif
|
||||||
nokia_cmdarray(spi, sizeof(g_madctl), g_madctl); /* Memory data access control */
|
nokia_cmdarray(spi, sizeof(g_madctl), g_madctl); /* Memory data access control */
|
||||||
nokia_cmdarray(spi, sizeof(g_colmod), g_colmod); /* Color interface pixel format */
|
nokia_cmdarray(spi, sizeof(g_colmod), g_colmod); /* Color interface pixel format */
|
||||||
nokia_cmdarray(spi, sizeof(g_setcon), g_setcon); /* Set contrast */
|
nokia_cmdarray(spi, sizeof(g_setcon), g_setcon); /* Set contrast */
|
||||||
@@ -1141,6 +1218,7 @@ FAR struct lcd_dev_s *nokia_lcdinitialize(FAR struct spi_dev_s *spi, unsigned in
|
|||||||
|
|
||||||
/* Configure and enable the LCD controller */
|
/* Configure and enable the LCD controller */
|
||||||
|
|
||||||
|
nokia_configspi(spi);
|
||||||
if (nokia_initialize(priv) == OK)
|
if (nokia_initialize(priv) == OK)
|
||||||
{
|
{
|
||||||
/* Turn on the backlight */
|
/* Turn on the backlight */
|
||||||
|
|||||||
@@ -58,6 +58,14 @@
|
|||||||
* CONFIG_NOKIA6100_PCF8833 - Selects the Phillips PCF8833 display controller
|
* CONFIG_NOKIA6100_PCF8833 - Selects the Phillips PCF8833 display controller
|
||||||
* CONFIG_NOKIA6100_BLINIT - Initial backlight setting
|
* CONFIG_NOKIA6100_BLINIT - Initial backlight setting
|
||||||
*
|
*
|
||||||
|
* The following may need to be tuned for your hardware:
|
||||||
|
* CONFIG_NOKIA6100_INVERT - Display inversion, 0 or 1, Default: 1
|
||||||
|
* CONFIG_NOKIA6100_MY - Display row direction, 0 or 1, Default: 0
|
||||||
|
* CONFIG_NOKIA6100_MX - Display column direction, 0 or 1, Default: 1
|
||||||
|
* CONFIG_NOKIA6100_V - Display address direction, 0 or 1, Default: 0
|
||||||
|
* CONFIG_NOKIA6100_ML - Display scan direction, 0 or 1, Default: 0
|
||||||
|
* CONFIG_NOKIA6100_RGBORD - Display RGB order, 0 or 1, Default: 0
|
||||||
|
*
|
||||||
* Required LCD driver settings:
|
* Required LCD driver settings:
|
||||||
* CONFIG_LCD_NOKIA6100 - Enable Nokia 6100 support
|
* CONFIG_LCD_NOKIA6100 - Enable Nokia 6100 support
|
||||||
* CONFIG_LCD_MAXCONTRAST - must be 63 with the Epson controller and 127 with
|
* CONFIG_LCD_MAXCONTRAST - must be 63 with the Epson controller and 127 with
|
||||||
|
|||||||
+1
-1
@@ -160,7 +160,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define SPI_SETBITS(d,b) \
|
#define SPI_SETBITS(d,b) \
|
||||||
do { if ((d)->ops->setbits) (d)->ops->setmode(d,b); } while (0)
|
do { if ((d)->ops->setbits) (d)->ops->setbits(d,b); } while (0)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: SPI_STATUS
|
* Name: SPI_STATUS
|
||||||
|
|||||||
Reference in New Issue
Block a user