This header contains functions draw polygons to the current frame. It also has a function ezLCD_set_edit_rectangle() which is used in conjunction with ezLCD_replace_color() to define a rectangular region for editing.
Draws an n sided polygon filled with the current color. The first vertex is located at the current position.
Example of polygon drawing
- Parameters
- n = The number of vertices on the polygon
- x[] = X coordinates of the verticies (exclusing the current position)
- y[] = Y coordinates of the verticies (exclusing the current position)
- Assumptions
- Both arrays are filled as follows for some number i:
- x[i] and y[i] implies that coordinate (x[i],y[i]) is a vertex of the polygon.
- The user has initialized the MCU's SPI interface with the EZLCD_INIT_SPI() macro.
- The user has set the MCU's SPI pins to inputs and outputs appropriately.
- SS_BAR = OUTPUT
- SCK = OUTPUT
- MOSI = OUTPUT
- MISO = INPUT
This function is used to draw an unfilled rectangle from the current position to the specified XY coordinate in the current color.
- Parameters
- x2 = X coordinate of the corner opposite the current position.
- y2 = Y coordinate of the corner opposite the current position.
- Assumptions
- The user has initialized the MCU's SPI interface with the EZLCD_INIT_SPI() macro.
- The user has set the MCU's SPI pins to inputs and outputs appropriately.
- SS_BAR = OUTPUT
- SCK = OUTPUT
- MOSI = OUTPUT
- MISO = INPUT
This function is used to draw a filled rectangle from the current position to the specified XY coordinate in the current color.
- Parameters
- x2 = X coordinate of the corner opposite the current position.
- y2 = Y coordinate of the corner opposite the current position.
- Assumptions
- The user has initialized the MCU's SPI interface with the EZLCD_INIT_SPI() macro.
- The user has set the MCU's SPI pins to inputs and outputs appropriately.
- SS_BAR = OUTPUT
- SCK = OUTPUT
- MOSI = OUTPUT
- MISO = INPUT
Defines a rectangular region for editing by the ezLCD_replace_color() function.
- Parameters
- x = X coordinate of the upper-left hand corner of the rectangular region.
- y = Y coordinate of the upper-left hand corner of the rectangular region.
- width = Width of the rectangular region to be edited.
- height = Height of the rectangular region to be edited.
- Assumptions
- The user has initialized the MCU's SPI interface with the EZLCD_INIT_SPI() macro.
- The user has set the MCU's SPI pins to inputs and outputs appropriately.
- SS_BAR = OUTPUT
- SCK = OUTPUT
- MOSI = OUTPUT
- MISO = INPUT