Driver/ST7735S-0.96/graphics.c
/******************************************************************************
        Function description: draw a line
        Entry data:     x1, y1 starting coordinates
                        x2, y2 terminating coordinates
        Return value: None
******************************************************************************/
Function description: draw a line
Entry data:     x1, y1 starting coordinates
x2, y2 terminating coordinates
Return value: None
Function description : draw a line Entry data : x1 y1 starting coordinates x2 y2 terminating coordinates Return value : None
void LCD_DrawLine(int x0, int y0, int x1, int y1, u32 color)
{
        int i;
        if(x0 >= LCD_W)  return ;
        if(y0 >= LCD_H)  return ;
        if(x0 < 0)      x0 = 0;
        if(y0 < 0)      y0 = 0;
        if(x1 >= LCD_W) x1 = LCD_W-1;
        if(y1 >= LCD_H) y1 = LCD_H-1;
        LCD_Address_Set(x0,y0,x1,y1);
        for(i = 0; i < 320; i++){
                LCD_WR_COLOR(color);
        }
}
void LCD_DrawLine ( int x0 , int y0 , int x1 , int y1 , u32 color ) { int i ; if ( x0 >= LCD_W ) return ; if ( y0 >= LCD_H ) return ; if ( x0 < 0 ) x0 = 0 ; if ( y0 < 0 ) y0 = 0 ; if ( x1 >= LCD_W ) x1 = LCD_W - 1 ; if ( y1 >= LCD_H ) y1 = LCD_H - 1 ; LCD_Address_Set ( x0 , y0 , x1 , y1 ) ; for ( i = 0 ; i < 320 ; i ++ ) { LCD_WR_COLOR ( color ) ; } }
Function description: draw a line
Entry data:     x1, y1 starting coordinates
x2, y2 terminating coordinates
Return value: None
Function description : draw a line Entry data : x1 y1 starting coordinates x2 y2 terminating coordinates Return value : None