ezLCD+103 Driver  0.1
Driver code for the ezLCD+103
 All Files Functions Typedefs Enumerations Groups Pages
Functions
Polygons

Functions

void ezLCD_draw_rect (uint16_t x2, uint16_t y2)
 
void ezLCD_draw_rect_fill (uint16_t x2, uint16_t y2)
 
void ezLCD_draw_polygon (uint8_t n, uint16_t x[], uint16_t y[])
 
void ezLCD_set_edit_rectangle (int16_t x, int16_t y, uint16_t width, uint16_t height)
 

Detailed Description

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.

Function Documentation

void ezLCD_draw_polygon ( uint8_t  n,
uint16_t  x[],
uint16_t  y[] 
)

Draws an n sided polygon filled with the current color. The first vertex is located at the current position.

polygon.png
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
void ezLCD_draw_rect ( uint16_t  x2,
uint16_t  y2 
)

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
void ezLCD_draw_rect_fill ( uint16_t  x2,
uint16_t  y2 
)

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
void ezLCD_set_edit_rectangle ( int16_t  x,
int16_t  y,
uint16_t  width,
uint16_t  height 
)

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