drivers/lcd: Make LCD driver configuration indepently selected from NX graphics configuration. This makes things awkward and loses some error checking but is a necessary step in order to make LCD drivers usable when the NX graphics system is disabled.
This commit is contained in:
parent
4404be23cb
commit
c2c2c4f111
@ -344,5 +344,5 @@ Configurations:
|
||||
rot has set in. Now only random garbage appears on the OLED. Certainly
|
||||
a lot has changed since 2012, but I cannot see any change to either this
|
||||
configuration, to the LCD driver, or to the LPC2148 support that would
|
||||
affect the operation of the LCD.
|
||||
affect the operation of the LCD. The nsh configuration is still functional.
|
||||
|
||||
|
@ -19,6 +19,10 @@ menuconfig LCD
|
||||
|
||||
if LCD
|
||||
|
||||
config LCD_PACKEDFIRST
|
||||
bool
|
||||
default n
|
||||
|
||||
config LCD_UPDATE
|
||||
bool
|
||||
default n
|
||||
|
@ -114,7 +114,7 @@ endif
|
||||
ifeq ($(CONFIG_LCD_RA8875),y)
|
||||
CSRCS += ra8875.c
|
||||
endif
|
||||
endif # CONFIG_NX_LCDDRIVER
|
||||
endif # CONFIG_LCD
|
||||
|
||||
ifeq ($(CONFIG_SLCD),y)
|
||||
|
||||
|
@ -101,12 +101,6 @@
|
||||
# define CONFIG_LCD_MAXCONTRAST 15
|
||||
#endif
|
||||
|
||||
/* Color is 1bpp monochrome with leftmost column contained in bits 0 */
|
||||
|
||||
#ifdef CONFIG_NX_DISABLE_1BPP
|
||||
# warning "1 bit-per-pixel support needed"
|
||||
#endif
|
||||
|
||||
/* Color Properties *********************************************************/
|
||||
/* The MAX7219 chip can handle resolution of 8x8, 16x8, 8x16, 16x16, 24x8,
|
||||
* etc.
|
||||
@ -459,13 +453,13 @@ static int max7219_putrun(fb_coord_t row, fb_coord_t col,
|
||||
|
||||
row = newrow;
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
@ -485,7 +479,7 @@ static int max7219_putrun(fb_coord_t row, fb_coord_t col,
|
||||
__clear_bit(col % 8 + i, ptr);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
if (usrmask == LS_BIT)
|
||||
{
|
||||
buffer++;
|
||||
@ -578,7 +572,7 @@ static int max7219_getrun(fb_coord_t row, fb_coord_t col,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
@ -598,7 +592,7 @@ static int max7219_getrun(fb_coord_t row, fb_coord_t col,
|
||||
*buffer &= ~usrmask;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
if (usrmask == LS_BIT)
|
||||
{
|
||||
buffer++;
|
||||
|
@ -419,7 +419,7 @@ static int memlcd_putrun(fb_coord_t row, fb_coord_t col,
|
||||
DEBUGASSERT(buffer);
|
||||
lcdinfo("row: %d col: %d npixels: %d\n", row, col, npixels);
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
@ -438,7 +438,7 @@ static int memlcd_putrun(fb_coord_t row, fb_coord_t col,
|
||||
__clear_bit(col % 8 + i, p);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
if (usrmask == LS_BIT)
|
||||
{
|
||||
buffer++;
|
||||
@ -510,7 +510,7 @@ static int memlcd_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t * buffer,
|
||||
DEBUGASSERT(buffer);
|
||||
lcdinfo("row: %d col: %d npixels: %d\n", row, col, npixels);
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
@ -529,7 +529,7 @@ static int memlcd_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t * buffer,
|
||||
*buffer &= ~usrmask;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
if (usrmask == LS_BIT)
|
||||
{
|
||||
buffer++;
|
||||
|
@ -138,20 +138,6 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if CONFIG_NOKIA6100_BPP == 8
|
||||
# ifdef CONFIG_NX_DISABLE_8BPP
|
||||
# warning "8-bit pixel support needed"
|
||||
# endif
|
||||
#elif CONFIG_NOKIA6100_BPP == 12
|
||||
# if defined(CONFIG_NX_DISABLE_12BPP) || !defined(CONFIG_NX_PACKEDMSFIRST)
|
||||
# warning "12-bit, big-endian pixel support needed"
|
||||
# endif
|
||||
#elif CONFIG_NOKIA6100_BPP == 16
|
||||
# ifdef CONFIG_NX_DISABLE_16BPP
|
||||
# warning "16-bit pixel support needed"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Exactly one LCD controller must be selected. "The Olimex boards have both display
|
||||
* controllers possible; if the LCD has a GE-12 sticker on it, it’s a Philips PCF8833.
|
||||
* If it has a GE-8 sticker, it’s an Epson controller."
|
||||
|
@ -135,12 +135,6 @@
|
||||
# define CONFIG_LCD_MAXPOWER 1
|
||||
#endif
|
||||
|
||||
/* Color is 4bpp greyscale with leftmost column contained in bits 7:4 */
|
||||
|
||||
#if defined(CONFIG_NX_DISABLE_4BPP) || !defined(CONFIG_NX_PACKEDMSFIRST)
|
||||
# warning "4-bit, big-endian pixel support needed"
|
||||
#endif
|
||||
|
||||
/* Define the CONFIG_LCD_RITDEBUG to enable detailed debug output (stuff you would
|
||||
* never want to see unless you are debugging this file).
|
||||
*
|
||||
|
@ -156,12 +156,6 @@
|
||||
# error "CONFIG_SPI_CMDDATA must be defined in your NuttX configuration"
|
||||
#endif
|
||||
|
||||
/* Color is 1bpp monochrome with leftmost column contained in bits 0 */
|
||||
|
||||
#ifdef CONFIG_NX_DISABLE_1BPP
|
||||
# warning "1 bit-per-pixel support needed"
|
||||
#endif
|
||||
|
||||
/* Color Properties *******************************************************************/
|
||||
/* The PCD8544 display controller can handle a resolution of 84x48.
|
||||
*/
|
||||
@ -503,7 +497,7 @@ static int pcd8544_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buf
|
||||
fbmask = 1 << (row & 7);
|
||||
fbptr = &priv->fb[page * PCD8544_XRES + col];
|
||||
ptr = fbptr;
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
@ -524,7 +518,7 @@ static int pcd8544_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buf
|
||||
|
||||
/* Inc/Decrement to the next source pixel */
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
if (usrmask == LS_BIT)
|
||||
{
|
||||
buffer++;
|
||||
@ -650,7 +644,7 @@ static int pcd8544_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
|
||||
|
||||
fbmask = 1 << (row & 7);
|
||||
fbptr = &priv->fb[page * PCD8544_XRES + col];
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
@ -672,7 +666,7 @@ static int pcd8544_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
|
||||
* this!
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
if (usrmask == LS_BIT)
|
||||
{
|
||||
buffer++;
|
||||
|
@ -361,7 +361,7 @@ static int ssd1306_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buf
|
||||
ptr = fbptr;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
@ -393,7 +393,7 @@ static int ssd1306_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buf
|
||||
|
||||
/* Inc/Decrement to the next source pixel */
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
if (usrmask == LS_BIT)
|
||||
{
|
||||
buffer++;
|
||||
@ -564,7 +564,7 @@ static int ssd1306_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
|
||||
fbmask = 1 << (row & 7);
|
||||
fbptr = &priv->fb[page * SSD1306_DEV_XRES + col];
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
@ -590,7 +590,7 @@ static int ssd1306_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
|
||||
|
||||
/* Inc/Decrement to the next destination pixel. */
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
if (usrmask == LS_BIT)
|
||||
{
|
||||
buffer++;
|
||||
|
@ -100,19 +100,8 @@
|
||||
* CONFIG_SPI - enables support for SPI
|
||||
* CONFIG_SPI_CMDDATA - enables support for cmd/data selection
|
||||
* (if using 4-wire SPI)
|
||||
*
|
||||
* NX settings that must be undefined:
|
||||
* CONFIG_NX_DISABLE_16BPP - disables 16 bpp support
|
||||
*/
|
||||
|
||||
/* Verify that all configuration requirements have been met */
|
||||
|
||||
/* Number of bits per pixel */
|
||||
|
||||
#ifdef CONFIG_NX_DISABLE_16BPP
|
||||
# error "Requires support for 16 bits per pixel"
|
||||
#endif
|
||||
|
||||
/* Max power */
|
||||
|
||||
#if CONFIG_LCD_MAXPOWER != 1
|
||||
|
@ -128,14 +128,6 @@
|
||||
# warning "Optimal setting of CONFIG_LCD_MAXCONTRAST is 255"
|
||||
#endif
|
||||
|
||||
/* Check power setting */
|
||||
|
||||
/* Color is 1bpp monochrome with leftmost column contained in bits 0 */
|
||||
|
||||
#ifdef CONFIG_NX_DISABLE_1BPP
|
||||
# warning "1 bit-per-pixel support needed"
|
||||
#endif
|
||||
|
||||
/* Color Properties *******************************************************************/
|
||||
|
||||
/* The ST7565 display controller can handle a resolution of 128x64.
|
||||
@ -515,7 +507,7 @@ static int st7565_putrun(fb_coord_t row, fb_coord_t col,
|
||||
fbmask = 1 << (row & 7);
|
||||
fbptr = &priv->fb[page * ST7565_XRES + col];
|
||||
ptr = fbptr;
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
@ -536,7 +528,7 @@ static int st7565_putrun(fb_coord_t row, fb_coord_t col,
|
||||
|
||||
/* Inc/Decrement to the next source pixel */
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
if (usrmask == LS_BIT)
|
||||
{
|
||||
buffer++;
|
||||
@ -667,7 +659,7 @@ static int st7565_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t * buffer,
|
||||
|
||||
fbmask = 1 << (row & 7);
|
||||
fbptr = &priv->fb[page * ST7565_XRES + col];
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
@ -688,7 +680,7 @@ static int st7565_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t * buffer,
|
||||
* logic could write past the end of the user buffer. Revisit this!
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
if (usrmask == LS_BIT)
|
||||
{
|
||||
buffer++;
|
||||
|
@ -164,12 +164,6 @@
|
||||
# error "CONFIG_SPI_CMDDATA must be defined in your NuttX configuration"
|
||||
#endif
|
||||
|
||||
/* Color is 1bpp monochrome with leftmost column contained in bits 0 */
|
||||
|
||||
#ifdef CONFIG_NX_DISABLE_1BPP
|
||||
# warning "1 bit-per-pixel support needed"
|
||||
#endif
|
||||
|
||||
/* Color Properties *******************************************************************/
|
||||
/* The ST7567 display controller can handle a resolution of 128x64.
|
||||
*/
|
||||
@ -480,7 +474,7 @@ static int st7567_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buff
|
||||
fbmask = 1 << (row & 7);
|
||||
fbptr = &priv->fb[page * ST7567_XRES + col];
|
||||
ptr = fbptr;
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
@ -501,7 +495,7 @@ static int st7567_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buff
|
||||
|
||||
/* Inc/Decrement to the next source pixel */
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
if (usrmask == LS_BIT)
|
||||
{
|
||||
buffer++;
|
||||
@ -628,7 +622,7 @@ static int st7567_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
|
||||
|
||||
fbmask = 1 << (row & 7);
|
||||
fbptr = &priv->fb[page * ST7567_XRES + col];
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
@ -650,7 +644,7 @@ static int st7567_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
|
||||
* this!
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
if (usrmask == LS_BIT)
|
||||
{
|
||||
buffer++;
|
||||
|
@ -558,7 +558,7 @@ static int ug2864ambag01_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_
|
||||
ptr = fbptr;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
@ -590,7 +590,7 @@ static int ug2864ambag01_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_
|
||||
|
||||
/* Inc/Decrement to the next source pixel */
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
if (usrmask == LS_BIT)
|
||||
{
|
||||
buffer++;
|
||||
@ -763,7 +763,7 @@ static int ug2864ambag01_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buf
|
||||
fbmask = 1 << (row & 7);
|
||||
fbptr = &priv->fb[page * UG2864AMBAG01_XRES + col];
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
@ -789,7 +789,7 @@ static int ug2864ambag01_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buf
|
||||
* this!
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
if (usrmask == LS_BIT)
|
||||
{
|
||||
buffer++;
|
||||
|
@ -155,12 +155,6 @@
|
||||
# error "CONFIG_SPI_CMDDATA must be defined in your NuttX configuration"
|
||||
#endif
|
||||
|
||||
/* Color is 1bpp monochrome with leftmost column contained in bits 0 */
|
||||
|
||||
#ifdef CONFIG_NX_DISABLE_1BPP
|
||||
# warning "1 bit-per-pixel support needed"
|
||||
#endif
|
||||
|
||||
/* Color Properties *******************************************************************/
|
||||
/* The SSD1305 display controller can handle a resolution of 132x64. The OLED
|
||||
* on the base board is 96x64.
|
||||
@ -547,7 +541,7 @@ static int ug_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer,
|
||||
ptr = fbptr;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
@ -579,7 +573,7 @@ static int ug_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer,
|
||||
|
||||
/* Inc/Decrement to the next source pixel */
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
if (usrmask == LS_BIT)
|
||||
{
|
||||
buffer++;
|
||||
@ -739,7 +733,7 @@ static int ug_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
|
||||
fbmask = 1 << (row & 7);
|
||||
fbptr = &priv->fb[page * UG_XRES + col];
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
usrmask = MS_BIT;
|
||||
#else
|
||||
usrmask = LS_BIT;
|
||||
@ -766,7 +760,7 @@ static int ug_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
|
||||
* this!
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||
#ifdef CONFIG_LCD_PACKEDMSFIRST
|
||||
if (usrmask == LS_BIT)
|
||||
{
|
||||
buffer++;
|
||||
|
@ -153,7 +153,7 @@ config NX_PACKEDMSFIRST
|
||||
bool "Packed MS First"
|
||||
default y
|
||||
select NXFONTS_PACKEDMSFIRST if NXFONTS
|
||||
depends on NX_DISABLE_1BPP || NX_DISABLE_2BPP || NX_DISABLE_4BPP
|
||||
select LCD_PACKEDFIRST if LCD
|
||||
---help---
|
||||
If a pixel depth of less than 8-bits is used, then NX needs to know if the
|
||||
pixels pack from the MS to LS or from LS to MS
|
||||
|
@ -400,7 +400,7 @@ config NXFONTS_PACKEDMSFIRST
|
||||
bool "Packed MS First"
|
||||
default y if !NX || NX_PACKEDMSFIRST
|
||||
default n if NX && !NX_PACKEDMSFIRST
|
||||
depends on NXFONTS_DISABLE_1BPP || NXFONTS_DISABLE_2BPP || NXFONTS_DISABLE_4BPP
|
||||
select LCD_PACKEDFIRST if LCD
|
||||
---help---
|
||||
If a pixel depth of less than 8-bits is used, then NX needs to know if the
|
||||
pixels pack from the MS to LS or from LS to MS
|
||||
|
Loading…
Reference in New Issue
Block a user