(2)輸入設(shè)備,即用觸摸屏作為輸入設(shè)備復(fù)制代碼
- /**
- * Flush a color buffer
- * @param x1 left coordinate of the rectangle
- * @param x2 right coordinate of the rectangle
- * @param y1 top coordinate of the rectangle
- * @param y2 bottom coordinate of the rectangle
- * @param color_p pointer to an array of colors
- */
- void tft_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p)
- {
- // LCD_Color_Fill(x1,y1,x2,y2,color_p);
- u16 height,width;
- u16 i,j;
- width=x2-x1+1; //得到填充的寬度
- height=y2-y1+1; //高度
- for(i=0;i<height;i++)
- {
- LCD_SetCursor(x1,y1+i); //設(shè)置光標(biāo)位置
- LCD_WriteRAM_Prepare(); //開始寫入GRAM
- for(j=0;j<width;j++)
- {
- LCD_TYPE->LCD_RAM=color_p->full;//寫入數(shù)據(jù)
- color_p++;
- }
- }
- lv_flush_ready();
- }
- /**
- * Put a color map to a rectangular area
- * @param x1 left coordinate of the rectangle
- * @param x2 right coordinate of the rectangle
- * @param y1 top coordinate of the rectangle
- * @param y2 bottom coordinate of the rectangle
- * @param color_p pointer to an array of colors
- */
- void tft_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p)
- {
- u16 height,width;
- u16 i,j;
- width=x2-x1+1; //得到填充的寬度
- height=y2-y1+1; //高度
- for(i=0;i<height;i++)
- {
- LCD_SetCursor(x1,y1+i); //設(shè)置光標(biāo)位置
- LCD_WriteRAM_Prepare(); //開始寫入GRAM
- for(j=0;j<width;j++)
- {
- LCD_TYPE->LCD_RAM=color_p->full;//寫入數(shù)據(jù)
- color_p++;
- }
- }
- }
- /**
- * Fill a rectangular area with a color
- * @param x1 left coordinate of the rectangle
- * @param x2 right coordinate of the rectangle
- * @param y1 top coordinate of the rectangle
- * @param y2 bottom coordinate of the rectangle
- * @param color fill color
- */
- void tft_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color)
- {
- LCD_Fill(x1,y1,x2,y2,color.full);
- }
歡迎光臨 (http://www.torrancerestoration.com/bbs/) | Powered by Discuz! X3.1 |