mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
In LPC1788 24-bit color mode, we need to tell NX that the resolution if 32 bpp; Add interfaces to control Open1788 backlight
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5798 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
+2
-1
@@ -103,7 +103,7 @@ source arch/x86/Kconfig
|
|||||||
source arch/z16/Kconfig
|
source arch/z16/Kconfig
|
||||||
source arch/z80/Kconfig
|
source arch/z80/Kconfig
|
||||||
|
|
||||||
comment "External Memory Configuration"
|
menu "External Memory Configuration"
|
||||||
|
|
||||||
config ARCH_HAVE_EXTNAND
|
config ARCH_HAVE_EXTNAND
|
||||||
bool
|
bool
|
||||||
@@ -243,6 +243,7 @@ config ARCH_EXTSRAM1HEAP
|
|||||||
Add external SRAM Bank 1 into the heap.
|
Add external SRAM Bank 1 into the heap.
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
endmenu
|
||||||
|
|
||||||
comment "Architecture Options"
|
comment "Architecture Options"
|
||||||
|
|
||||||
|
|||||||
@@ -639,6 +639,19 @@ config LPC17_LCD_REFRESH_FREQ
|
|||||||
---help---
|
---help---
|
||||||
LCD refesh rate (Hz)
|
LCD refesh rate (Hz)
|
||||||
|
|
||||||
|
config LPC17_LCD_BACKLIGHT
|
||||||
|
bool "Enable backlight"
|
||||||
|
default y
|
||||||
|
---help---
|
||||||
|
Enable backlight support. If LPC17_LCD_BACKLIGHT is selected, then
|
||||||
|
the board-specific logic must provide this lpc17_backlight()
|
||||||
|
interface so that the LCD driver can turn the backlight on and off
|
||||||
|
as necessary. You should select this option and implement
|
||||||
|
lpc17_backlight() if your board provides GPIO control over the
|
||||||
|
backlight. This interface provides only ON/OFF control of the
|
||||||
|
backlight. If you want finer control over the backlight level (for
|
||||||
|
example, using PWM), then this interface would need to be extended.
|
||||||
|
|
||||||
config LPC17_LCD_TFTPANEL
|
config LPC17_LCD_TFTPANEL
|
||||||
bool "TFT Panel"
|
bool "TFT Panel"
|
||||||
default y
|
default y
|
||||||
|
|||||||
@@ -523,9 +523,7 @@ int up_fbinitialize(void)
|
|||||||
|
|
||||||
/* Turn on LCD clock */
|
/* Turn on LCD clock */
|
||||||
|
|
||||||
regval = getreg32(LPC17_SYSCON_PCONP);
|
modifyreg32(LPC17_SYSCON_PCONP, 0, SYSCON_PCONP_PCLCD);
|
||||||
regval |= SYSCON_PCONP_PCLCD;
|
|
||||||
putreg32(regval, LPC17_SYSCON_PCONP);
|
|
||||||
|
|
||||||
/* Disable the cursor */
|
/* Disable the cursor */
|
||||||
|
|
||||||
@@ -699,6 +697,11 @@ int up_fbinitialize(void)
|
|||||||
regval |= LCD_CTRL_LCDPWR;
|
regval |= LCD_CTRL_LCDPWR;
|
||||||
putreg32(regval, LPC17_LCD_CTRL);
|
putreg32(regval, LPC17_LCD_CTRL);
|
||||||
|
|
||||||
|
#ifdef CONFIG_LPC17_LCD_BACKLIGHT
|
||||||
|
/* Turn on the back light */
|
||||||
|
|
||||||
|
lpc17_backlight(true);
|
||||||
|
#endif
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -740,7 +743,33 @@ FAR struct fb_vtable_s *up_fbgetvplane(int vplane)
|
|||||||
|
|
||||||
void fb_uninitialize(void)
|
void fb_uninitialize(void)
|
||||||
{
|
{
|
||||||
gdbg("Not implemented!\n");
|
uint32_t regval;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/* We assume there is only one use of the LCD and so we do not need to
|
||||||
|
* worry about mutually exclusive access to the LCD hardware.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_LPC17_LCD_BACKLIGHT
|
||||||
|
/* Turn off the back light */
|
||||||
|
|
||||||
|
lpc17_backlight(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Disable the LCD controller */
|
||||||
|
|
||||||
|
regval = getreg32(LPC17_LCD_CTRL);
|
||||||
|
regval &= ~LCD_CTRL_LCDPWR;
|
||||||
|
putreg32(regval, LPC17_LCD_CTRL);
|
||||||
|
|
||||||
|
for (i = LPC17_LCD_PWRDIS_DELAY; i; i--);
|
||||||
|
|
||||||
|
regval &= ~LCD_CTRL_LCDEN;
|
||||||
|
putreg32(regval, LPC17_LCD_CTRL);
|
||||||
|
|
||||||
|
/* Turn off clocking to the LCD. modifyreg32() can do this atomically. */
|
||||||
|
|
||||||
|
modifyreg32(LPC17_SYSCON_PCONP, SYSCON_PCONP_PCLCD, 0);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,9 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include <nuttx/nx/nxglib.h>
|
#include <nuttx/nx/nxglib.h>
|
||||||
|
|
||||||
#include "chip/lpc17_lcd.h"
|
#include "chip/lpc17_lcd.h"
|
||||||
@@ -81,7 +84,7 @@
|
|||||||
# define LPC17_BPP 16
|
# define LPC17_BPP 16
|
||||||
# define LPC17_COLOR_FMT FB_FMT_Y16
|
# define LPC17_COLOR_FMT FB_FMT_Y16
|
||||||
#elif defined(CONFIG_LPC17_LCD_BPP24)
|
#elif defined(CONFIG_LPC17_LCD_BPP24)
|
||||||
# define LPC17_BPP 24
|
# define LPC17_BPP 32 /* Only 24 of 32 bits used for RGB */
|
||||||
# define LPC17_COLOR_FMT FB_FMT_RGB24
|
# define LPC17_COLOR_FMT FB_FMT_RGB24
|
||||||
# ifndef CONFIG_LPC17_LCD_TFTPANEL
|
# ifndef CONFIG_LPC17_LCD_TFTPANEL
|
||||||
# error "24 BPP is only available for a TFT panel"
|
# error "24 BPP is only available for a TFT panel"
|
||||||
@@ -164,7 +167,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: lpc17_lcdclear
|
* Name: lpc17_lcdclear
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This is a non-standard LCD interface just for the LPC17xx. Clearing the display
|
* This is a non-standard LCD interface just for the LPC17xx. Clearing the display
|
||||||
@@ -176,4 +179,17 @@
|
|||||||
|
|
||||||
void lpc17_lcdclear(nxgl_mxpixel_t color);
|
void lpc17_lcdclear(nxgl_mxpixel_t color);
|
||||||
|
|
||||||
|
/************************************************************************************
|
||||||
|
* Name: lpc17_backlight
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* If CONFIG_LPC17_LCD_BACKLIGHT is defined, then the board-specific logic must
|
||||||
|
* provide this interface to turn the backlight on and off.
|
||||||
|
*
|
||||||
|
************************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_LPC17_LCD_BACKLIGHT
|
||||||
|
void lpc17_backlight(bool blon);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __ARCH_ARM_SRC_LPC17XX_LPC17_LCD_H */
|
#endif /* __ARCH_ARM_SRC_LPC17XX_LPC17_LCD_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user