diff --git a/configs/stm3210e-eval/include/board.h b/configs/stm3210e-eval/include/board.h index db7c11e8f5..3c7a655f3e 100755 --- a/configs/stm3210e-eval/include/board.h +++ b/configs/stm3210e-eval/include/board.h @@ -240,6 +240,21 @@ EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler); #endif #endif +/************************************************************************************ + * Name: stm3210e_lcdclear + * + * Description: + * This is a non-standard LCD interface just for the STM3210E-EVAL board. Because + * of the various rotations, clearing the display in the normal way by writing a + * sequences of runs that covers the entire display can be very slow. Here the + * dispaly is cleared by simply setting all GRAM memory to the specified color. + * + ************************************************************************************/ + +#ifdef CONFIG_STM32_FSMC +EXTERN void stm3210e_lcdclear(uint16_t color); +#endif + #undef EXTERN #if defined(__cplusplus) } diff --git a/configs/stm3210e-eval/src/up_lcd.c b/configs/stm3210e-eval/src/up_lcd.c index fccf680a5f..af4e412ce4 100755 --- a/configs/stm3210e-eval/src/up_lcd.c +++ b/configs/stm3210e-eval/src/up_lcd.c @@ -59,6 +59,8 @@ #include #include +#include + #include "up_arch.h" #include "stm32.h" #include "stm32_internal.h" @@ -354,7 +356,6 @@ static int stm3210e_setcontrast(struct lcd_dev_s *dev, unsigned int contrast); /* Initialization */ static inline void stm3210e_lcdinitialize(void); -static inline void stm3210e_lcdclear(void); #ifdef CONFIG_LCD_BACKLIGHT static void stm3210e_backlight(void); #else @@ -1059,26 +1060,6 @@ static inline void stm3210e_lcdinitialize(void) } } -/************************************************************************************** - * Name: stm3210e_lcdclear - * - * Description: - * Clear GRAM - * - **************************************************************************************/ - -static inline void stm3210e_lcdclear(void) -{ - uint32_t i = 0; - - stm3210e_setcursor(0, STM3210E_XRES-1); - stm3210e_gramselect(); - for (i = 0; i < STM3210E_XRES * STM3210E_YRES; i++) - { - LCD->value = 0; /* Black */ - } -} - /************************************************************************************** * Name: stm3210e_backlight * @@ -1230,9 +1211,9 @@ int up_lcdinitialize(void) up_mdelay(50); stm3210e_lcdinitialize(); - /* Clear the display */ + /* Clear the display (setting it to the color 0=black) */ - stm3210e_lcdclear(); + stm3210e_lcdclear(0); /* Configure the backlight */ @@ -1269,3 +1250,26 @@ void up_lcduninitialize(void) stm32_deselectlcd(); } +/************************************************************************************** + * Name: stm3210e_lcdclear + * + * Description: + * This is a non-standard LCD interface just for the STM3210E-EVAL board. Because + * of the various rotations, clearing the display in the normal way by writing a + * sequences of runs that covers the entire display can be very slow. Here the + * dispaly is cleared by simply setting all GRAM memory to the specified color. + * + **************************************************************************************/ + +void stm3210e_lcdclear(uint16_t color) +{ + uint32_t i = 0; + + stm3210e_setcursor(0, STM3210E_XRES-1); + stm3210e_gramselect(); + for (i = 0; i < STM3210E_XRES * STM3210E_YRES; i++) + { + LCD->value = color; + } +} +