初中生
最后登录1970-1-1
在线时间 小时
注册时间2016-4-5
|
火哥,请问有没有关于void LCD_WriteBMP(uint32_t BmpAddress)这个函数调用的视频或者例程?能够给个信息地址呢使用前是否需要先将图片数组拷贝到内部FLASH中,然后再去调用地址?只有F429核心板的情况下能不能完成调用呢?
请帮忙教我,谢谢
* @brief Displays a bitmap picture loaded in the internal Flash.
* @param BmpAddress: Bmp picture address in the internal Flash.
* @retval None
*/
void LCD_WriteBMP(uint32_t BmpAddress)
{
uint32_t index = 0, size = 0, width = 0, height = 0, bit_pixel = 0;
uint32_t Address;
uint32_t currentline = 0, linenumber = 0;
Address = CurrentFrameBuffer;
/* Read bitmap size */
size = *(__IO uint16_t *) (BmpAddress + 2);
size |= (*(__IO uint16_t *) (BmpAddress + 4)) << 16;
/* Get bitmap data address offset */
index = *(__IO uint16_t *) (BmpAddress + 10);
index |= (*(__IO uint16_t *) (BmpAddress + 12)) << 16;
/* Read bitmap width */
width = *(uint16_t *) (BmpAddress + 18);
width |= (*(uint16_t *) (BmpAddress + 20)) << 16;
/* Read bitmap height */
height = *(uint16_t *) (BmpAddress + 22);
height |= (*(uint16_t *) (BmpAddress + 24)) << 16;
/* Read bit/pixel */
bit_pixel = *(uint16_t *) (BmpAddress + 28);
if (CurrentLayer == LCD_BACKGROUND_LAYER)
{
/* reconfigure layer size in accordance with the picture */
LTDC_LayerSize(LTDC_Layer1, width, height);
LTDC_ReloadConfig(LTDC_VBReload);
/* Reconfigure the Layer pixel format in accordance with the picture */
if ((bit_pixel/8) == 4)
{
LTDC_LayerPixelFormat(LTDC_Layer1, LTDC_Pixelformat_ARGB8888);
LTDC_ReloadConfig(LTDC_VBReload);
}
else if ((bit_pixel/8) == 2)
{
LTDC_LayerPixelFormat(LTDC_Layer1, LTDC_Pixelformat_RGB565);
LTDC_ReloadConfig(LTDC_VBReload);
}
else
{
LTDC_LayerPixelFormat(LTDC_Layer1, LTDC_Pixelformat_RGB888);
LTDC_ReloadConfig(LTDC_VBReload);
}
}
else
{
/* reconfigure layer size in accordance with the picture */
LTDC_LayerSize(LTDC_Layer2, width, height);
LTDC_ReloadConfig(LTDC_VBReload);
/* Reconfigure the Layer pixel format in accordance with the picture */
if ((bit_pixel/8) == 4)
{
LTDC_LayerPixelFormat(LTDC_Layer2, LTDC_Pixelformat_ARGB8888);
LTDC_ReloadConfig(LTDC_VBReload);
}
else if ((bit_pixel/8) == 2)
{
LTDC_LayerPixelFormat(LTDC_Layer2, LTDC_Pixelformat_RGB565);
LTDC_ReloadConfig(LTDC_VBReload);
}
else
{
LTDC_LayerPixelFormat(LTDC_Layer2, LTDC_Pixelformat_RGB888);
LTDC_ReloadConfig(LTDC_VBReload);
}
}
/* compute the real size of the picture (without the header)) */
size = (size - index);
/* bypass the bitmap header */
BmpAddress += index;
/* start copie image from the bottom */
Address += width*(height-1)*(bit_pixel/8);
for(index = 0; index < size; index++)
{
*(__IO uint8_t*) (Address) = *(__IO uint8_t *)BmpAddress;
/*jump on next byte */
BmpAddress++;
Address++;
currentline++;
if((currentline/(bit_pixel/8)) == width)
{
if(linenumber < height)
{
linenumber++;
Address -=(2*width*(bit_pixel/8));
currentline = 0;
}
}
}
}
|
|