Missing parenthesis in NXGL code; add debug output to LPC1788 LCD driver
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5797 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
219c13bb1c
commit
0af8e9642a
@ -56,9 +56,15 @@
|
|||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define LPC17_LCD_CLK_PER_LINE (CONFIG_LPC17_LCD_HWIDTH + CONFIG_LPC17_LCD_HPULSE + CONFIG_LPC17_LCD_HFRONTPORCH + CONFIG_LPC17_LCD_HBACKPORCH)
|
#define LPC17_LCD_CLK_PER_LINE \
|
||||||
#define LPC17_LCD_LINES_PER_FRAME (CONFIG_LPC17_LCD_VHEIGHT + CONFIG_LPC17_LCD_VPULSE + CONFIG_LPC17_LCD_VFRONTPORCH + CONFIG_LPC17_LCD_VBACKPORCH)
|
(CONFIG_LPC17_LCD_HWIDTH + CONFIG_LPC17_LCD_HPULSE + \
|
||||||
#define LPC17_LCD_PIXEL_CLOCK (LPC17_LCD_CLK_PER_LINE * LPC17_LCD_LINES_PER_FRAME * CONFIG_LPC17_LCD_REFRESH_FREQ)
|
CONFIG_LPC17_LCD_HFRONTPORCH + CONFIG_LPC17_LCD_HBACKPORCH)
|
||||||
|
#define LPC17_LCD_LINES_PER_FRAME \
|
||||||
|
(CONFIG_LPC17_LCD_VHEIGHT + CONFIG_LPC17_LCD_VPULSE + \
|
||||||
|
CONFIG_LPC17_LCD_VFRONTPORCH + CONFIG_LPC17_LCD_VBACKPORCH)
|
||||||
|
#define LPC17_LCD_PIXEL_CLOCK \
|
||||||
|
(LPC17_LCD_CLK_PER_LINE * LPC17_LCD_LINES_PER_FRAME * \
|
||||||
|
CONFIG_LPC17_LCD_REFRESH_FREQ)
|
||||||
|
|
||||||
/* Framebuffer characteristics in bytes */
|
/* Framebuffer characteristics in bytes */
|
||||||
|
|
||||||
@ -195,14 +201,14 @@ struct fb_vtable_s g_fbobject =
|
|||||||
static int lpc17_getvideoinfo(FAR struct fb_vtable_s *vtable,
|
static int lpc17_getvideoinfo(FAR struct fb_vtable_s *vtable,
|
||||||
FAR struct fb_videoinfo_s *vinfo)
|
FAR struct fb_videoinfo_s *vinfo)
|
||||||
{
|
{
|
||||||
dbg("vtable=%p vinfo=%p\n", vtable, vinfo);
|
gvdbg("vtable=%p vinfo=%p\n", vtable, vinfo);
|
||||||
if (vtable && vinfo)
|
if (vtable && vinfo)
|
||||||
{
|
{
|
||||||
memcpy(vinfo, &g_videoinfo, sizeof(struct fb_videoinfo_s));
|
memcpy(vinfo, &g_videoinfo, sizeof(struct fb_videoinfo_s));
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
dbg("Returning EINVAL\n");
|
gdbg("Returning EINVAL\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,14 +219,14 @@ static int lpc17_getvideoinfo(FAR struct fb_vtable_s *vtable,
|
|||||||
static int lpc17_getplaneinfo(FAR struct fb_vtable_s *vtable, int planeno,
|
static int lpc17_getplaneinfo(FAR struct fb_vtable_s *vtable, int planeno,
|
||||||
FAR struct fb_planeinfo_s *pinfo)
|
FAR struct fb_planeinfo_s *pinfo)
|
||||||
{
|
{
|
||||||
dbg("vtable=%p planeno=%d pinfo=%p\n", vtable, planeno, pinfo);
|
gvdbg("vtable=%p planeno=%d pinfo=%p\n", vtable, planeno, pinfo);
|
||||||
if (vtable && planeno == 0 && pinfo)
|
if (vtable && planeno == 0 && pinfo)
|
||||||
{
|
{
|
||||||
memcpy(pinfo, &g_planeinfo, sizeof(struct fb_planeinfo_s));
|
memcpy(pinfo, &g_planeinfo, sizeof(struct fb_planeinfo_s));
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
dbg("Returning EINVAL\n");
|
gdbg("Returning EINVAL\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,8 +243,8 @@ static int lpc17_getcmap(FAR struct fb_vtable_s *vtable,
|
|||||||
int last;
|
int last;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
dbg("vtable=%p cmap=%p first=%d len=%d\n",
|
gvdbg("vtable=%p cmap=%p first=%d len=%d\n",
|
||||||
vtable, cmap, cmap->first, cmap->len);
|
vtable, cmap, cmap->first, cmap->len);
|
||||||
|
|
||||||
DEBUGASSERT(vtable && cmap &&
|
DEBUGASSERT(vtable && cmap &&
|
||||||
cmap->first < 256 && (cmap->first + cmap->len) < 256);
|
cmap->first < 256 && (cmap->first + cmap->len) < 256);
|
||||||
@ -312,8 +318,8 @@ static int lpc17_putcmap(FAR struct fb_vtable_s *vtable,
|
|||||||
int last;
|
int last;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
dbg("vtable=%p cmap=%p first=%d len=%d\n",
|
gvdbg("vtable=%p cmap=%p first=%d len=%d\n",
|
||||||
vtable, cmap, cmap->first, cmap->len);
|
vtable, cmap, cmap->first, cmap->len);
|
||||||
|
|
||||||
DEBUGASSERT(vtable && cmap);
|
DEBUGASSERT(vtable && cmap);
|
||||||
|
|
||||||
@ -376,24 +382,27 @@ static int lpc17_putcmap(FAR struct fb_vtable_s *vtable,
|
|||||||
static int lpc17_getcursor(FAR struct fb_vtable_s *vtable,
|
static int lpc17_getcursor(FAR struct fb_vtable_s *vtable,
|
||||||
FAR struct fb_cursorattrib_s *attrib)
|
FAR struct fb_cursorattrib_s *attrib)
|
||||||
{
|
{
|
||||||
dbg("vtable=%p attrib=%p\n", vtable, attrib);
|
gvdbg("vtable=%p attrib=%p\n", vtable, attrib);
|
||||||
if (vtable && attrib)
|
if (vtable && attrib)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_FB_HWCURSORIMAGE
|
#ifdef CONFIG_FB_HWCURSORIMAGE
|
||||||
attrib->fmt = LPC17_COLOR_FMT;
|
attrib->fmt = LPC17_COLOR_FMT;
|
||||||
#endif
|
#endif
|
||||||
dbg("pos: (x=%d, y=%d)\n", g_cpos.x, g_cpos.y);
|
|
||||||
attrib->pos = g_cpos;
|
gvdbg("pos: (x=%d, y=%d)\n", g_cpos.x, g_cpos.y);
|
||||||
|
attrib->pos = g_cpos;
|
||||||
|
|
||||||
#ifdef CONFIG_FB_HWCURSORSIZE
|
#ifdef CONFIG_FB_HWCURSORSIZE
|
||||||
attrib->mxsize.h = CONFIG_LPC17_LCD_VHEIGHT;
|
attrib->mxsize.h = CONFIG_LPC17_LCD_VHEIGHT;
|
||||||
attrib->mxsize.w = CONFIG_LPC17_LCD_HWIDTH;
|
attrib->mxsize.w = CONFIG_LPC17_LCD_HWIDTH;
|
||||||
dbg("size: (h=%d, w=%d)\n", g_csize.h, g_csize.w);
|
|
||||||
attrib->size = g_csize;
|
gvdbg("size: (h=%d, w=%d)\n", g_csize.h, g_csize.w);
|
||||||
|
attrib->size = g_csize;
|
||||||
#endif
|
#endif
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
dbg("Returning EINVAL\n");
|
gdbg("Returning EINVAL\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -406,33 +415,34 @@ static int lpc17_getcursor(FAR struct fb_vtable_s *vtable,
|
|||||||
static int lpc17_setcursor(FAR struct fb_vtable_s *vtable,
|
static int lpc17_setcursor(FAR struct fb_vtable_s *vtable,
|
||||||
FAR struct fb_setcursor_s *setttings)
|
FAR struct fb_setcursor_s *setttings)
|
||||||
{
|
{
|
||||||
dbg("vtable=%p setttings=%p\n", vtable, setttings);
|
gvdbg("vtable=%p setttings=%p\n", vtable, setttings);
|
||||||
if (vtable && setttings)
|
if (vtable && setttings)
|
||||||
{
|
{
|
||||||
dbg("flags: %02x\n", settings->flags);
|
gvdbg("flags: %02x\n", settings->flags);
|
||||||
if ((flags & FB_CUR_SETPOSITION) != 0)
|
if ((flags & FB_CUR_SETPOSITION) != 0)
|
||||||
{
|
{
|
||||||
g_cpos = settings->pos;
|
g_cpos = settings->pos;
|
||||||
dbg("pos: (h:%d, w:%d)\n", g_cpos.x, g_cpos.y);
|
gvdbg("pos: (h:%d, w:%d)\n", g_cpos.x, g_cpos.y);
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_FB_HWCURSORSIZE
|
#ifdef CONFIG_FB_HWCURSORSIZE
|
||||||
if ((flags & FB_CUR_SETSIZE) != 0)
|
if ((flags & FB_CUR_SETSIZE) != 0)
|
||||||
{
|
{
|
||||||
g_csize = settings->size;
|
g_csize = settings->size;
|
||||||
dbg("size: (h:%d, w:%d)\n", g_csize.h, g_csize.w);
|
gvdbg("size: (h:%d, w:%d)\n", g_csize.h, g_csize.w);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_FB_HWCURSORIMAGE
|
#ifdef CONFIG_FB_HWCURSORIMAGE
|
||||||
if ((flags & FB_CUR_SETIMAGE) != 0)
|
if ((flags & FB_CUR_SETIMAGE) != 0)
|
||||||
{
|
{
|
||||||
dbg("image: (h:%d, w:%d) @ %p\n",
|
gvdbg("image: (h:%d, w:%d) @ %p\n",
|
||||||
settings->img.height, settings->img.width, settings->img.image);
|
settings->img.height, settings->img.width,
|
||||||
|
settings->img.image);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
dbg("Returning EINVAL\n");
|
gdbg("Returning EINVAL\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -454,6 +464,8 @@ int up_fbinitialize(void)
|
|||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
gvdbg("Entry\n");
|
||||||
|
|
||||||
/* Disable LCD controller */
|
/* Disable LCD controller */
|
||||||
|
|
||||||
regval = getreg32(LPC17_LCD_CTRL);
|
regval = getreg32(LPC17_LCD_CTRL);
|
||||||
@ -468,6 +480,8 @@ int up_fbinitialize(void)
|
|||||||
/* Configure pins */
|
/* Configure pins */
|
||||||
/* Video data */
|
/* Video data */
|
||||||
|
|
||||||
|
gvdbg("Configuring pins\n");
|
||||||
|
|
||||||
lpc17_configgpio(GPIO_LCD_VD0);
|
lpc17_configgpio(GPIO_LCD_VD0);
|
||||||
lpc17_configgpio(GPIO_LCD_VD1);
|
lpc17_configgpio(GPIO_LCD_VD1);
|
||||||
lpc17_configgpio(GPIO_LCD_VD2);
|
lpc17_configgpio(GPIO_LCD_VD2);
|
||||||
@ -505,6 +519,8 @@ int up_fbinitialize(void)
|
|||||||
lpc17_configgpio(GPIO_LCD_ENABM);
|
lpc17_configgpio(GPIO_LCD_ENABM);
|
||||||
lpc17_configgpio(GPIO_LCD_PWR);
|
lpc17_configgpio(GPIO_LCD_PWR);
|
||||||
|
|
||||||
|
gvdbg("Configuring the LCD controller\n");
|
||||||
|
|
||||||
/* Turn on LCD clock */
|
/* Turn on LCD clock */
|
||||||
|
|
||||||
regval = getreg32(LPC17_SYSCON_PCONP);
|
regval = getreg32(LPC17_SYSCON_PCONP);
|
||||||
@ -672,6 +688,8 @@ int up_fbinitialize(void)
|
|||||||
|
|
||||||
/* Enable LCD */
|
/* Enable LCD */
|
||||||
|
|
||||||
|
gvdbg("Enabling the display\n");
|
||||||
|
|
||||||
regval = getreg32(LPC17_LCD_CTRL);
|
regval = getreg32(LPC17_LCD_CTRL);
|
||||||
regval |= LCD_CTRL_LCDEN;
|
regval |= LCD_CTRL_LCDEN;
|
||||||
putreg32(regval, LPC17_LCD_CTRL);
|
putreg32(regval, LPC17_LCD_CTRL);
|
||||||
@ -701,6 +719,7 @@ int up_fbinitialize(void)
|
|||||||
|
|
||||||
FAR struct fb_vtable_s *up_fbgetvplane(int vplane)
|
FAR struct fb_vtable_s *up_fbgetvplane(int vplane)
|
||||||
{
|
{
|
||||||
|
gvdbg("vplane: %d\n", vplane);
|
||||||
if (vplane == 0)
|
if (vplane == 0)
|
||||||
{
|
{
|
||||||
return &g_fbobject;
|
return &g_fbobject;
|
||||||
@ -721,6 +740,7 @@ FAR struct fb_vtable_s *up_fbgetvplane(int vplane)
|
|||||||
|
|
||||||
void fb_uninitialize(void)
|
void fb_uninitialize(void)
|
||||||
{
|
{
|
||||||
|
gdbg("Not implemented!\n");
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -730,22 +750,30 @@ void fb_uninitialize(void)
|
|||||||
* 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
|
||||||
* in the normal way by writing a sequences of runs that covers the entire display
|
* in the normal way by writing a sequences of runs that covers the entire display
|
||||||
* can be slow. Here the dispaly is cleared by simply setting all VRAM memory to
|
* can be slow. Here the display is cleared by simply setting all VRAM memory to
|
||||||
* the specified color.
|
* the specified color.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
void lpc17_lcdclear(nxgl_mxpixel_t color)
|
void lpc17_lcdclear(nxgl_mxpixel_t color)
|
||||||
{
|
{
|
||||||
#if LPC17_BPP > 16
|
|
||||||
uint32_t *dest;
|
|
||||||
#else
|
|
||||||
uint16_t *dest;
|
|
||||||
#endif
|
|
||||||
int i;
|
int i;
|
||||||
|
#if LPC17_BPP > 16
|
||||||
|
uint32_t *dest = (uint32_t*)CONFIG_LPC17_LCD_VRAMBASE;
|
||||||
|
|
||||||
dest = (uint32_t *) CONFIG_LPC17_LCD_VRAMBASE;
|
gvdbg("Clearing display: color=%08x VRAM=%08x size=%d\n",
|
||||||
for (i = 0; (CONFIG_LPC17_LCD_HWIDTH * CONFIG_LPC17_LCD_VHEIGHT) > i; i++)
|
color, CONFIG_LPC17_LCD_VRAMBASE,
|
||||||
|
CONFIG_LPC17_LCD_HWIDTH * CONFIG_LPC17_LCD_VHEIGHT * sizeof(uint32_t));
|
||||||
|
|
||||||
|
#else
|
||||||
|
uint16_t *dest = (uint16_t*)CONFIG_LPC17_LCD_VRAMBASE;
|
||||||
|
|
||||||
|
gvdbg("Clearing display: color=%08x VRAM=%08x size=%d\n",
|
||||||
|
color, CONFIG_LPC17_LCD_VRAMBASE,
|
||||||
|
CONFIG_LPC17_LCD_HWIDTH * CONFIG_LPC17_LCD_VHEIGHT * sizeof(uint16_t));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for (i = 0; i < (CONFIG_LPC17_LCD_HWIDTH * CONFIG_LPC17_LCD_VHEIGHT); i++)
|
||||||
{
|
{
|
||||||
*dest++ = color;
|
*dest++ = color;
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,7 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX)(
|
|||||||
/* Handle masking of the fractional initial byte */
|
/* Handle masking of the fractional initial byte */
|
||||||
|
|
||||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||||
mask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(ix1));
|
mask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(ix1)));
|
||||||
#else
|
#else
|
||||||
mask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(ix1)));
|
mask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(ix1)));
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user