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:
-
wNumberScreen width
-
hNumberScreen 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:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawLine
-
x0 -
y0 -
x1 -
y1 -
color
Draw a line.
Parameters:
-
x0NumberStart of line x coordinate
-
y0NumberStart of line y coordinate
-
x1NumberEnd of line x coordinate
-
y1NumberEnd of line y coordinate
-
colorNumberRGB (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:
-
xNumberAxis on the horizontal scale to begin line
-
yNumberAxis on the vertical scale to begin line
-
hNumberHeight of line in pixels
-
colorNumberRGB (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:
-
xNumberAxis on the horizontal scale to begin line
-
yNumberAxis on the vertical scale to begin line
-
wNumberWidth of line in pixels
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawRect
-
x -
y -
w -
h -
color
Draws a rectangle (not filled).
Parameters:
-
xNumberPosition of upper left corner on horizontal axis
-
yNumberPosition of upper left corner on vertical axis
-
wNumberWidth of rectangle
-
hNumberHeight of rectangle RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
-
colorNumberundefined
fillRect
-
x -
y -
w -
h -
color
Draw a filled rectangle.
Parameters:
-
xNumberAxis on the horizontal scale of upper-left corner
-
yNumberAxis on the vertical scale of upper-left corner
-
wNumberWidth of rectangle in pixels
-
hNumberHeight of rectangle in pixels
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillScreen
-
color
Fill the screen with a single color.
Parameters:
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
invertDisplay
-
i
Invert colors on the display.
Parameters:
-
iBooleanTrue or false to invert colors
drawCircle
-
x0 -
y0 -
r -
color
Draw a circle outline.
Parameters:
-
x0NumberCenter point of circle on x-axis
-
y0NumberCenter point of circle on y-axis
-
rNumberRadius of circle
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawCircleHelper
-
x0 -
y0 -
r -
cornername -
color
Used to draw rounded corners.
Parameters:
-
x0NumberCenter point of circle on x-axis
-
y0NumberCenter point of circle on y-axis
-
rNumberRadius of circle
-
cornernameNumberMask of corner number (1, 2, 4, 8)
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillCircle
-
x0 -
y0 -
r -
color
Draws a filled circle.
Parameters:
-
x0NumberCenter point of circle on x-axis
-
y0NumberCenter point of circle on y-axis
-
rNumberRadius of circle
-
colorNumberRGB (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:
-
x0NumberCenter point of circle on x-axis
-
y0NumberCenter point of circle on y-axis
-
rNumberRadius of circle
-
cornernameNumberMask of corner number (1, 2, 4, 8)
-
deltaNumberLine offset
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawTriangle
-
x0 -
y0 -
x1 -
y1 -
x2 -
y2 -
color
Draw a triangle.
Parameters:
-
x0NumberFirst point coordinate on x-axis
-
y0NumberFirst point coordinate on y-axis
-
x1NumberSecond point coordinate on x-axis
-
y1NumberSecond point coordinate on y-axis
-
x2NumberThird point coordinate on x-axis
-
y2NumberThird point coordinate on y-axis
-
colorNumberRGB (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:
-
x0NumberFirst point coordinate on x-axis
-
y0NumberFirst point coordinate on y-axis
-
x1NumberSecond point coordinate on x-axis
-
y1NumberSecond point coordinate on y-axis
-
x2NumberThird point coordinate on x-axis
-
y2NumberThird point coordinate on y-axis
-
colorNumberRGB (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:
-
x0NumberX-axis coordinate of top-left corner
-
y0NumberY-axis coordinate of top-left corner
-
wNumberWidth of rectangle
-
hNumberheight of rectangle
-
radiusNumberRadius of rounded corners
-
colorNumberRGB (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:
-
x0NumberX-axis coordinate of top-left corner
-
y0NumberY-axis coordinate of top-left corner
-
wNumberWidth of rectangle
-
hNumberheight of rectangle
-
radiusNumberRadius of rounded corners
-
colorNumberRGB (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:
-
xNumberX-axis coordinate of the top-left corner
-
yNumberY-axis coordinate of the top-left corner
-
cStringCharacter to draw
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
-
bgNumberBackground color (16-bit RGB)
-
sizeNumberFont 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:
-
xNumberX-axis coordinate of the top-left corner of the cursor
-
yNumberY-axis coordinate of the top-left corner of the cursor
setTextColor
-
c
Set the color for text.
Parameters:
-
cNumberRGB (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:
-
cNumberText color (RGB, 16-bit)
-
bgNumberBackground text color (RGB, 16-bit)
setTextSize
-
s
Set the size of the text.
Parameters:
-
sNumberFont size (multiples of 8 pixel text height)
setTextWrap
-
w
Enable or disable text wrapping.
Parameters:
-
wBooleanTrue 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:
-
rNumberRotation 0-3
cp437
-
x
Enable (or disable) Code Page 437-compatible charset.
Parameters:
-
xBooleanTrue 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:
-
cNumberCharacter to draw
print
-
msg
Prints a string to the screen.
Parameters:
-
msgStringMessage 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:
-
widthNumberScreen width
-
heightNumberScreen height
Returns:
drawPixel
-
x -
y -
color
Sends a pixel color (RGB) to the chip. Must be implemented by the inherited class.
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
colorNumberRGB value
refresh
()
Copies the buffer to the chip via the SPI.
drawChar
-
x -
y -
data -
color -
bg -
size
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
dataNumberCharacter to write
-
colorNumberCharacter color
-
bgNumberCharacter background color
-
sizeNumberSize of the font
print
-
msg
Prints a message on the screen
Parameters:
-
msgStringMessage to print
fillScreen
-
color
Fills the screen with a selected color
Parameters:
-
colorNumberSelected color
fillRect
-
x -
y -
w -
h -
color
Fills a rectangle with a selected color
Parameters:
-
xNumberAxis on the horizontal scale (top-left corner)
-
yNumberAxis on the vertical scale (top-left corner)
-
wNumberDistanse from x
-
hNumberDistanse from y
-
colorNumberSelected color
drawFastVLine
-
x -
y -
h -
color
Draws a line on the vertical scale
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
hNumberDistanse from y
-
colorNumberSelected color
drawLine
-
x0 -
y0 -
x1 -
y1 -
color
Draws a line from coordinate C0 to coordinate C1
Parameters:
-
x0NumberFirst coordinate
-
y0NumberFirst coordinate
-
x1NumberSecond coordinate
-
y1NumberSecond coordinate
-
colorNumberselected color
drawTriangle
-
x0 -
y0 -
x1 -
y1 -
x2 -
y2 -
color
Draws a triangle
Parameters:
-
x0NumberFirst coordinate
-
y0NumberFirst coordinate
-
x1NumberSecond coordinate
-
y1NumberSecond coordinate
-
x2NumberThird coordinate
-
y2NumberThird coordinate
-
colorNumberSelected color
drawCircle
-
x -
y -
r -
color
Draws a circle
Parameters:
-
xNumberCenter of the circle on the horizontal scale
-
yNumberCenter of the circle on the vertical scale
-
rNumberRadius of the circle
-
colorNumberColor of the circle
setCursor
-
x -
y
Sets the cursor for a text message
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
setTextColor
-
textColor -
textBGColor
Sets a text color for a message
Parameters:
-
textColorNumberFont color
-
textBGColorNumberBackground color
setTextSize
-
size
Sets the size of the font
Parameters:
-
sizeNumberFont size
setTextWrap
-
wrap
Wraps a printed message
Parameters:
-
wrapNumberTrue (0x1) or false (0x0)
GFX
-
width -
height -
screenBuffer -
font
Instantiates a GFX object
Parameters:
-
widthNumberScreen width
-
heightNumberScreen height
-
screenBufferUint8_t *Pointer to the screen buffer
-
fontStringPointer to the font map
Returns:
setAddrWindow
-
x0 -
y0 -
x1 -
y1
Sets the window address
Parameters:
-
x0NumberFirst coordinate
-
y0NumberFirst coordinate
-
x1NumberSecond coordinate
-
y1NumberSecond coordinate
drawPixel
-
x -
y -
color
Sends a pixel color (RGB) to the chip. Must be implemented by the inherited class.
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
colorNumberRGB value
refresh
()
Copies the buffer to the chip via the SPI.
drawChar
-
x -
y -
data -
color -
bg -
size
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
dataNumberCharacter to write
-
colorNumberCharacter color
-
bgNumberCharacter background color
-
sizeNumberSize of the font
print
-
msg
Prints a message on the screen
Parameters:
-
msgStringMessage to print
setPixel
-
x -
y -
color
Prints a message on the screen
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
colorNumberPixel color
Returns:
fillScreen
-
color
Fills the screen with a selected color
Parameters:
-
colorNumberSelected color
fillRect
-
x -
y -
w -
h -
color
Fills a rectangle with a selected color
Parameters:
-
xNumberAxis on the horizontal scale (top-left corner)
-
yNumberAxis on the vertical scale (top-left corner)
-
wNumberDistanse from x
-
hNumberDistanse from y
-
colorNumberSelected color
drawFastVLine
-
x -
y -
h -
color
Draws a line on the vertical scale
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
hNumberDistanse from y
-
colorNumberSelected color
drawLine
-
x0 -
y0 -
x1 -
y1 -
color
Draws a line from coordinate C0 to coordinate C1
Parameters:
-
x0NumberFirst coordinate
-
y0NumberFirst coordinate
-
x1NumberSecond coordinate
-
y1NumberSecond coordinate
-
colorNumberselected color
drawTriangle
-
x0 -
y0 -
x1 -
y1 -
x2 -
y2 -
color
Draws a triangle
Parameters:
-
x0NumberFirst coordinate
-
y0NumberFirst coordinate
-
x1NumberSecond coordinate
-
y1NumberSecond coordinate
-
x2NumberThird coordinate
-
y2NumberThird coordinate
-
colorNumberSelected color
drawCircle
-
x -
y -
r -
color
Draws a circle
Parameters:
-
xNumberCenter of the circle on the horizontal scale
-
yNumberCenter of the circle on the vertical scale
-
rNumberRadius of the circle
-
colorNumberColor of the circle
setCursor
-
x -
y
Sets the cursor for a text message
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
setTextColor
-
textColor -
textBGColor
Sets a text color for a message
Parameters:
-
textColorNumberFont color
-
textBGColorNumberBackground color
setTextSize
-
size
Sets the size of the font
Parameters:
-
sizeNumberFont size
setTextWrap
-
wrap
Wraps a printed message
Parameters:
-
wrapNumberTrue (0x1) or false (0x0)
GFX
-
w -
h
Creates a GFX object
Parameters:
-
wNumberScreen width
-
hNumberScreen 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:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawLine
-
x0 -
y0 -
x1 -
y1 -
color
Draw a line.
Parameters:
-
x0NumberStart of line x coordinate
-
y0NumberStart of line y coordinate
-
x1NumberEnd of line x coordinate
-
y1NumberEnd of line y coordinate
-
colorNumberRGB (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:
-
xNumberAxis on the horizontal scale to begin line
-
yNumberAxis on the vertical scale to begin line
-
hNumberHeight of line in pixels
-
colorNumberRGB (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:
-
xNumberAxis on the horizontal scale to begin line
-
yNumberAxis on the vertical scale to begin line
-
wNumberWidth of line in pixels
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawRect
-
x -
y -
w -
h -
color
Draws a rectangle (not filled).
Parameters:
-
xNumberPosition of upper left corner on horizontal axis
-
yNumberPosition of upper left corner on vertical axis
-
wNumberWidth of rectangle
-
hNumberHeight of rectangle RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
-
colorNumberundefined
fillRect
-
x -
y -
w -
h -
color
Draw a filled rectangle.
Parameters:
-
xNumberAxis on the horizontal scale of upper-left corner
-
yNumberAxis on the vertical scale of upper-left corner
-
wNumberWidth of rectangle in pixels
-
hNumberHeight of rectangle in pixels
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillScreen
-
color
Fill the screen with a single color.
Parameters:
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
invertDisplay
-
i
Invert colors on the display.
Parameters:
-
iBooleanTrue or false to invert colors
drawCircle
-
x0 -
y0 -
r -
color
Draw a circle outline.
Parameters:
-
x0NumberCenter point of circle on x-axis
-
y0NumberCenter point of circle on y-axis
-
rNumberRadius of circle
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawCircleHelper
-
x0 -
y0 -
r -
cornername -
color
Used to draw rounded corners.
Parameters:
-
x0NumberCenter point of circle on x-axis
-
y0NumberCenter point of circle on y-axis
-
rNumberRadius of circle
-
cornernameNumberMask of corner number (1, 2, 4, 8)
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillCircle
-
x0 -
y0 -
r -
color
Draws a filled circle.
Parameters:
-
x0NumberCenter point of circle on x-axis
-
y0NumberCenter point of circle on y-axis
-
rNumberRadius of circle
-
colorNumberRGB (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:
-
x0NumberCenter point of circle on x-axis
-
y0NumberCenter point of circle on y-axis
-
rNumberRadius of circle
-
cornernameNumberMask of corner number (1, 2, 4, 8)
-
deltaNumberLine offset
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawTriangle
-
x0 -
y0 -
x1 -
y1 -
x2 -
y2 -
color
Draw a triangle.
Parameters:
-
x0NumberFirst point coordinate on x-axis
-
y0NumberFirst point coordinate on y-axis
-
x1NumberSecond point coordinate on x-axis
-
y1NumberSecond point coordinate on y-axis
-
x2NumberThird point coordinate on x-axis
-
y2NumberThird point coordinate on y-axis
-
colorNumberRGB (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:
-
x0NumberFirst point coordinate on x-axis
-
y0NumberFirst point coordinate on y-axis
-
x1NumberSecond point coordinate on x-axis
-
y1NumberSecond point coordinate on y-axis
-
x2NumberThird point coordinate on x-axis
-
y2NumberThird point coordinate on y-axis
-
colorNumberRGB (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:
-
x0NumberX-axis coordinate of top-left corner
-
y0NumberY-axis coordinate of top-left corner
-
wNumberWidth of rectangle
-
hNumberheight of rectangle
-
radiusNumberRadius of rounded corners
-
colorNumberRGB (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:
-
x0NumberX-axis coordinate of top-left corner
-
y0NumberY-axis coordinate of top-left corner
-
wNumberWidth of rectangle
-
hNumberheight of rectangle
-
radiusNumberRadius of rounded corners
-
colorNumberRGB (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:
-
xNumberX-axis coordinate of the top-left corner
-
yNumberY-axis coordinate of the top-left corner
-
cStringCharacter to draw
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
-
bgNumberBackground color (16-bit RGB)
-
sizeNumberFont 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:
-
xNumberX-axis coordinate of the top-left corner of the cursor
-
yNumberY-axis coordinate of the top-left corner of the cursor
setTextColor
-
c
Set the color for text.
Parameters:
-
cNumberRGB (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:
-
cNumberText color (RGB, 16-bit)
-
bgNumberBackground text color (RGB, 16-bit)
setTextSize
-
s
Set the size of the text.
Parameters:
-
sNumberFont size (multiples of 8 pixel text height)
setTextWrap
-
w
Enable or disable text wrapping.
Parameters:
-
wBooleanTrue 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:
-
rNumberRotation 0-3
cp437
-
x
Enable (or disable) Code Page 437-compatible charset.
Parameters:
-
xBooleanTrue 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:
-
cNumberCharacter to draw
print
-
msg
Prints a string to the screen.
Parameters:
-
msgStringMessage 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:
-
widthNumberScreen width
-
heightNumberScreen height
Returns:
drawPixel
-
x -
y -
color
Sends a pixel color (RGB) to the chip. Must be implemented by the inherited class.
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
colorNumberRGB value
refresh
()
Copies the buffer to the chip via the SPI.
drawChar
-
x -
y -
data -
color -
bg -
size
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
dataNumberCharacter to write
-
colorNumberCharacter color
-
bgNumberCharacter background color
-
sizeNumberSize of the font
print
-
msg
Prints a message on the screen
Parameters:
-
msgStringMessage to print
fillScreen
-
color
Fills the screen with a selected color
Parameters:
-
colorNumberSelected color
fillRect
-
x -
y -
w -
h -
color
Fills a rectangle with a selected color
Parameters:
-
xNumberAxis on the horizontal scale (top-left corner)
-
yNumberAxis on the vertical scale (top-left corner)
-
wNumberDistanse from x
-
hNumberDistanse from y
-
colorNumberSelected color
drawFastVLine
-
x -
y -
h -
color
Draws a line on the vertical scale
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
hNumberDistanse from y
-
colorNumberSelected color
drawLine
-
x0 -
y0 -
x1 -
y1 -
color
Draws a line from coordinate C0 to coordinate C1
Parameters:
-
x0NumberFirst coordinate
-
y0NumberFirst coordinate
-
x1NumberSecond coordinate
-
y1NumberSecond coordinate
-
colorNumberselected color
drawTriangle
-
x0 -
y0 -
x1 -
y1 -
x2 -
y2 -
color
Draws a triangle
Parameters:
-
x0NumberFirst coordinate
-
y0NumberFirst coordinate
-
x1NumberSecond coordinate
-
y1NumberSecond coordinate
-
x2NumberThird coordinate
-
y2NumberThird coordinate
-
colorNumberSelected color
drawCircle
-
x -
y -
r -
color
Draws a circle
Parameters:
-
xNumberCenter of the circle on the horizontal scale
-
yNumberCenter of the circle on the vertical scale
-
rNumberRadius of the circle
-
colorNumberColor of the circle
setCursor
-
x -
y
Sets the cursor for a text message
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
setTextColor
-
textColor -
textBGColor
Sets a text color for a message
Parameters:
-
textColorNumberFont color
-
textBGColorNumberBackground color
setTextSize
-
size
Sets the size of the font
Parameters:
-
sizeNumberFont size
setTextWrap
-
wrap
Wraps a printed message
Parameters:
-
wrapNumberTrue (0x1) or false (0x0)
GFX
-
width -
height -
screenBuffer -
font
Instantiates a GFX object
Parameters:
-
widthNumberScreen width
-
heightNumberScreen height
-
screenBufferUint8_t *Pointer to the screen buffer
-
fontStringPointer to the font map
Returns:
setAddrWindow
-
x0 -
y0 -
x1 -
y1
Sets the window address
Parameters:
-
x0NumberFirst coordinate
-
y0NumberFirst coordinate
-
x1NumberSecond coordinate
-
y1NumberSecond coordinate
drawPixel
-
x -
y -
color
Sends a pixel color (RGB) to the chip. Must be implemented by the inherited class.
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
colorNumberRGB value
refresh
()
Copies the buffer to the chip via the SPI.
drawChar
-
x -
y -
data -
color -
bg -
size
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
dataNumberCharacter to write
-
colorNumberCharacter color
-
bgNumberCharacter background color
-
sizeNumberSize of the font
print
-
msg
Prints a message on the screen
Parameters:
-
msgStringMessage to print
setPixel
-
x -
y -
color
Prints a message on the screen
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
colorNumberPixel color
Returns:
fillScreen
-
color
Fills the screen with a selected color
Parameters:
-
colorNumberSelected color
fillRect
-
x -
y -
w -
h -
color
Fills a rectangle with a selected color
Parameters:
-
xNumberAxis on the horizontal scale (top-left corner)
-
yNumberAxis on the vertical scale (top-left corner)
-
wNumberDistanse from x
-
hNumberDistanse from y
-
colorNumberSelected color
drawFastVLine
-
x -
y -
h -
color
Draws a line on the vertical scale
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
hNumberDistanse from y
-
colorNumberSelected color
drawLine
-
x0 -
y0 -
x1 -
y1 -
color
Draws a line from coordinate C0 to coordinate C1
Parameters:
-
x0NumberFirst coordinate
-
y0NumberFirst coordinate
-
x1NumberSecond coordinate
-
y1NumberSecond coordinate
-
colorNumberselected color
drawTriangle
-
x0 -
y0 -
x1 -
y1 -
x2 -
y2 -
color
Draws a triangle
Parameters:
-
x0NumberFirst coordinate
-
y0NumberFirst coordinate
-
x1NumberSecond coordinate
-
y1NumberSecond coordinate
-
x2NumberThird coordinate
-
y2NumberThird coordinate
-
colorNumberSelected color
drawCircle
-
x -
y -
r -
color
Draws a circle
Parameters:
-
xNumberCenter of the circle on the horizontal scale
-
yNumberCenter of the circle on the vertical scale
-
rNumberRadius of the circle
-
colorNumberColor of the circle
setCursor
-
x -
y
Sets the cursor for a text message
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
setTextColor
-
textColor -
textBGColor
Sets a text color for a message
Parameters:
-
textColorNumberFont color
-
textBGColorNumberBackground color
setTextSize
-
size
Sets the size of the font
Parameters:
-
sizeNumberFont size
setTextWrap
-
wrap
Wraps a printed message
Parameters:
-
wrapNumberTrue (0x1) or false (0x0)
GFX
-
w -
h
Creates a GFX object
Parameters:
-
wNumberScreen width
-
hNumberScreen 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:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawLine
-
x0 -
y0 -
x1 -
y1 -
color
Draw a line.
Parameters:
-
x0NumberStart of line x coordinate
-
y0NumberStart of line y coordinate
-
x1NumberEnd of line x coordinate
-
y1NumberEnd of line y coordinate
-
colorNumberRGB (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:
-
xNumberAxis on the horizontal scale to begin line
-
yNumberAxis on the vertical scale to begin line
-
hNumberHeight of line in pixels
-
colorNumberRGB (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:
-
xNumberAxis on the horizontal scale to begin line
-
yNumberAxis on the vertical scale to begin line
-
wNumberWidth of line in pixels
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawRect
-
x -
y -
w -
h -
color
Draws a rectangle (not filled).
Parameters:
-
xNumberPosition of upper left corner on horizontal axis
-
yNumberPosition of upper left corner on vertical axis
-
wNumberWidth of rectangle
-
hNumberHeight of rectangle RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
-
colorNumberundefined
fillRect
-
x -
y -
w -
h -
color
Draw a filled rectangle.
Parameters:
-
xNumberAxis on the horizontal scale of upper-left corner
-
yNumberAxis on the vertical scale of upper-left corner
-
wNumberWidth of rectangle in pixels
-
hNumberHeight of rectangle in pixels
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillScreen
-
color
Fill the screen with a single color.
Parameters:
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
invertDisplay
-
i
Invert colors on the display.
Parameters:
-
iBooleanTrue or false to invert colors
drawCircle
-
x0 -
y0 -
r -
color
Draw a circle outline.
Parameters:
-
x0NumberCenter point of circle on x-axis
-
y0NumberCenter point of circle on y-axis
-
rNumberRadius of circle
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawCircleHelper
-
x0 -
y0 -
r -
cornername -
color
Used to draw rounded corners.
Parameters:
-
x0NumberCenter point of circle on x-axis
-
y0NumberCenter point of circle on y-axis
-
rNumberRadius of circle
-
cornernameNumberMask of corner number (1, 2, 4, 8)
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
fillCircle
-
x0 -
y0 -
r -
color
Draws a filled circle.
Parameters:
-
x0NumberCenter point of circle on x-axis
-
y0NumberCenter point of circle on y-axis
-
rNumberRadius of circle
-
colorNumberRGB (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:
-
x0NumberCenter point of circle on x-axis
-
y0NumberCenter point of circle on y-axis
-
rNumberRadius of circle
-
cornernameNumberMask of corner number (1, 2, 4, 8)
-
deltaNumberLine offset
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
drawTriangle
-
x0 -
y0 -
x1 -
y1 -
x2 -
y2 -
color
Draw a triangle.
Parameters:
-
x0NumberFirst point coordinate on x-axis
-
y0NumberFirst point coordinate on y-axis
-
x1NumberSecond point coordinate on x-axis
-
y1NumberSecond point coordinate on y-axis
-
x2NumberThird point coordinate on x-axis
-
y2NumberThird point coordinate on y-axis
-
colorNumberRGB (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:
-
x0NumberFirst point coordinate on x-axis
-
y0NumberFirst point coordinate on y-axis
-
x1NumberSecond point coordinate on x-axis
-
y1NumberSecond point coordinate on y-axis
-
x2NumberThird point coordinate on x-axis
-
y2NumberThird point coordinate on y-axis
-
colorNumberRGB (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:
-
x0NumberX-axis coordinate of top-left corner
-
y0NumberY-axis coordinate of top-left corner
-
wNumberWidth of rectangle
-
hNumberheight of rectangle
-
radiusNumberRadius of rounded corners
-
colorNumberRGB (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:
-
x0NumberX-axis coordinate of top-left corner
-
y0NumberY-axis coordinate of top-left corner
-
wNumberWidth of rectangle
-
hNumberheight of rectangle
-
radiusNumberRadius of rounded corners
-
colorNumberRGB (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:
-
xNumberX-axis coordinate of the top-left corner
-
yNumberY-axis coordinate of the top-left corner
-
cStringCharacter to draw
-
colorNumberRGB (16-bit) color (R[0-4], G[5-10], B[11-15]
-
bgNumberBackground color (16-bit RGB)
-
sizeNumberFont 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:
-
xNumberX-axis coordinate of the top-left corner of the cursor
-
yNumberY-axis coordinate of the top-left corner of the cursor
setTextColor
-
c
Set the color for text.
Parameters:
-
cNumberRGB (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:
-
cNumberText color (RGB, 16-bit)
-
bgNumberBackground text color (RGB, 16-bit)
setTextSize
-
s
Set the size of the text.
Parameters:
-
sNumberFont size (multiples of 8 pixel text height)
setTextWrap
-
w
Enable or disable text wrapping.
Parameters:
-
wBooleanTrue 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:
-
rNumberRotation 0-3
cp437
-
x
Enable (or disable) Code Page 437-compatible charset.
Parameters:
-
xBooleanTrue 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:
-
cNumberCharacter to draw
print
-
msg
Prints a string to the screen.
Parameters:
-
msgStringMessage 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:
-
widthNumberScreen width
-
heightNumberScreen height
Returns:
drawPixel
-
x -
y -
color
Sends a pixel color (RGB) to the chip. Must be implemented by the inherited class.
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
colorNumberRGB value
refresh
()
Copies the buffer to the chip via the SPI.
drawChar
-
x -
y -
data -
color -
bg -
size
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
dataNumberCharacter to write
-
colorNumberCharacter color
-
bgNumberCharacter background color
-
sizeNumberSize of the font
print
-
msg
Prints a message on the screen
Parameters:
-
msgStringMessage to print
fillScreen
-
color
Fills the screen with a selected color
Parameters:
-
colorNumberSelected color
fillRect
-
x -
y -
w -
h -
color
Fills a rectangle with a selected color
Parameters:
-
xNumberAxis on the horizontal scale (top-left corner)
-
yNumberAxis on the vertical scale (top-left corner)
-
wNumberDistanse from x
-
hNumberDistanse from y
-
colorNumberSelected color
drawFastVLine
-
x -
y -
h -
color
Draws a line on the vertical scale
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
hNumberDistanse from y
-
colorNumberSelected color
drawLine
-
x0 -
y0 -
x1 -
y1 -
color
Draws a line from coordinate C0 to coordinate C1
Parameters:
-
x0NumberFirst coordinate
-
y0NumberFirst coordinate
-
x1NumberSecond coordinate
-
y1NumberSecond coordinate
-
colorNumberselected color
drawTriangle
-
x0 -
y0 -
x1 -
y1 -
x2 -
y2 -
color
Draws a triangle
Parameters:
-
x0NumberFirst coordinate
-
y0NumberFirst coordinate
-
x1NumberSecond coordinate
-
y1NumberSecond coordinate
-
x2NumberThird coordinate
-
y2NumberThird coordinate
-
colorNumberSelected color
drawCircle
-
x -
y -
r -
color
Draws a circle
Parameters:
-
xNumberCenter of the circle on the horizontal scale
-
yNumberCenter of the circle on the vertical scale
-
rNumberRadius of the circle
-
colorNumberColor of the circle
setCursor
-
x -
y
Sets the cursor for a text message
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
setTextColor
-
textColor -
textBGColor
Sets a text color for a message
Parameters:
-
textColorNumberFont color
-
textBGColorNumberBackground color
setTextSize
-
size
Sets the size of the font
Parameters:
-
sizeNumberFont size
setTextWrap
-
wrap
Wraps a printed message
Parameters:
-
wrapNumberTrue (0x1) or false (0x0)
GFX
-
width -
height -
screenBuffer -
font
Instantiates a GFX object
Parameters:
-
widthNumberScreen width
-
heightNumberScreen height
-
screenBufferUint8_t *Pointer to the screen buffer
-
fontStringPointer to the font map
Returns:
setAddrWindow
-
x0 -
y0 -
x1 -
y1
Sets the window address
Parameters:
-
x0NumberFirst coordinate
-
y0NumberFirst coordinate
-
x1NumberSecond coordinate
-
y1NumberSecond coordinate
drawPixel
-
x -
y -
color
Sends a pixel color (RGB) to the chip. Must be implemented by the inherited class.
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
colorNumberRGB value
refresh
()
Copies the buffer to the chip via the SPI.
drawChar
-
x -
y -
data -
color -
bg -
size
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
dataNumberCharacter to write
-
colorNumberCharacter color
-
bgNumberCharacter background color
-
sizeNumberSize of the font
print
-
msg
Prints a message on the screen
Parameters:
-
msgStringMessage to print
setPixel
-
x -
y -
color
Prints a message on the screen
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
colorNumberPixel color
Returns:
fillScreen
-
color
Fills the screen with a selected color
Parameters:
-
colorNumberSelected color
fillRect
-
x -
y -
w -
h -
color
Fills a rectangle with a selected color
Parameters:
-
xNumberAxis on the horizontal scale (top-left corner)
-
yNumberAxis on the vertical scale (top-left corner)
-
wNumberDistanse from x
-
hNumberDistanse from y
-
colorNumberSelected color
drawFastVLine
-
x -
y -
h -
color
Draws a line on the vertical scale
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
-
hNumberDistanse from y
-
colorNumberSelected color
drawLine
-
x0 -
y0 -
x1 -
y1 -
color
Draws a line from coordinate C0 to coordinate C1
Parameters:
-
x0NumberFirst coordinate
-
y0NumberFirst coordinate
-
x1NumberSecond coordinate
-
y1NumberSecond coordinate
-
colorNumberselected color
drawTriangle
-
x0 -
y0 -
x1 -
y1 -
x2 -
y2 -
color
Draws a triangle
Parameters:
-
x0NumberFirst coordinate
-
y0NumberFirst coordinate
-
x1NumberSecond coordinate
-
y1NumberSecond coordinate
-
x2NumberThird coordinate
-
y2NumberThird coordinate
-
colorNumberSelected color
drawCircle
-
x -
y -
r -
color
Draws a circle
Parameters:
-
xNumberCenter of the circle on the horizontal scale
-
yNumberCenter of the circle on the vertical scale
-
rNumberRadius of the circle
-
colorNumberColor of the circle
setCursor
-
x -
y
Sets the cursor for a text message
Parameters:
-
xNumberAxis on the horizontal scale
-
yNumberAxis on the vertical scale
setTextColor
-
textColor -
textBGColor
Sets a text color for a message
Parameters:
-
textColorNumberFont color
-
textBGColorNumberBackground color
setTextSize
-
size
Sets the size of the font
Parameters:
-
sizeNumberFont size
setTextWrap
-
wrap
Wraps a printed message
Parameters:
-
wrapNumberTrue (0x1) or false (0x0)
Properties
m_map
Uint8_t *
Screens buffer
m_map
Uint8_t *
Screens buffer
m_map
Uint8_t *
Screens buffer