GFX Class
This file is used by the screen.
Item Index
Methods
- GFX
- drawPixel
- drawLine
- drawFastVLine
- drawFastHLine
- drawRect
- fillRect
- fillScreen
- invertDisplay
- drawCircle
- drawCircleHelper
- fillCircle
- fillCircleHelper
- drawTriangle
- fillTriangle
- drawRoundRect
- fillRoundRect
- drawChar
- getCursorX
- getCursorY
- setCursor
- setTextColor
- setTextColor
- setTextSize
- setTextWrap
- getRotation
- setRotation
- cp437
- write
- width
- height
- GFX
- drawPixel
- refresh
- drawChar
- fillScreen
- fillRect
- drawFastVLine
- drawLine
- drawTriangle
- drawCircle
- setCursor
- setTextColor
- setTextSize
- setTextWrap
- GFX
- setAddrWindow
- drawPixel
- refresh
- drawChar
- setPixel
- fillScreen
- fillRect
- drawFastVLine
- drawLine
- drawTriangle
- drawCircle
- setCursor
- setTextColor
- setTextSize
- setTextWrap
- GFX
- drawPixel
- drawLine
- drawFastVLine
- drawFastHLine
- drawRect
- fillRect
- fillScreen
- invertDisplay
- drawCircle
- drawCircleHelper
- fillCircle
- fillCircleHelper
- drawTriangle
- fillTriangle
- drawRoundRect
- fillRoundRect
- drawChar
- getCursorX
- getCursorY
- setCursor
- setTextColor
- setTextColor
- setTextSize
- setTextWrap
- getRotation
- setRotation
- cp437
- write
- width
- height
- GFX
- drawPixel
- refresh
- drawChar
- fillScreen
- fillRect
- drawFastVLine
- drawLine
- drawTriangle
- drawCircle
- setCursor
- setTextColor
- setTextSize
- setTextWrap
- GFX
- setAddrWindow
- drawPixel
- refresh
- drawChar
- setPixel
- fillScreen
- fillRect
- drawFastVLine
- drawLine
- drawTriangle
- drawCircle
- setCursor
- setTextColor
- setTextSize
- setTextWrap
- GFX
- drawPixel
- drawLine
- drawFastVLine
- drawFastHLine
- drawRect
- fillRect
- fillScreen
- invertDisplay
- drawCircle
- drawCircleHelper
- fillCircle
- fillCircleHelper
- drawTriangle
- fillTriangle
- drawRoundRect
- fillRoundRect
- drawChar
- getCursorX
- getCursorY
- setCursor
- setTextColor
- setTextColor
- setTextSize
- setTextWrap
- getRotation
- setRotation
- cp437
- write
- width
- height
- GFX
- drawPixel
- refresh
- drawChar
- fillScreen
- fillRect
- drawFastVLine
- drawLine
- drawTriangle
- drawCircle
- setCursor
- setTextColor
- setTextSize
- setTextWrap
- GFX
- setAddrWindow
- drawPixel
- refresh
- drawChar
- setPixel
- fillScreen
- fillRect
- drawFastVLine
- drawLine
- drawTriangle
- drawCircle
- setCursor
- setTextColor
- setTextSize
- setTextWrap
Methods
GFX
-
w
-
h
Creates a GFX object
Parameters:
-
w
NumberScreen width
-
h
NumberScreen height
Returns:
drawPixel
-
x
-
y
-
color
Sends a pixel color (RGB) to the driver chip. This must be defined by the subclass (pure virtual function).
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawLine
-
x0
-
y0
-
x1
-
y1
-
color
Draw a line.
Parameters:
-
x0
NumberStart of line x coordinate
-
y0
NumberStart of line y coordinate
-
x1
NumberEnd of line x coordinate
-
y1
NumberEnd of line y coordinate
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawFastVLine
-
x
-
y
-
h
-
color
Draws a vertical line using minimal SPI writes.
Parameters:
-
x
NumberAxis on the horizontal scale to begin line
-
y
NumberAxis on the vertical scale to begin line
-
h
NumberHeight of line in pixels
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawFastHLine
-
x
-
y
-
w
-
color
Draws a horizontal line using minimal SPI writes.
Parameters:
-
x
NumberAxis on the horizontal scale to begin line
-
y
NumberAxis on the vertical scale to begin line
-
w
NumberWidth of line in pixels
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawRect
-
x
-
y
-
w
-
h
-
color
Draws a rectangle (not filled).
Parameters:
-
x
NumberPosition of upper left corner on horizontal axis
-
y
NumberPosition of upper left corner on vertical axis
-
w
NumberWidth of rectangle
-
h
NumberHeight of rectangle RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
-
color
Numberundefined
fillRect
-
x
-
y
-
w
-
h
-
color
Draw a filled rectangle.
Parameters:
-
x
NumberAxis on the horizontal scale of upper-left corner
-
y
NumberAxis on the vertical scale of upper-left corner
-
w
NumberWidth of rectangle in pixels
-
h
NumberHeight of rectangle in pixels
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillScreen
-
color
Fill the screen with a single color.
Parameters:
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
invertDisplay
-
i
Invert colors on the display.
Parameters:
-
i
BooleanTrue or false to invert colors
drawCircle
-
x0
-
y0
-
r
-
color
Draw a circle outline.
Parameters:
-
x0
NumberCenter point of circle on x-axis
-
y0
NumberCenter point of circle on y-axis
-
r
NumberRadius of circle
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawCircleHelper
-
x0
-
y0
-
r
-
cornername
-
color
Used to draw rounded corners.
Parameters:
-
x0
NumberCenter point of circle on x-axis
-
y0
NumberCenter point of circle on y-axis
-
r
NumberRadius of circle
-
cornername
NumberMask of corner number (1, 2, 4, 8)
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillCircle
-
x0
-
y0
-
r
-
color
Draws a filled circle.
Parameters:
-
x0
NumberCenter point of circle on x-axis
-
y0
NumberCenter point of circle on y-axis
-
r
NumberRadius of circle
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillCircleHelper
-
x0
-
y0
-
r
-
cornername
-
delta
-
color
Used to draw a filled circle and rounded rectangles.
Parameters:
-
x0
NumberCenter point of circle on x-axis
-
y0
NumberCenter point of circle on y-axis
-
r
NumberRadius of circle
-
cornername
NumberMask of corner number (1, 2, 4, 8)
-
delta
NumberLine offset
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawTriangle
-
x0
-
y0
-
x1
-
y1
-
x2
-
y2
-
color
Draw a triangle.
Parameters:
-
x0
NumberFirst point coordinate on x-axis
-
y0
NumberFirst point coordinate on y-axis
-
x1
NumberSecond point coordinate on x-axis
-
y1
NumberSecond point coordinate on y-axis
-
x2
NumberThird point coordinate on x-axis
-
y2
NumberThird point coordinate on y-axis
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillTriangle
-
x0
-
y0
-
x1
-
y1
-
x2
-
y2
-
color
Draw a filled triangle.
Parameters:
-
x0
NumberFirst point coordinate on x-axis
-
y0
NumberFirst point coordinate on y-axis
-
x1
NumberSecond point coordinate on x-axis
-
y1
NumberSecond point coordinate on y-axis
-
x2
NumberThird point coordinate on x-axis
-
y2
NumberThird point coordinate on y-axis
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawRoundRect
-
x0
-
y0
-
w
-
h
-
radius
-
color
Draw a rectangle with rounded corners
Parameters:
-
x0
NumberX-axis coordinate of top-left corner
-
y0
NumberY-axis coordinate of top-left corner
-
w
NumberWidth of rectangle
-
h
Numberheight of rectangle
-
radius
NumberRadius of rounded corners
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillRoundRect
-
x0
-
y0
-
w
-
h
-
radius
-
color
Draw a filled rectangle with rounded corners
Parameters:
-
x0
NumberX-axis coordinate of top-left corner
-
y0
NumberY-axis coordinate of top-left corner
-
w
NumberWidth of rectangle
-
h
Numberheight of rectangle
-
radius
NumberRadius of rounded corners
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawChar
-
x
-
y
-
c
-
color
-
bg
-
size
Draw a character at the specified point.
Parameters:
-
x
NumberX-axis coordinate of the top-left corner
-
y
NumberY-axis coordinate of the top-left corner
-
c
StringCharacter to draw
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
-
bg
NumberBackground color (16-bit RGB)
-
size
NumberFont size
getCursorX
()
Number
Get the x-axis coordinate of the upper-left corner of the cursor.
Returns:
X-axis coordinate of the cursor
getCursorY
()
Number
Get the y-axis coordinate of the upper-left corner of the cursor.
Returns:
Y-axis coordinate of the cursor
setCursor
-
x
-
y
Set the cursor for writing text.
Parameters:
-
x
NumberX-axis coordinate of the top-left corner of the cursor
-
y
NumberY-axis coordinate of the top-left corner of the cursor
setTextColor
-
c
Set the color for text.
Parameters:
-
c
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
setTextColor
-
c
-
bg
Set the color for text and text background (highlight).
Parameters:
-
c
NumberText color (RGB, 16-bit)
-
bg
NumberBackground text color (RGB, 16-bit)
setTextSize
-
s
Set the size of the text.
Parameters:
-
s
NumberFont size (multiples of 8 pixel text height)
setTextWrap
-
w
Enable or disable text wrapping.
Parameters:
-
w
BooleanTrue to wrap text. False to truncate.
getRotation
()
Number
Get the current rotation configuration of the screen.
Returns:
current rotation 0-3
setRotation
-
r
Sets the rotation of the screen. Can be overridden with another screen-specific definition.
Parameters:
-
r
NumberRotation 0-3
cp437
-
x
Enable (or disable) Code Page 437-compatible charset.
Parameters:
-
x
BooleanTrue to enable CP437 charset. False to disable.
write
-
c
Write a character at the current cursor position. Definition can be overridden with board-specific code.
Parameters:
-
c
NumberCharacter to draw
print
-
msg
Prints a string to the screen.
Parameters:
-
msg
StringMessage to print
width
()
Number
Get the current width of the screen.
Returns:
the width in pixels
height
()
Number
Get the current height of the screen.
Returns:
the height in pixels
GFX
-
width
-
height
Instantiates a GFX object
Parameters:
-
width
NumberScreen width
-
height
NumberScreen height
Returns:
drawPixel
-
x
-
y
-
color
Sends a pixel color (RGB) to the chip. Must be implemented by the inherited class.
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
color
NumberRGB value
refresh
()
Copies the buffer to the chip via the SPI.
drawChar
-
x
-
y
-
data
-
color
-
bg
-
size
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
data
NumberCharacter to write
-
color
NumberCharacter color
-
bg
NumberCharacter background color
-
size
NumberSize of the font
print
-
msg
Prints a message on the screen
Parameters:
-
msg
StringMessage to print
fillScreen
-
color
Fills the screen with a selected color
Parameters:
-
color
NumberSelected color
fillRect
-
x
-
y
-
w
-
h
-
color
Fills a rectangle with a selected color
Parameters:
-
x
NumberAxis on the horizontal scale (top-left corner)
-
y
NumberAxis on the vertical scale (top-left corner)
-
w
NumberDistanse from x
-
h
NumberDistanse from y
-
color
NumberSelected color
drawFastVLine
-
x
-
y
-
h
-
color
Draws a line on the vertical scale
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
h
NumberDistanse from y
-
color
NumberSelected color
drawLine
-
x0
-
y0
-
x1
-
y1
-
color
Draws a line from coordinate C0 to coordinate C1
Parameters:
-
x0
NumberFirst coordinate
-
y0
NumberFirst coordinate
-
x1
NumberSecond coordinate
-
y1
NumberSecond coordinate
-
color
Numberselected color
drawTriangle
-
x0
-
y0
-
x1
-
y1
-
x2
-
y2
-
color
Draws a triangle
Parameters:
-
x0
NumberFirst coordinate
-
y0
NumberFirst coordinate
-
x1
NumberSecond coordinate
-
y1
NumberSecond coordinate
-
x2
NumberThird coordinate
-
y2
NumberThird coordinate
-
color
NumberSelected color
drawCircle
-
x
-
y
-
r
-
color
Draws a circle
Parameters:
-
x
NumberCenter of the circle on the horizontal scale
-
y
NumberCenter of the circle on the vertical scale
-
r
NumberRadius of the circle
-
color
NumberColor of the circle
setCursor
-
x
-
y
Sets the cursor for a text message
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
setTextColor
-
textColor
-
textBGColor
Sets a text color for a message
Parameters:
-
textColor
NumberFont color
-
textBGColor
NumberBackground color
setTextSize
-
size
Sets the size of the font
Parameters:
-
size
NumberFont size
setTextWrap
-
wrap
Wraps a printed message
Parameters:
-
wrap
NumberTrue (0x1) or false (0x0)
GFX
-
width
-
height
-
screenBuffer
-
font
Instantiates a GFX object
Parameters:
-
width
NumberScreen width
-
height
NumberScreen height
-
screenBuffer
Uint8_t *Pointer to the screen buffer
-
font
StringPointer to the font map
Returns:
setAddrWindow
-
x0
-
y0
-
x1
-
y1
Sets the window address
Parameters:
-
x0
NumberFirst coordinate
-
y0
NumberFirst coordinate
-
x1
NumberSecond coordinate
-
y1
NumberSecond coordinate
drawPixel
-
x
-
y
-
color
Sends a pixel color (RGB) to the chip. Must be implemented by the inherited class.
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
color
NumberRGB value
refresh
()
Copies the buffer to the chip via the SPI.
drawChar
-
x
-
y
-
data
-
color
-
bg
-
size
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
data
NumberCharacter to write
-
color
NumberCharacter color
-
bg
NumberCharacter background color
-
size
NumberSize of the font
print
-
msg
Prints a message on the screen
Parameters:
-
msg
StringMessage to print
setPixel
-
x
-
y
-
color
Prints a message on the screen
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
color
NumberPixel color
Returns:
fillScreen
-
color
Fills the screen with a selected color
Parameters:
-
color
NumberSelected color
fillRect
-
x
-
y
-
w
-
h
-
color
Fills a rectangle with a selected color
Parameters:
-
x
NumberAxis on the horizontal scale (top-left corner)
-
y
NumberAxis on the vertical scale (top-left corner)
-
w
NumberDistanse from x
-
h
NumberDistanse from y
-
color
NumberSelected color
drawFastVLine
-
x
-
y
-
h
-
color
Draws a line on the vertical scale
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
h
NumberDistanse from y
-
color
NumberSelected color
drawLine
-
x0
-
y0
-
x1
-
y1
-
color
Draws a line from coordinate C0 to coordinate C1
Parameters:
-
x0
NumberFirst coordinate
-
y0
NumberFirst coordinate
-
x1
NumberSecond coordinate
-
y1
NumberSecond coordinate
-
color
Numberselected color
drawTriangle
-
x0
-
y0
-
x1
-
y1
-
x2
-
y2
-
color
Draws a triangle
Parameters:
-
x0
NumberFirst coordinate
-
y0
NumberFirst coordinate
-
x1
NumberSecond coordinate
-
y1
NumberSecond coordinate
-
x2
NumberThird coordinate
-
y2
NumberThird coordinate
-
color
NumberSelected color
drawCircle
-
x
-
y
-
r
-
color
Draws a circle
Parameters:
-
x
NumberCenter of the circle on the horizontal scale
-
y
NumberCenter of the circle on the vertical scale
-
r
NumberRadius of the circle
-
color
NumberColor of the circle
setCursor
-
x
-
y
Sets the cursor for a text message
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
setTextColor
-
textColor
-
textBGColor
Sets a text color for a message
Parameters:
-
textColor
NumberFont color
-
textBGColor
NumberBackground color
setTextSize
-
size
Sets the size of the font
Parameters:
-
size
NumberFont size
setTextWrap
-
wrap
Wraps a printed message
Parameters:
-
wrap
NumberTrue (0x1) or false (0x0)
GFX
-
w
-
h
Creates a GFX object
Parameters:
-
w
NumberScreen width
-
h
NumberScreen height
Returns:
drawPixel
-
x
-
y
-
color
Sends a pixel color (RGB) to the driver chip. This must be defined by the subclass (pure virtual function).
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawLine
-
x0
-
y0
-
x1
-
y1
-
color
Draw a line.
Parameters:
-
x0
NumberStart of line x coordinate
-
y0
NumberStart of line y coordinate
-
x1
NumberEnd of line x coordinate
-
y1
NumberEnd of line y coordinate
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawFastVLine
-
x
-
y
-
h
-
color
Draws a vertical line using minimal SPI writes.
Parameters:
-
x
NumberAxis on the horizontal scale to begin line
-
y
NumberAxis on the vertical scale to begin line
-
h
NumberHeight of line in pixels
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawFastHLine
-
x
-
y
-
w
-
color
Draws a horizontal line using minimal SPI writes.
Parameters:
-
x
NumberAxis on the horizontal scale to begin line
-
y
NumberAxis on the vertical scale to begin line
-
w
NumberWidth of line in pixels
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawRect
-
x
-
y
-
w
-
h
-
color
Draws a rectangle (not filled).
Parameters:
-
x
NumberPosition of upper left corner on horizontal axis
-
y
NumberPosition of upper left corner on vertical axis
-
w
NumberWidth of rectangle
-
h
NumberHeight of rectangle RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
-
color
Numberundefined
fillRect
-
x
-
y
-
w
-
h
-
color
Draw a filled rectangle.
Parameters:
-
x
NumberAxis on the horizontal scale of upper-left corner
-
y
NumberAxis on the vertical scale of upper-left corner
-
w
NumberWidth of rectangle in pixels
-
h
NumberHeight of rectangle in pixels
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillScreen
-
color
Fill the screen with a single color.
Parameters:
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
invertDisplay
-
i
Invert colors on the display.
Parameters:
-
i
BooleanTrue or false to invert colors
drawCircle
-
x0
-
y0
-
r
-
color
Draw a circle outline.
Parameters:
-
x0
NumberCenter point of circle on x-axis
-
y0
NumberCenter point of circle on y-axis
-
r
NumberRadius of circle
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawCircleHelper
-
x0
-
y0
-
r
-
cornername
-
color
Used to draw rounded corners.
Parameters:
-
x0
NumberCenter point of circle on x-axis
-
y0
NumberCenter point of circle on y-axis
-
r
NumberRadius of circle
-
cornername
NumberMask of corner number (1, 2, 4, 8)
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillCircle
-
x0
-
y0
-
r
-
color
Draws a filled circle.
Parameters:
-
x0
NumberCenter point of circle on x-axis
-
y0
NumberCenter point of circle on y-axis
-
r
NumberRadius of circle
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillCircleHelper
-
x0
-
y0
-
r
-
cornername
-
delta
-
color
Used to draw a filled circle and rounded rectangles.
Parameters:
-
x0
NumberCenter point of circle on x-axis
-
y0
NumberCenter point of circle on y-axis
-
r
NumberRadius of circle
-
cornername
NumberMask of corner number (1, 2, 4, 8)
-
delta
NumberLine offset
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawTriangle
-
x0
-
y0
-
x1
-
y1
-
x2
-
y2
-
color
Draw a triangle.
Parameters:
-
x0
NumberFirst point coordinate on x-axis
-
y0
NumberFirst point coordinate on y-axis
-
x1
NumberSecond point coordinate on x-axis
-
y1
NumberSecond point coordinate on y-axis
-
x2
NumberThird point coordinate on x-axis
-
y2
NumberThird point coordinate on y-axis
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillTriangle
-
x0
-
y0
-
x1
-
y1
-
x2
-
y2
-
color
Draw a filled triangle.
Parameters:
-
x0
NumberFirst point coordinate on x-axis
-
y0
NumberFirst point coordinate on y-axis
-
x1
NumberSecond point coordinate on x-axis
-
y1
NumberSecond point coordinate on y-axis
-
x2
NumberThird point coordinate on x-axis
-
y2
NumberThird point coordinate on y-axis
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawRoundRect
-
x0
-
y0
-
w
-
h
-
radius
-
color
Draw a rectangle with rounded corners
Parameters:
-
x0
NumberX-axis coordinate of top-left corner
-
y0
NumberY-axis coordinate of top-left corner
-
w
NumberWidth of rectangle
-
h
Numberheight of rectangle
-
radius
NumberRadius of rounded corners
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillRoundRect
-
x0
-
y0
-
w
-
h
-
radius
-
color
Draw a filled rectangle with rounded corners
Parameters:
-
x0
NumberX-axis coordinate of top-left corner
-
y0
NumberY-axis coordinate of top-left corner
-
w
NumberWidth of rectangle
-
h
Numberheight of rectangle
-
radius
NumberRadius of rounded corners
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawChar
-
x
-
y
-
c
-
color
-
bg
-
size
Draw a character at the specified point.
Parameters:
-
x
NumberX-axis coordinate of the top-left corner
-
y
NumberY-axis coordinate of the top-left corner
-
c
StringCharacter to draw
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
-
bg
NumberBackground color (16-bit RGB)
-
size
NumberFont size
getCursorX
()
Number
Get the x-axis coordinate of the upper-left corner of the cursor.
Returns:
X-axis coordinate of the cursor
getCursorY
()
Number
Get the y-axis coordinate of the upper-left corner of the cursor.
Returns:
Y-axis coordinate of the cursor
setCursor
-
x
-
y
Set the cursor for writing text.
Parameters:
-
x
NumberX-axis coordinate of the top-left corner of the cursor
-
y
NumberY-axis coordinate of the top-left corner of the cursor
setTextColor
-
c
Set the color for text.
Parameters:
-
c
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
setTextColor
-
c
-
bg
Set the color for text and text background (highlight).
Parameters:
-
c
NumberText color (RGB, 16-bit)
-
bg
NumberBackground text color (RGB, 16-bit)
setTextSize
-
s
Set the size of the text.
Parameters:
-
s
NumberFont size (multiples of 8 pixel text height)
setTextWrap
-
w
Enable or disable text wrapping.
Parameters:
-
w
BooleanTrue to wrap text. False to truncate.
getRotation
()
Number
Get the current rotation configuration of the screen.
Returns:
current rotation 0-3
setRotation
-
r
Sets the rotation of the screen. Can be overridden with another screen-specific definition.
Parameters:
-
r
NumberRotation 0-3
cp437
-
x
Enable (or disable) Code Page 437-compatible charset.
Parameters:
-
x
BooleanTrue to enable CP437 charset. False to disable.
write
-
c
Write a character at the current cursor position. Definition can be overridden with board-specific code.
Parameters:
-
c
NumberCharacter to draw
print
-
msg
Prints a string to the screen.
Parameters:
-
msg
StringMessage to print
width
()
Number
Get the current width of the screen.
Returns:
the width in pixels
height
()
Number
Get the current height of the screen.
Returns:
the height in pixels
GFX
-
width
-
height
Instantiates a GFX object
Parameters:
-
width
NumberScreen width
-
height
NumberScreen height
Returns:
drawPixel
-
x
-
y
-
color
Sends a pixel color (RGB) to the chip. Must be implemented by the inherited class.
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
color
NumberRGB value
refresh
()
Copies the buffer to the chip via the SPI.
drawChar
-
x
-
y
-
data
-
color
-
bg
-
size
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
data
NumberCharacter to write
-
color
NumberCharacter color
-
bg
NumberCharacter background color
-
size
NumberSize of the font
print
-
msg
Prints a message on the screen
Parameters:
-
msg
StringMessage to print
fillScreen
-
color
Fills the screen with a selected color
Parameters:
-
color
NumberSelected color
fillRect
-
x
-
y
-
w
-
h
-
color
Fills a rectangle with a selected color
Parameters:
-
x
NumberAxis on the horizontal scale (top-left corner)
-
y
NumberAxis on the vertical scale (top-left corner)
-
w
NumberDistanse from x
-
h
NumberDistanse from y
-
color
NumberSelected color
drawFastVLine
-
x
-
y
-
h
-
color
Draws a line on the vertical scale
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
h
NumberDistanse from y
-
color
NumberSelected color
drawLine
-
x0
-
y0
-
x1
-
y1
-
color
Draws a line from coordinate C0 to coordinate C1
Parameters:
-
x0
NumberFirst coordinate
-
y0
NumberFirst coordinate
-
x1
NumberSecond coordinate
-
y1
NumberSecond coordinate
-
color
Numberselected color
drawTriangle
-
x0
-
y0
-
x1
-
y1
-
x2
-
y2
-
color
Draws a triangle
Parameters:
-
x0
NumberFirst coordinate
-
y0
NumberFirst coordinate
-
x1
NumberSecond coordinate
-
y1
NumberSecond coordinate
-
x2
NumberThird coordinate
-
y2
NumberThird coordinate
-
color
NumberSelected color
drawCircle
-
x
-
y
-
r
-
color
Draws a circle
Parameters:
-
x
NumberCenter of the circle on the horizontal scale
-
y
NumberCenter of the circle on the vertical scale
-
r
NumberRadius of the circle
-
color
NumberColor of the circle
setCursor
-
x
-
y
Sets the cursor for a text message
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
setTextColor
-
textColor
-
textBGColor
Sets a text color for a message
Parameters:
-
textColor
NumberFont color
-
textBGColor
NumberBackground color
setTextSize
-
size
Sets the size of the font
Parameters:
-
size
NumberFont size
setTextWrap
-
wrap
Wraps a printed message
Parameters:
-
wrap
NumberTrue (0x1) or false (0x0)
GFX
-
width
-
height
-
screenBuffer
-
font
Instantiates a GFX object
Parameters:
-
width
NumberScreen width
-
height
NumberScreen height
-
screenBuffer
Uint8_t *Pointer to the screen buffer
-
font
StringPointer to the font map
Returns:
setAddrWindow
-
x0
-
y0
-
x1
-
y1
Sets the window address
Parameters:
-
x0
NumberFirst coordinate
-
y0
NumberFirst coordinate
-
x1
NumberSecond coordinate
-
y1
NumberSecond coordinate
drawPixel
-
x
-
y
-
color
Sends a pixel color (RGB) to the chip. Must be implemented by the inherited class.
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
color
NumberRGB value
refresh
()
Copies the buffer to the chip via the SPI.
drawChar
-
x
-
y
-
data
-
color
-
bg
-
size
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
data
NumberCharacter to write
-
color
NumberCharacter color
-
bg
NumberCharacter background color
-
size
NumberSize of the font
print
-
msg
Prints a message on the screen
Parameters:
-
msg
StringMessage to print
setPixel
-
x
-
y
-
color
Prints a message on the screen
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
color
NumberPixel color
Returns:
fillScreen
-
color
Fills the screen with a selected color
Parameters:
-
color
NumberSelected color
fillRect
-
x
-
y
-
w
-
h
-
color
Fills a rectangle with a selected color
Parameters:
-
x
NumberAxis on the horizontal scale (top-left corner)
-
y
NumberAxis on the vertical scale (top-left corner)
-
w
NumberDistanse from x
-
h
NumberDistanse from y
-
color
NumberSelected color
drawFastVLine
-
x
-
y
-
h
-
color
Draws a line on the vertical scale
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
h
NumberDistanse from y
-
color
NumberSelected color
drawLine
-
x0
-
y0
-
x1
-
y1
-
color
Draws a line from coordinate C0 to coordinate C1
Parameters:
-
x0
NumberFirst coordinate
-
y0
NumberFirst coordinate
-
x1
NumberSecond coordinate
-
y1
NumberSecond coordinate
-
color
Numberselected color
drawTriangle
-
x0
-
y0
-
x1
-
y1
-
x2
-
y2
-
color
Draws a triangle
Parameters:
-
x0
NumberFirst coordinate
-
y0
NumberFirst coordinate
-
x1
NumberSecond coordinate
-
y1
NumberSecond coordinate
-
x2
NumberThird coordinate
-
y2
NumberThird coordinate
-
color
NumberSelected color
drawCircle
-
x
-
y
-
r
-
color
Draws a circle
Parameters:
-
x
NumberCenter of the circle on the horizontal scale
-
y
NumberCenter of the circle on the vertical scale
-
r
NumberRadius of the circle
-
color
NumberColor of the circle
setCursor
-
x
-
y
Sets the cursor for a text message
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
setTextColor
-
textColor
-
textBGColor
Sets a text color for a message
Parameters:
-
textColor
NumberFont color
-
textBGColor
NumberBackground color
setTextSize
-
size
Sets the size of the font
Parameters:
-
size
NumberFont size
setTextWrap
-
wrap
Wraps a printed message
Parameters:
-
wrap
NumberTrue (0x1) or false (0x0)
GFX
-
w
-
h
Creates a GFX object
Parameters:
-
w
NumberScreen width
-
h
NumberScreen height
Returns:
drawPixel
-
x
-
y
-
color
Sends a pixel color (RGB) to the driver chip. This must be defined by the subclass (pure virtual function).
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawLine
-
x0
-
y0
-
x1
-
y1
-
color
Draw a line.
Parameters:
-
x0
NumberStart of line x coordinate
-
y0
NumberStart of line y coordinate
-
x1
NumberEnd of line x coordinate
-
y1
NumberEnd of line y coordinate
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawFastVLine
-
x
-
y
-
h
-
color
Draws a vertical line using minimal SPI writes.
Parameters:
-
x
NumberAxis on the horizontal scale to begin line
-
y
NumberAxis on the vertical scale to begin line
-
h
NumberHeight of line in pixels
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawFastHLine
-
x
-
y
-
w
-
color
Draws a horizontal line using minimal SPI writes.
Parameters:
-
x
NumberAxis on the horizontal scale to begin line
-
y
NumberAxis on the vertical scale to begin line
-
w
NumberWidth of line in pixels
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawRect
-
x
-
y
-
w
-
h
-
color
Draws a rectangle (not filled).
Parameters:
-
x
NumberPosition of upper left corner on horizontal axis
-
y
NumberPosition of upper left corner on vertical axis
-
w
NumberWidth of rectangle
-
h
NumberHeight of rectangle RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
-
color
Numberundefined
fillRect
-
x
-
y
-
w
-
h
-
color
Draw a filled rectangle.
Parameters:
-
x
NumberAxis on the horizontal scale of upper-left corner
-
y
NumberAxis on the vertical scale of upper-left corner
-
w
NumberWidth of rectangle in pixels
-
h
NumberHeight of rectangle in pixels
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillScreen
-
color
Fill the screen with a single color.
Parameters:
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
invertDisplay
-
i
Invert colors on the display.
Parameters:
-
i
BooleanTrue or false to invert colors
drawCircle
-
x0
-
y0
-
r
-
color
Draw a circle outline.
Parameters:
-
x0
NumberCenter point of circle on x-axis
-
y0
NumberCenter point of circle on y-axis
-
r
NumberRadius of circle
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawCircleHelper
-
x0
-
y0
-
r
-
cornername
-
color
Used to draw rounded corners.
Parameters:
-
x0
NumberCenter point of circle on x-axis
-
y0
NumberCenter point of circle on y-axis
-
r
NumberRadius of circle
-
cornername
NumberMask of corner number (1, 2, 4, 8)
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillCircle
-
x0
-
y0
-
r
-
color
Draws a filled circle.
Parameters:
-
x0
NumberCenter point of circle on x-axis
-
y0
NumberCenter point of circle on y-axis
-
r
NumberRadius of circle
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillCircleHelper
-
x0
-
y0
-
r
-
cornername
-
delta
-
color
Used to draw a filled circle and rounded rectangles.
Parameters:
-
x0
NumberCenter point of circle on x-axis
-
y0
NumberCenter point of circle on y-axis
-
r
NumberRadius of circle
-
cornername
NumberMask of corner number (1, 2, 4, 8)
-
delta
NumberLine offset
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawTriangle
-
x0
-
y0
-
x1
-
y1
-
x2
-
y2
-
color
Draw a triangle.
Parameters:
-
x0
NumberFirst point coordinate on x-axis
-
y0
NumberFirst point coordinate on y-axis
-
x1
NumberSecond point coordinate on x-axis
-
y1
NumberSecond point coordinate on y-axis
-
x2
NumberThird point coordinate on x-axis
-
y2
NumberThird point coordinate on y-axis
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillTriangle
-
x0
-
y0
-
x1
-
y1
-
x2
-
y2
-
color
Draw a filled triangle.
Parameters:
-
x0
NumberFirst point coordinate on x-axis
-
y0
NumberFirst point coordinate on y-axis
-
x1
NumberSecond point coordinate on x-axis
-
y1
NumberSecond point coordinate on y-axis
-
x2
NumberThird point coordinate on x-axis
-
y2
NumberThird point coordinate on y-axis
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawRoundRect
-
x0
-
y0
-
w
-
h
-
radius
-
color
Draw a rectangle with rounded corners
Parameters:
-
x0
NumberX-axis coordinate of top-left corner
-
y0
NumberY-axis coordinate of top-left corner
-
w
NumberWidth of rectangle
-
h
Numberheight of rectangle
-
radius
NumberRadius of rounded corners
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillRoundRect
-
x0
-
y0
-
w
-
h
-
radius
-
color
Draw a filled rectangle with rounded corners
Parameters:
-
x0
NumberX-axis coordinate of top-left corner
-
y0
NumberY-axis coordinate of top-left corner
-
w
NumberWidth of rectangle
-
h
Numberheight of rectangle
-
radius
NumberRadius of rounded corners
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawChar
-
x
-
y
-
c
-
color
-
bg
-
size
Draw a character at the specified point.
Parameters:
-
x
NumberX-axis coordinate of the top-left corner
-
y
NumberY-axis coordinate of the top-left corner
-
c
StringCharacter to draw
-
color
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
-
bg
NumberBackground color (16-bit RGB)
-
size
NumberFont size
getCursorX
()
Number
Get the x-axis coordinate of the upper-left corner of the cursor.
Returns:
X-axis coordinate of the cursor
getCursorY
()
Number
Get the y-axis coordinate of the upper-left corner of the cursor.
Returns:
Y-axis coordinate of the cursor
setCursor
-
x
-
y
Set the cursor for writing text.
Parameters:
-
x
NumberX-axis coordinate of the top-left corner of the cursor
-
y
NumberY-axis coordinate of the top-left corner of the cursor
setTextColor
-
c
Set the color for text.
Parameters:
-
c
NumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
setTextColor
-
c
-
bg
Set the color for text and text background (highlight).
Parameters:
-
c
NumberText color (RGB, 16-bit)
-
bg
NumberBackground text color (RGB, 16-bit)
setTextSize
-
s
Set the size of the text.
Parameters:
-
s
NumberFont size (multiples of 8 pixel text height)
setTextWrap
-
w
Enable or disable text wrapping.
Parameters:
-
w
BooleanTrue to wrap text. False to truncate.
getRotation
()
Number
Get the current rotation configuration of the screen.
Returns:
current rotation 0-3
setRotation
-
r
Sets the rotation of the screen. Can be overridden with another screen-specific definition.
Parameters:
-
r
NumberRotation 0-3
cp437
-
x
Enable (or disable) Code Page 437-compatible charset.
Parameters:
-
x
BooleanTrue to enable CP437 charset. False to disable.
write
-
c
Write a character at the current cursor position. Definition can be overridden with board-specific code.
Parameters:
-
c
NumberCharacter to draw
print
-
msg
Prints a string to the screen.
Parameters:
-
msg
StringMessage to print
width
()
Number
Get the current width of the screen.
Returns:
the width in pixels
height
()
Number
Get the current height of the screen.
Returns:
the height in pixels
GFX
-
width
-
height
Instantiates a GFX object
Parameters:
-
width
NumberScreen width
-
height
NumberScreen height
Returns:
drawPixel
-
x
-
y
-
color
Sends a pixel color (RGB) to the chip. Must be implemented by the inherited class.
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
color
NumberRGB value
refresh
()
Copies the buffer to the chip via the SPI.
drawChar
-
x
-
y
-
data
-
color
-
bg
-
size
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
data
NumberCharacter to write
-
color
NumberCharacter color
-
bg
NumberCharacter background color
-
size
NumberSize of the font
print
-
msg
Prints a message on the screen
Parameters:
-
msg
StringMessage to print
fillScreen
-
color
Fills the screen with a selected color
Parameters:
-
color
NumberSelected color
fillRect
-
x
-
y
-
w
-
h
-
color
Fills a rectangle with a selected color
Parameters:
-
x
NumberAxis on the horizontal scale (top-left corner)
-
y
NumberAxis on the vertical scale (top-left corner)
-
w
NumberDistanse from x
-
h
NumberDistanse from y
-
color
NumberSelected color
drawFastVLine
-
x
-
y
-
h
-
color
Draws a line on the vertical scale
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
h
NumberDistanse from y
-
color
NumberSelected color
drawLine
-
x0
-
y0
-
x1
-
y1
-
color
Draws a line from coordinate C0 to coordinate C1
Parameters:
-
x0
NumberFirst coordinate
-
y0
NumberFirst coordinate
-
x1
NumberSecond coordinate
-
y1
NumberSecond coordinate
-
color
Numberselected color
drawTriangle
-
x0
-
y0
-
x1
-
y1
-
x2
-
y2
-
color
Draws a triangle
Parameters:
-
x0
NumberFirst coordinate
-
y0
NumberFirst coordinate
-
x1
NumberSecond coordinate
-
y1
NumberSecond coordinate
-
x2
NumberThird coordinate
-
y2
NumberThird coordinate
-
color
NumberSelected color
drawCircle
-
x
-
y
-
r
-
color
Draws a circle
Parameters:
-
x
NumberCenter of the circle on the horizontal scale
-
y
NumberCenter of the circle on the vertical scale
-
r
NumberRadius of the circle
-
color
NumberColor of the circle
setCursor
-
x
-
y
Sets the cursor for a text message
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
setTextColor
-
textColor
-
textBGColor
Sets a text color for a message
Parameters:
-
textColor
NumberFont color
-
textBGColor
NumberBackground color
setTextSize
-
size
Sets the size of the font
Parameters:
-
size
NumberFont size
setTextWrap
-
wrap
Wraps a printed message
Parameters:
-
wrap
NumberTrue (0x1) or false (0x0)
GFX
-
width
-
height
-
screenBuffer
-
font
Instantiates a GFX object
Parameters:
-
width
NumberScreen width
-
height
NumberScreen height
-
screenBuffer
Uint8_t *Pointer to the screen buffer
-
font
StringPointer to the font map
Returns:
setAddrWindow
-
x0
-
y0
-
x1
-
y1
Sets the window address
Parameters:
-
x0
NumberFirst coordinate
-
y0
NumberFirst coordinate
-
x1
NumberSecond coordinate
-
y1
NumberSecond coordinate
drawPixel
-
x
-
y
-
color
Sends a pixel color (RGB) to the chip. Must be implemented by the inherited class.
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
color
NumberRGB value
refresh
()
Copies the buffer to the chip via the SPI.
drawChar
-
x
-
y
-
data
-
color
-
bg
-
size
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
data
NumberCharacter to write
-
color
NumberCharacter color
-
bg
NumberCharacter background color
-
size
NumberSize of the font
print
-
msg
Prints a message on the screen
Parameters:
-
msg
StringMessage to print
setPixel
-
x
-
y
-
color
Prints a message on the screen
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
color
NumberPixel color
Returns:
fillScreen
-
color
Fills the screen with a selected color
Parameters:
-
color
NumberSelected color
fillRect
-
x
-
y
-
w
-
h
-
color
Fills a rectangle with a selected color
Parameters:
-
x
NumberAxis on the horizontal scale (top-left corner)
-
y
NumberAxis on the vertical scale (top-left corner)
-
w
NumberDistanse from x
-
h
NumberDistanse from y
-
color
NumberSelected color
drawFastVLine
-
x
-
y
-
h
-
color
Draws a line on the vertical scale
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
-
h
NumberDistanse from y
-
color
NumberSelected color
drawLine
-
x0
-
y0
-
x1
-
y1
-
color
Draws a line from coordinate C0 to coordinate C1
Parameters:
-
x0
NumberFirst coordinate
-
y0
NumberFirst coordinate
-
x1
NumberSecond coordinate
-
y1
NumberSecond coordinate
-
color
Numberselected color
drawTriangle
-
x0
-
y0
-
x1
-
y1
-
x2
-
y2
-
color
Draws a triangle
Parameters:
-
x0
NumberFirst coordinate
-
y0
NumberFirst coordinate
-
x1
NumberSecond coordinate
-
y1
NumberSecond coordinate
-
x2
NumberThird coordinate
-
y2
NumberThird coordinate
-
color
NumberSelected color
drawCircle
-
x
-
y
-
r
-
color
Draws a circle
Parameters:
-
x
NumberCenter of the circle on the horizontal scale
-
y
NumberCenter of the circle on the vertical scale
-
r
NumberRadius of the circle
-
color
NumberColor of the circle
setCursor
-
x
-
y
Sets the cursor for a text message
Parameters:
-
x
NumberAxis on the horizontal scale
-
y
NumberAxis on the vertical scale
setTextColor
-
textColor
-
textBGColor
Sets a text color for a message
Parameters:
-
textColor
NumberFont color
-
textBGColor
NumberBackground color
setTextSize
-
size
Sets the size of the font
Parameters:
-
size
NumberFont size
setTextWrap
-
wrap
Wraps a printed message
Parameters:
-
wrap
NumberTrue (0x1) or false (0x0)
Properties
m_map
Uint8_t *
Screens buffer
m_map
Uint8_t *
Screens buffer
m_map
Uint8_t *
Screens buffer