STM32F429LCD驱动函数求解!

2019-07-21 01:08发布

[mw_shl_code=c,true]void LCD_DrawChar(uint16_t Xpos, uint16_t Ypos, const uint16_t *c) { uint32_t index = 0, counter = 0, xpos =0; uint32_t Xaddress = 0; xpos = Xpos*LCD_PIXEL_WIDTH*3;//字节 Xaddress += Ypos; for(index = 0; index < LCD_Currentfonts->Height; index++) { for(counter = 0; counter < LCD_Currentfonts->Width; counter++) { if((((c[index] & ((0x80 << ((LCD_Currentfonts->Width / 12 ) * 8 ) ) >> counter)) == 0x00) &&(LCD_Currentfonts->Width <= 12))|| (((c[index] & (0x1 << counter)) == 0x00)&&(LCD_Currentfonts->Width > 12 ))) { /* Write data value to all SDRAM memory */ *(__IO uint32_t*) (CurrentFrameBuffer + (3*Xaddress) + xpos) = CurrentBackColor; } else { /* Write data value to all SDRAM memory */ *(__IO uint32_t*) (CurrentFrameBuffer + (3*Xaddress) + xpos) = CurrentTextColor; } Xaddress++; } Xaddress += (LCD_PIXEL_WIDTH - LCD_Currentfonts->Width); } }[/mw_shl_code] 这个代码没有看懂,这些变量不懂代表的含义
  xpos = Xpos*LCD_PIXEL_WIDTH*3;//字节
  Xaddress += Ypos;   这两个参数没有理解    Xadress是什么   还有Xpos  Ypos  xpos
另外那个循环里面为什么要/12*8       我理解为LCD_PIXEL_WIDTH*2为一行像素的字节数,但是不明白为什么要乘以Xpos,Xpos难道是行数?求详解!!!
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。