stm32: update description and code documentation. Also fixes a few code formattings.

Signed-off-by: Marco Krahl <ocram.lhark@gmail.com>
This commit is contained in:
Gregory Nutt 2014-12-29 09:59:46 -06:00
parent 1a27614552
commit a0727124c2

View File

@ -922,11 +922,10 @@ static void stm32_ltdc_gpioconfig(void)
static void stm32_ltdc_periphconfig(void) static void stm32_ltdc_periphconfig(void)
{ {
uint32_t regval; uint32_t regval;
/* Configure GPIO's external */ /* Configure GPIO's */
gvdbg("Configure lcd pins\n");
stm32_ltdc_gpioconfig(); stm32_ltdc_gpioconfig();
/* Configure APB2 LTDC clock external */ /* Configure APB2 LTDC clock external */
@ -1092,7 +1091,7 @@ static void stm32_ltdc_reload(uint8_t value)
{ {
} }
/* Reload shadow register after vertical blank */ /* Reload shadow register */
regvdbg("set LTDC_SRCR=%08x\n", value & ~LTDC_SRCR_WAIT); regvdbg("set LTDC_SRCR=%08x\n", value & ~LTDC_SRCR_WAIT);
putreg32(value & ~LTDC_SRCR_WAIT, STM32_LTDC_SRCR); putreg32(value & ~LTDC_SRCR_WAIT, STM32_LTDC_SRCR);
@ -1154,8 +1153,6 @@ static void stm32_global_configure(void)
stm32_ltdc_bgcolor(STM32_LTDC_BACKCOLOR); stm32_ltdc_bgcolor(STM32_LTDC_BACKCOLOR);
/* Enable lcd interrupts only if neccessary */
/* Enable line interrupt */ /* Enable line interrupt */
stm32_ltdc_interrupt(STM32_LTDC_IER_LIE, 1); stm32_ltdc_interrupt(STM32_LTDC_IER_LIE, 1);
@ -1536,7 +1533,9 @@ static inline void stm32_ltdc_lframebuffer(FAR struct stm32_layer_s *layer)
regvdbg("set LTDC_L%dCFBAR=%08x\n", priv->lid + 1, pinfo->fbmem + offset); regvdbg("set LTDC_L%dCFBAR=%08x\n", priv->lid + 1, pinfo->fbmem + offset);
putreg32(pinfo->fbmem + offset, stm32_cfbar_layer_t[priv->lid]); putreg32(pinfo->fbmem + offset, stm32_cfbar_layer_t[priv->lid]);
/* Change line length */ /* Configure LxCFBLR register */
/* Calculate line length */
cfblr = LTDC_LxCFBLR_CFBP(pinfo->stride) | cfblr = LTDC_LxCFBLR_CFBP(pinfo->stride) |
LTDC_LxCFBLR_CFBLL(area->xres * STM32_LTDC_Lx_BYPP(pinfo->bpp) + 3); LTDC_LxCFBLR_CFBLL(area->xres * STM32_LTDC_Lx_BYPP(pinfo->bpp) + 3);
@ -1696,8 +1695,7 @@ static void stm32_ltdc_lclut(FAR struct stm32_layer_s *layer)
stm32_ltdc_lclutenable(layer, false); stm32_ltdc_lclutenable(layer, false);
/* /* Reload shadow control register.
* Reload shadow control register
* This never changed any layer setting as long the layer register not up to * This never changed any layer setting as long the layer register not up to
* date. This is what stm32_update does. * date. This is what stm32_update does.
*/ */
@ -1966,6 +1964,7 @@ static void stm32_ltdc_linit(int lid)
#ifdef STM32_LAYER_CLUT_SIZE #ifdef STM32_LAYER_CLUT_SIZE
/* Disable clut by default */ /* Disable clut by default */
if (layer->state.vinfo.fmt == FB_FMT_RGB8) if (layer->state.vinfo.fmt == FB_FMT_RGB8)
{ {
stm32_ltdc_lclutenable(layer, false); stm32_ltdc_lclutenable(layer, false);
@ -2247,7 +2246,7 @@ static int stm32_setclut(struct ltdc_layer_s *layer,
} }
else else
{ {
/* Copy to the layer clut */ /* Copy to the layer cmap */
stm32_ltdc_cmapcpy(priv->state.cmap, cmap); stm32_ltdc_cmapcpy(priv->state.cmap, cmap);
@ -2693,7 +2692,7 @@ static int stm32_setblendmode(FAR struct ltdc_layer_s *layer, uint32_t mode)
/* Enable blending, restore the alpha value */ /* Enable blending, restore the alpha value */
stm32_ltdc_lunsetopac(priv); stm32_ltdc_lunsetopac(priv);
mode &= ~LTDC_BLEND_ALPHA; mode &= ~LTDC_BLEND_ALPHA;
} }
if (mode & LTDC_BLEND_COLORKEY) if (mode & LTDC_BLEND_COLORKEY)
@ -2712,10 +2711,10 @@ static int stm32_setblendmode(FAR struct ltdc_layer_s *layer, uint32_t mode)
if (ret == OK) if (ret == OK)
{ {
priv->state.blendmode = mode; priv->state.blendmode = mode;
priv->operation |= (LTDC_LAYER_SETBLENDMODE| priv->operation |= (LTDC_LAYER_SETBLENDMODE|
LTDC_LAYER_SETALPHAVALUE| LTDC_LAYER_SETALPHAVALUE|
LTDC_LAYER_SETCOLORKEY); LTDC_LAYER_SETCOLORKEY);
} }
sem_post(priv->state.lock); sem_post(priv->state.lock);
@ -2916,6 +2915,7 @@ static int stm32_update(FAR struct ltdc_layer_s *layer, uint32_t mode)
if (stm32_ltdc_lvalidate(priv)) if (stm32_ltdc_lvalidate(priv))
{ {
/* Reload immediately by default */ /* Reload immediately by default */
uint8_t reload = LTDC_SRCR_IMR; uint8_t reload = LTDC_SRCR_IMR;
sem_wait(priv->state.lock); sem_wait(priv->state.lock);
@ -2948,11 +2948,11 @@ static int stm32_update(FAR struct ltdc_layer_s *layer, uint32_t mode)
if (mode & LTDC_UPDATE_ACTIVATE) if (mode & LTDC_UPDATE_ACTIVATE)
{ {
/* Set the given layer to the active layer */ /* Set the given layer to the next active layer */
g_lactive = priv->state.lid; g_lactive = priv->state.lid;
/* Also change this for flip operation */ /* Also change the current active layer for flip operation */
active = &LAYER(!g_lactive); active = &LAYER(!g_lactive);
} }
@ -3163,7 +3163,7 @@ FAR struct ltdc_layer_s *stm32_ltdcgetlayer(int lid)
int stm32_ltdcinitialize(void) int stm32_ltdcinitialize(void)
{ {
gvdbg("Entry\n"); gvdbg("Initialize LTDC driver\n");
/* Disable the LCD */ /* Disable the LCD */
@ -3238,7 +3238,7 @@ struct fb_vtable_s *stm32_ltdcgetvplane(int vplane)
return (struct fb_vtable_s *)&g_vtable; return (struct fb_vtable_s *)&g_vtable;
} }
return NULL; return NULL;
} }
/**************************************************************************** /****************************************************************************
@ -3294,6 +3294,7 @@ void stm32_lcdclear(nxgl_mxpixel_t color)
void stm32_backlight(bool blon) void stm32_backlight(bool blon)
{ {
/* Set default backlight level CONFIG_STM32_LTDC_DEFBACKLIGHT */ /* Set default backlight level CONFIG_STM32_LTDC_DEFBACKLIGHT */
gdbg("Not supported\n"); gdbg("Not supported\n");
} }
#endif #endif