diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-12-29 09:59:46 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-12-29 09:59:46 -0600 |
commit | 064703c28579a283f23d7d58e75f3ca2166ae4f4 (patch) | |
tree | 3a8b152721cd150732260a9f3de00e3a1f70dc2e | |
parent | 7c98e5cc9443f6d97d5c9d99e40723ce6b2e5cd7 (diff) | |
download | nuttx-064703c28579a283f23d7d58e75f3ca2166ae4f4.tar.gz nuttx-064703c28579a283f23d7d58e75f3ca2166ae4f4.tar.bz2 nuttx-064703c28579a283f23d7d58e75f3ca2166ae4f4.zip |
stm32: update description and code documentation. Also fixes a few code formattings.
Signed-off-by: Marco Krahl <ocram.lhark@gmail.com>
-rw-r--r-- | apps/examples/ltdc/ltdc_main.c | 8 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_ltdc.c | 39 |
2 files changed, 24 insertions, 23 deletions
diff --git a/apps/examples/ltdc/ltdc_main.c b/apps/examples/ltdc/ltdc_main.c index 629a1da3e..3f2aafca3 100644 --- a/apps/examples/ltdc/ltdc_main.c +++ b/apps/examples/ltdc/ltdc_main.c @@ -685,7 +685,7 @@ static void ltdc_color_test(void) sur->layer->setarea(sur->layer, &area, area.xpos, area.ypos); - dbg("Update the layer, should be black outside the white rectangle\n"); + dbg("Update the layer, should be black outside the colorful rectangle\n"); sur->layer->update(sur->layer, LTDC_SYNC_VBLANK|LTDC_SYNC_WAIT); @@ -693,7 +693,7 @@ static void ltdc_color_test(void) /* Default Color red */ - dbg("Update the layer, should be red outside the white rectangle\n"); + dbg("Update the layer, should be red outside the colorful rectangle\n"); sur->layer->setcolor(sur->layer, 0xffff0000); @@ -705,7 +705,7 @@ static void ltdc_color_test(void) /* Default Color green */ - dbg("Update the layer, should be green outside the white rectangle\n"); + dbg("Update the layer, should be green outside the colorful rectangle\n"); sur->layer->setcolor(sur->layer, 0xff00ff00); @@ -717,7 +717,7 @@ static void ltdc_color_test(void) /* Default Color blue */ - dbg("Update the layer, should be blue outside the white rectangle\n"); + dbg("Update the layer, should be blue outside the colorful rectangle\n"); sur->layer->setcolor(sur->layer, 0xff0000ff); diff --git a/nuttx/arch/arm/src/stm32/stm32_ltdc.c b/nuttx/arch/arm/src/stm32/stm32_ltdc.c index ed88bb9d4..11940578e 100644 --- a/nuttx/arch/arm/src/stm32/stm32_ltdc.c +++ b/nuttx/arch/arm/src/stm32/stm32_ltdc.c @@ -922,11 +922,10 @@ static void stm32_ltdc_gpioconfig(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(); /* 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); putreg32(value & ~LTDC_SRCR_WAIT, STM32_LTDC_SRCR); @@ -1154,8 +1153,6 @@ static void stm32_global_configure(void) stm32_ltdc_bgcolor(STM32_LTDC_BACKCOLOR); - /* Enable lcd interrupts only if neccessary */ - /* Enable line interrupt */ 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); 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) | 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); - /* - * Reload shadow control register + /* Reload shadow control register. * This never changed any layer setting as long the layer register not up to * date. This is what stm32_update does. */ @@ -1966,6 +1964,7 @@ static void stm32_ltdc_linit(int lid) #ifdef STM32_LAYER_CLUT_SIZE /* Disable clut by default */ + if (layer->state.vinfo.fmt == FB_FMT_RGB8) { stm32_ltdc_lclutenable(layer, false); @@ -2247,7 +2246,7 @@ static int stm32_setclut(struct ltdc_layer_s *layer, } else { - /* Copy to the layer clut */ + /* Copy to the layer 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 */ stm32_ltdc_lunsetopac(priv); - mode &= ~LTDC_BLEND_ALPHA; + mode &= ~LTDC_BLEND_ALPHA; } 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) { - priv->state.blendmode = mode; - priv->operation |= (LTDC_LAYER_SETBLENDMODE| - LTDC_LAYER_SETALPHAVALUE| - LTDC_LAYER_SETCOLORKEY); + priv->state.blendmode = mode; + priv->operation |= (LTDC_LAYER_SETBLENDMODE| + LTDC_LAYER_SETALPHAVALUE| + LTDC_LAYER_SETCOLORKEY); } 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)) { /* Reload immediately by default */ + uint8_t reload = LTDC_SRCR_IMR; 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) { - /* Set the given layer to the active layer */ + /* Set the given layer to the next active layer */ g_lactive = priv->state.lid; - /* Also change this for flip operation */ + /* Also change the current active layer for flip operation */ active = &LAYER(!g_lactive); } @@ -3163,7 +3163,7 @@ FAR struct ltdc_layer_s *stm32_ltdcgetlayer(int lid) int stm32_ltdcinitialize(void) { - gvdbg("Entry\n"); + gvdbg("Initialize LTDC driver\n"); /* Disable the LCD */ @@ -3238,7 +3238,7 @@ struct fb_vtable_s *stm32_ltdcgetvplane(int vplane) 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) { /* Set default backlight level CONFIG_STM32_LTDC_DEFBACKLIGHT */ + gdbg("Not supported\n"); } #endif |