Home > other >  For help, STM32F429 + STemWin, Hellow Word shows two, don't know where the problem is
For help, STM32F429 + STemWin, Hellow Word shows two, don't know where the problem is

Time:09-21

STM32F429 + STemWin, Hellow Word shows two, font color is also wrong, help to look at,

Part of the code is as follows, refer to the official routine STM32Cube \ Repository \ STM32Cube_FW_F4_V1 23.0, Middlewares, ST, brother STemWin and atomic code
Void main
{
.
GUI_SetBkColor (GUI_BLUE);
GUI_Clear ();
GUI_SetFont (& amp; GUI_Font24_ASCII);
GUI_SetColor (GUI_YELLOW);
GUI_DispString (" hellow word \ r \ n ");
GUI_DispString (" Hellow \ r \ n ");
.
}

LCDConfig_Lin. C code
# undef LCD_SWAP_XY
# undef LCD_MIRROR_Y

//# define LCD_SWAP_XY 1
//# define LCD_MIRROR_Y 1

# define XSIZE_PHYS 480
# define YSIZE_PHYS 272

1//# define NUM_BUFFERS Number of multiple buffers to be 2
1//# define NUM_VSCREENS Number of virtual screens to be 2

# define BK_COLOR GUI_DARKBLUE

# undef GUI_NUM_LAYERS
# define GUI_NUM_LAYERS 1

# define COLOR_CONVERSION_0 GUICC_M8888I
# define DISPLAY_DRIVER_0 GUIDRV_LIN_16


# if (GUI_NUM_LAYERS & gt; 1)
# define COLOR_CONVERSION_1 GUICC_M8888I
# define DISPLAY_DRIVER_1 GUIDRV_LIN_16
# endif

# # ifndef XSIZE_PHYS
# error Physical X the size of the display is not defined!
# endif
# # ifndef YSIZE_PHYS
# error Physical Y the size of the display is not defined!
# endif
# # ifndef NUM_VSCREENS
# define NUM_VSCREENS 1
# the else
# if (NUM_VSCREENS & lt;=0)
# error At further one screeen needs to be defined.
# endif
# endif
# if (NUM_VSCREENS & gt; 1) & amp; & (NUM_BUFFERS & gt; 1)
# error Virtual screens and multiple buffers are not allowed!
# endif

# define LCD_LAYER0_FRAME_BUFFER 0 xc0000000
# define LCD_LAYER1_FRAME_BUFFER 0 xc007f800
/* *
* @}
*/


/* * @ defgroup STEMWIN_LIBRARY_Private_Macros
* @ {
*/
/* Redirect bulk conversion to DMA2D routines */
# define DEFINEDMA2D_COLORCONVERSION (PFIX PIXELFORMAT) \
The static void Color2IndexBulk_ # # # PFIX# DMA2D (LCD_COLOR * pColor, void * pIndex, U32 NumItems, U8 SizeOfIndex) {\
DMA2D_Color2IndexBulk (pColor, pIndex, NumItems SizeOfIndex, PIXELFORMAT); \
} \
The static void Index2ColorBulk_ # # # PFIX# DMA2D (void * pIndex, pColor LCD_COLOR * and U32 NumItems, U8 SizeOfIndex) {\
DMA2D_Index2ColorBulk (pIndex, pColor, NumItems SizeOfIndex, PIXELFORMAT); \
}

/* *
* @}
*/

The static LCD_LayerPropTypedef layer_prop [GUI_NUM_LAYERS];
The static LTDC_HandleTypeDef HLTDC;

The static const LCD_API_COLOR_CONV * apColorConvAPI []=
{
COLOR_CONVERSION_0,
# if GUI_NUM_LAYERS & gt; 1
COLOR_CONVERSION_1,
# endif
};

The static U32 aBufferDMA2D [XSIZE_PHYS * sizeof (U32)];
The static U32 aBuffer_FG [XSIZE_PHYS * sizeof (U32)];
The static U32 aBuffer_BG [XSIZE_PHYS * sizeof (U32)];


Uint32_t ltdc_layer0 [XSIZE_PHYS] [YSIZE_PHYS] __attribute__ ((at) (LCD_LAYER0_FRAME_BUFFER));
Uint32_t ltdc_layer1 [XSIZE_PHYS] [YSIZE_PHYS] __attribute__ ((at) (LCD_LAYER1_FRAME_BUFFER));

/* *
* @}
*/

.


The static void LCD_LL_Init (void)
{
HLTDC. Instance=LTDC;
HLTDC. Init. HSPolarity=LTDC_HSPOLARITY_AL;
HLTDC. Init. VSPolarity=LTDC_VSPOLARITY_AL;
HLTDC. Init. DEPolarity=LTDC_DEPOLARITY_AL;
HLTDC. Init. PCPolarity=LTDC_PCPOLARITY_IPC;
HLTDC. Init. HorizontalSync=0;
HLTDC. Init. VerticalSync=0;
HLTDC. Init. AccumulatedHBP=40;
HLTDC. Init. AccumulatedVBP=8;
HLTDC. Init. AccumulatedActiveW=520;
HLTDC. Init. AccumulatedActiveH=280;
HLTDC. Init. TotalWidth=525;
HLTDC. Init. TotalHeigh=288;
HLTDC. Init. Backcolor. Blue=0;
HLTDC. Init. Backcolor. Green=0;
HLTDC. Init. Backcolor. Red=0;
HAL_LTDC_Init (& amp; HLTDC);

//LTDC interrupt
NVIC_SetPriority (LTDC_IRQn NVIC_EncodePriority (NVIC_GetPriorityGrouping (), 1, 0));
NVIC_EnableIRQ (LTDC_IRQn);
HAL_LTDC_ProgramLineEvent (& amp; HLTDC, 0);//open LTDC line break

LL_AHB1_GRP1_EnableClock (LL_AHB1_GRP1_PERIPH_DMA2D);

//NVIC_SetPriority (DMA2D_IRQn NVIC_EncodePriority (NVIC_GetPriorityGrouping (), 1, 0));
//NVIC_EnableIRQ (DMA2D_IRQn);

LL_DMA2D_SetMode (DMA2D LL_DMA2D_MODE_M2M_BLEND);
LL_DMA2D_SetOutputColorMode (DMA2D LL_DMA2D_OUTPUT_MODE_ARGB8888);
LL_DMA2D_SetLineOffset (DMA2D, 0);
LL_DMA2D_FGND_SetColorMode (DMA2D LL_DMA2D_INPUT_MODE_ARGB8888);
LL_DMA2D_FGND_SetAlphaMode (DMA2D LL_DMA2D_ALPHA_MODE_NO_MODIF);
LL_DMA2D_FGND_SetAlpha (DMA2D, 0);
LL_DMA2D_FGND_SetLineOffset (DMA2D, 0);
LL_DMA2D_BGND_SetColorMode (DMA2D LL_DMA2D_INPUT_MODE_ARGB8888);
LL_DMA2D_BGND_SetAlphaMode (DMA2D LL_DMA2D_ALPHA_MODE_NO_MODIF);
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related