本帖最后由 cl17726 于 2017-3-24 16:56 编辑
刚板子拿到手,第一次买这么全功能板子,先移植个ST官方的LCD_Log.上图~ 比较喜欢printf到屏幕,还带滚屏啊什么的,欢迎体验,实验环境是STM32F767+4.3 TFT.LL库.打印速度应该是快过UART的.
[mw_shl_code=c,true]LCD_LOG_PUTCHAR
{
sFONT *cFont = DrawProp.pFont;
uint32_t idx;
if(LCD_Lock == DISABLE)
{
if(LCD_ScrollActive == ENABLE)
{
LCD_CacheBuffer_yptr_bottom = LCD_CacheBuffer_yptr_bottom_bak;
LCD_CacheBuffer_yptr_top = LCD_CacheBuffer_yptr_top_bak;
LCD_ScrollActive = DISABLE;
LCD_Scrolled = DISABLE;
LCD_ScrollBackStep = 0;
}
if(( LCD_CacheBuffer_xptr < (480) /cFont->Width ) && ( ch != '
')) /* XSIZE = 480 */
{
LCD_CacheBuffer[LCD_CacheBuffer_yptr_bottom].line[LCD_CacheBuffer_xptr++] = (uint16_t)ch;
}
else
{
if(LCD_CacheBuffer_yptr_top >= LCD_CacheBuffer_yptr_bottom)
{
if(LCD_CacheBuffer_yptr_invert == DISABLE)
{
LCD_CacheBuffer_yptr_top++;
if(LCD_CacheBuffer_yptr_top == LCD_CACHE_DEPTH)
{
LCD_CacheBuffer_yptr_top = 0;
}
}
else
{
LCD_CacheBuffer_yptr_invert= DISABLE;
}
}
for(idx = LCD_CacheBuffer_xptr ; idx < (BSP_LCD_GetXSize()) /cFont->Width; idx++)
{
LCD_CacheBuffer[LCD_CacheBuffer_yptr_bottom].line[LCD_CacheBuffer_xptr++] = ' ';
}
LCD_CacheBuffer[LCD_CacheBuffer_yptr_bottom].color = LCD_LineColor;
LCD_CacheBuffer_xptr = 0;
LCD_LOG_UpdateDisplay ();
LCD_CacheBuffer_yptr_bottom ++;
if (LCD_CacheBuffer_yptr_bottom == LCD_CACHE_DEPTH)
{
LCD_CacheBuffer_yptr_bottom = 0;
LCD_CacheBuffer_yptr_top = 1;
LCD_CacheBuffer_yptr_invert = ENABLE;
}
if( ch != '
')
{
LCD_CacheBuffer[LCD_CacheBuffer_yptr_bottom].line[LCD_CacheBuffer_xptr++] = (uint16_t)ch;
}
}
}
return ch;
}[/mw_shl_code]
TFT_Log.zip
(618.51 KB, 下载次数: 443)
2017-3-24 13:12 上传
点击文件名下载附件
一周热门 更多>