Driver/ST7735S-0.96/graphics.c
/******************************************************************************
        Function description: draw a rectangle
        Entry data:     x1, y1 starting coordinates
                        x2, y2 terminating coordinates
        Return value: None
******************************************************************************/
Function description: draw a rectangle
Entry data:     x1, y1 starting coordinates
x2, y2 terminating coordinates
Return value: None
Function description : draw a rectangle Entry data : x1 y1 starting coordinates x2 y2 terminating coordinates Return value : None
void LCD_DrawRectangle(u16 x1, u16 y1, u16 x2, u16 y2,u32 color)
{
        u16 x_start,x_end,y_start,y_end;
        x_start =       x1 < x2 ? x1 : x2;
        x_end   =       x1 > x2 ? x1 : x2;
        y_start =       y1 < y2 ? y1 : y2;
        y_end   =       y1 > y2 ? y1 : y2;
        LCD_DrawLine(x_start, y_start, x_end,   y_start, color);
	LCD_DrawLine(x_start, y_start, x_start, y_end,   color);
	LCD_DrawLine(x_start, y_end,   x_end,   y_end,   color);
	LCD_DrawLine(x_end,   y_start, x_end,   y_end,   color);
}
void LCD_DrawRectangle ( u16 x1 , u16 y1 , u16 x2 , u16 y2 , u32 color ) { u16 x_start , x_end , y_start , y_end ; x_start = x1 < x2 ? x1 : x2 ; x_end = x1 > x2 ? x1 : x2 ; y_start = y1 < y2 ? y1 : y2 ; y_end = y1 > y2 ? y1 : y2 ; LCD_DrawLine ( x_start , y_start , x_end , y_start , color ) ; LCD_DrawLine ( x_start , y_start , x_start , y_end , color ) ; LCD_DrawLine ( x_start , y_end , x_end , y_end , color ) ; LCD_DrawLine ( x_end , y_start , x_end , y_end , color ) ; }
Function description: draw a rectangle
Entry data:     x1, y1 starting coordinates
x2, y2 terminating coordinates
Return value: None
Function description : draw a rectangle Entry data : x1 y1 starting coordinates x2 y2 terminating coordinates Return value : None