drivers/lcd: Add support for external LCD initialization required by some board logic. configs/zpa214xpa: Tried to get the LCD working again unsuccessfully. Too much bit rot I suppose.

This commit is contained in:
Gregory Nutt 2017-11-25 11:41:21 -06:00
parent 776b65bc90
commit 3657723208
6 changed files with 72 additions and 10 deletions

View File

@ -236,7 +236,7 @@ Using OpenOCD and GDB with an FT2232 JTAG emulator
configs/zp214xpa/tools/oocd.sh $PWD
If you add that path to your PATH environment variable, ithe commandi
If you add that path to your PATH environment variable, the command
simplifies to just:
oocd.sh $PWD
@ -309,9 +309,9 @@ Configurations:
2. Default platform/toolchain:
CONFIG_HOST_LINUX=y : Linux (Cygwin under Windows okay too).
CONFIG_HOST_LINUX=y : Linux (Cygwin under Windows okay too).
CONFIG_ARM_TOOLCHAIN_GNU_EABIL=y : Buildroot (arm-nuttx-elf-gcc)
CONFIG_RAW_BINARY=y : Output formats: ELF and raw binary
CONFIG_RAW_BINARY=y : Output formats: ELF and raw binary
nxlines:
--------
@ -333,8 +333,16 @@ Configurations:
2. Default platform/toolchain:
CONFIG_HOST_LINUX=y : Linux (Cygwin under Windows okay too).
CONFIG_HOST_LINUX=y : Linux (Cygwin under Windows okay too).
CONFIG_ARM_TOOLCHAIN_GNU_EABIL=y : Buildroot (arm-nuttx-elf-gcc)
CONFIG_RAW_BINARY=y : Output formats: ELF and raw binary
CONFIG_RAW_BINARY=y : Output formats: ELF and raw binary
STATUS:
2012-12-30: Configuration verified.
2017-11-25: Grrr... This configuration no longer works. Some serious bit
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
effect the operation of the LCD.
3. Verified as of this writing (2012-12-30).

View File

@ -1,7 +1,7 @@
/****************************************************************************
* config/zp214xpa/src/lpc2148_appinit.c
*
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2015-2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -40,7 +40,11 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/board.h>
#include <syslog.h>
#ifdef CONFIG_VIDEO_FB
# include <nuttx/video/fb.h>
#endif
#ifdef CONFIG_LIB_BOARDCTL
@ -75,6 +79,29 @@
int board_app_initialize(uintptr_t arg)
{
int ret;
#ifdef CONFIG_FS_PROCFS
/* Mount the procfs file system */
ret = mount(NULL, "/proc", "procfs", 0, NULL);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret);
}
#endif
#ifdef CONFIG_VIDEO_FB
/* Initialize and register the framebuffer driver */
ret = fb_register(0, 0);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: fb_register() failed: %d\n", ret);
}
#endif
UNUSED(ret);
return OK;
}

View File

@ -41,6 +41,17 @@ config LCD_FRAMEBUFFER
disabled because this external commone framebuffer interface will
provide the necessary buffering.
config LCD_EXTERNINIT
bool "External LCD Initialization"
default n
depends on LCD_FRAMEBUFFER
---help---
Define to support external LCD initialization by platform-specific
code. This this option is defined, then the LCD framebuffer
emulation will call board_graphics_setup() to initialize the
graphics device. This option is necessary if display is used that
cannot be initialized using the standard LCD interfaces.
menu "LCD driver selection"
config LCD_CONSOLE

View File

@ -496,6 +496,16 @@ int up_fbinitialize(int display)
priv->vtable.setcursor = lcdfb_setcursor,
#endif
#ifdef CONFIG_LCD_EXTERNINIT
/* Use external graphics driver initialization */
lcd = board_graphics_setup(display);
if (lcd == NULL)
{
gerr("ERROR: board_graphics_setup failed, devno=%d\n", display);
return EXIT_FAILURE;
}
#else
/* Initialize the LCD device */
ret = board_lcd_initialize();
@ -514,6 +524,7 @@ int up_fbinitialize(int display)
ret = -ENODEV;
goto errout_with_lcd;
}
#endif
priv->lcd = lcd;
@ -571,9 +582,11 @@ int up_fbinitialize(int display)
return OK;
errout_with_lcd:
#ifndef CONFIG_LCD_EXTERNINIT
board_lcd_uninitialize();
errout_with_state:
#endif
kmm_free(priv);
return ret;
}
@ -656,9 +669,11 @@ void up_fbuninitialize(int display)
g_lcdfb = priv->flink;
}
#ifndef CONFIG_LCD_EXTERNINIT
/* Uninitialize the LCD */
board_lcd_uninitialize();
#endif
/* Free the frame buffer allocation */

View File

@ -389,8 +389,9 @@ config NX_MXCLIENTMSGS
controls how many messages are pre-allocated).
config NXSTART_EXTERNINIT
bool "External display Initialization"
bool "External Display Initialization"
default n
select LCD_EXTERNINIT if NX_LCDDRIVER
---help---
Define to support external display initialization by platform-
specific code. This this option is defined, then nx_start() will

View File

@ -349,7 +349,7 @@ void board_tsc_teardown(void);
*
****************************************************************************/
#ifdef CONFIG_NX_LCDDRIVER
#if defined(CONFIG_NX_LCDDRIVER) || defined(CONFIG_LCD_FRAMEBUFFER)
struct lcd_dev_s;
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
#else