WPI ECE 2049 STM32 Adafruit TFT 1.8" Shield
Loading...
Searching...
No Matches
Adafruit_ST7735_API.h File Reference
#include "stdint.h"
#include "stm32h5xx_hal.h"
#include "stdbool.h"
#include "Adafruit_ST7735_Macros.h"
#include "Adafruit_ST77xx_Macros.h"
#include "gfxfont.h"
#include "stm32h5xx_hal_spi.h"

Go to the source code of this file.

Typedefs

typedef struct ST7735_Handle ST7735_Handle
 Internal handle used to store the instance of an Adafruit_ST7735 class for use in the C API functions. This struct is not intended to be used outside of this API and should be treated as an opaque handle. Provides a C compatible structure to store the C++ class instance for the ST7735 display.

Functions

void Display_create (SPI_HandleTypeDef *spi_handle, int16_t cs, GPIO_TypeDef *cs_port, int16_t dc, GPIO_TypeDef *dc_port)
 Function used to create the instance for the display's graphics.
void Display_init (uint8_t options)
 Function used to initialize the display using the given options.
void Display_setRotation (uint8_t m)
 Function to change rotation of display.
void Display_setAddrWindow (uint16_t x, uint16_t y, uint16_t w, uint16_t h)
 Sets the address windows that the display expects to receive data in from another function call. Typically not used as singleton.
void Display_enableDisplay (bool enable)
 Turns the display on or off.
void Display_enableTearing (bool enable)
 Enables a display tearing correction pin. Unused on the TFT 1.8" display.
void Display_enableSleep (bool enable)
 Enables whether the display should be able to enter sleep mode when given a command. Not typically used.
void Display_drawPixel (int16_t x, int16_t y, uint16_t color)
 Draws a single pixel with a color to the display. Singleton function that automatically calls setAddrWindow.
void Display_fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
 Fills a rectangle on the display with a color. Singleton function that automatically calls setAddrWindow.
void Display_drawFastHLine (int16_t x, int16_t y, int16_t w, uint16_t color)
 Optimized horizontal line drawing function. Singleton function that automatically calls setAddrWindow.
void Display_drawFastVLine (int16_t x, int16_t y, int16_t h, uint16_t color)
 Optimized vertical line drawing function. Singleton function that automatically calls setAddrWindow.
void Display_invertDisplay (bool i)
 Function to invert the display colors. Singleton function that automatically calls setAddrWindow.
uint16_t Display_color565 (uint8_t r, uint8_t g, uint8_t b)
 Converts 8-bit R, G, and B values into a single 16-bit value in 565 RGB format.
void Display_drawRGBBitmap (int16_t x, int16_t y, uint16_t *pcolors, int16_t w, int16_t h)
 Function to draw an RGB bitmap to the display. Singleton function that automatically calls setAddrWindow.
void Display_drawRGBBitmapMask (int16_t x, int16_t y, uint16_t *pcolors, int16_t w, int16_t h, uint8_t *mask)
 Function to draw an RGB bitmap to the display with an optional mask. Singleton function that automatically calls setAddrWindow.
void Display_fillScreen (uint16_t color)
 Function to fill the entire screen with a single color. Singleton function that automatically calls setAddrWindow.
void Display_drawLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color)
 Function to draw a line between two points. Singleton function that automatically calls setAddrWindow.
void Display_drawRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
 Function to draw a non-filled rectangle. Singleton function that automatically calls setAddrWindow.
void Display_drawCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color)
 Function to draw a non-filled circle. Singleton function that automatically calls setAddrWindow.
void Display_drawCircleHelper (int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint16_t color)
 Function to draw a circle that you can choose the corner to draw. Singleton function that automatically calls setAddrWindow.
void Display_fillCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color)
 Function to draw a filled circle. Singleton function that automatically calls setAddrWindow.
void Display_fillCircleHelper (int16_t x0, int16_t y0, int16_t r, uint8_t cornername, int16_t delta, uint16_t color)
 Function to draw a filled circle that you can choose the corner to draw. Singleton function that automatically calls setAddrWindow.
void Display_drawEllipse (int16_t x0, int16_t y0, int16_t rw, int16_t rh, uint16_t color)
 Function to draw a non-filled ellipse. Singleton function that automatically calls setAddrWindow.
void Display_fillEllipse (int16_t x0, int16_t y0, int16_t rw, int16_t rh, uint16_t color)
 Function to draw a filled ellipse. Singleton function that automatically calls setAddrWindow.
void Display_drawTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
 Function to draw a non-filled triangle. Singleton function that automatically calls setAddrWindow.
void Display_fillTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
 Function to draw a filled triangle. Singleton function that automatically calls setAddrWindow.
void Display_drawRoundRect (int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color)
 Draws a rounded non-filled rectangle. Singleton function that automatically calls setAddrWindow.
void Display_fillRoundRect (int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color)
 Draws a filled rounded rectangle. Singleton function that automatically calls setAddrWindow.
void Display_drawBitmap (int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color)
 Draws a monochrome bitmap to the display. Singleton function that automatically calls setAddrWindow.
void Display_drawBitmapBg (int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg)
 Draws a monochrome bitmap with a background color to the display. Singleton function that automatically calls setAddrWindow.
void Display_drawXBitmap (int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color)
 Draws an XBM format bitmap exported from GIMP to the display. Singleton function that automatically calls setAddrWindow.
void Display_drawXBitmapBg (int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg)
 Draws an XBM format bitmap exported from GIMP to the display with a background color. Singleton function that automatically calls setAddrWindow.
void Display_drawGrayscaleBitmap (int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h)
 Draws a grayscale bitmap to the display. Singleton function that automatically calls setAddrWindow.
void Display_drawGrayscaleBitmapMask (int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint8_t *mask)
 Draws a grayscale bitmap with a mask to the display. Singleton function that automatically calls setAddrWindow.
void Display_drawChar (int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size_x, uint8_t size_y)
 Draws a character to the display. Singleton function that automatically calls setAddrWindow.
void Display_getTextBounds (const char *string, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h)
 Gets the bounding box of a string of text. Used to determine how much space a string of text will take up on the display. Singleton function that does not call setAddrWindow.
void Display_setTextSize (uint8_t sx, uint8_t sy)
 Function to set the text size for the display.
void Display_setFont (const GFXfont *f)
 Function to set the font for the display.
void Display_setCursor (int16_t x, int16_t y)
 Sets the cursor position for the display. The cursor is used as the starting point for drawing text. Singleton function that does not call setAddrWindow.
void Display_setTextColor (uint16_t c)
 Sets the color used to draw text on the display.
void Display_setTextColorWithBg (uint16_t c, uint16_t bg)
 Sets the text color and background color behind the characters.
void Display_setTextWrap (bool w)
 Sets whether text should wrap when it reaches the edge of the display.
void Display_cp437 (bool x)
 Sets whether to use the CP437 character set. If false, will use standard ASCII. If true, will use CP437 which has some additional characters in the 128-255 range. Singleton function that does not call setAddrWindow.
int16_t Display_width ()
 Get the width of the initialized display. Adjusts based on the current rotation of the display.
int16_t Display_height ()
 Get the height of the initialized display. Adjusts based on the current rotation of the display.
uint8_t Display_getRotation ()
 Get the current rotation of the display.
int16_t Display_getCursorX ()
 Gets the current x coord of the display's cursor.
int16_t Display_getCursorY ()
 Gets the current y coord of the display's cursor.
void Display_print (const char *str)
 Print a string of text to the display.
void Display_println (const char *str)
 Print a string of text to the display followed by a newline.

Typedef Documentation

◆ ST7735_Handle

typedef struct ST7735_Handle ST7735_Handle

Internal handle used to store the instance of an Adafruit_ST7735 class for use in the C API functions. This struct is not intended to be used outside of this API and should be treated as an opaque handle. Provides a C compatible structure to store the C++ class instance for the ST7735 display.

Function Documentation

◆ Display_color565()

uint16_t Display_color565 ( uint8_t r,
uint8_t g,
uint8_t b )

Converts 8-bit R, G, and B values into a single 16-bit value in 565 RGB format.

Parameters
r8-bit red value
g8-bit green value
b8-bit blue value
Returns
uint16_t 16-bit color value in 565 RGB format

◆ Display_cp437()

void Display_cp437 ( bool x)

Sets whether to use the CP437 character set. If false, will use standard ASCII. If true, will use CP437 which has some additional characters in the 128-255 range. Singleton function that does not call setAddrWindow.

Parameters
xtrue to enable CP437 character set, false to use standard ASCII

◆ Display_create()

void Display_create ( SPI_HandleTypeDef * spi_handle,
int16_t cs,
GPIO_TypeDef * cs_port,
int16_t dc,
GPIO_TypeDef * dc_port )

Function used to create the instance for the display's graphics.

Parameters
spi_handleThe handle for the STM32 hardware spi instance that has been set up for the TFT display
csThe pin number for the TFT display's CS pin. Will come from a macro with the pin label generated by STM32CubeMX
cs_portThe STM32 GPIO port for the TFT display's CS pin. Predefined macro for the GPIO port associated with the CS pin
dcThe pin number for the TFT display's DC pin. Will come from a macro with the pin label generated by STM32CubeMX
dc_portThe STM32 GPIO port for the TFT display's DC pin. Predefined macro for the GPIO port associated with the DC pin

◆ Display_drawBitmap()

void Display_drawBitmap ( int16_t x,
int16_t y,
uint8_t * bitmap,
int16_t w,
int16_t h,
uint16_t color )

Draws a monochrome bitmap to the display. Singleton function that automatically calls setAddrWindow.

Parameters
xTop-left corner x coord of the bitmap
yTop-left corner y coord of the bitmap
bitmapPointer to the bitmap data
wWidth of the bitmap
hHeight of the bitmap
colorColor to draw the bitmap

◆ Display_drawBitmapBg()

void Display_drawBitmapBg ( int16_t x,
int16_t y,
uint8_t * bitmap,
int16_t w,
int16_t h,
uint16_t color,
uint16_t bg )

Draws a monochrome bitmap with a background color to the display. Singleton function that automatically calls setAddrWindow.

Parameters
xTop-left corner x coord of the bitmap
yTop-left corner y coord of the bitmap
bitmapPointer to the bitmap data
wWidth of the bitmap
hHeight of the bitmap
colorColor to draw the bitmap
bgBackground color of the bitmap

◆ Display_drawChar()

void Display_drawChar ( int16_t x,
int16_t y,
unsigned char c,
uint16_t color,
uint16_t bg,
uint8_t size_x,
uint8_t size_y )

Draws a character to the display. Singleton function that automatically calls setAddrWindow.

Parameters
xTop-left corner x coord of the character
yTop-left corner y coord of the character
cCharacter to draw
colorColor of the character
bgBackground color of the character
size_xHorizontal scaling factor
size_yVertical scaling factor

◆ Display_drawCircle()

void Display_drawCircle ( int16_t x0,
int16_t y0,
int16_t r,
uint16_t color )

Function to draw a non-filled circle. Singleton function that automatically calls setAddrWindow.

Parameters
x0Center x coord of the circle
y0Center y coord of the circle
rRadius of the circle
colorColor of the circle

◆ Display_drawCircleHelper()

void Display_drawCircleHelper ( int16_t x0,
int16_t y0,
int16_t r,
uint8_t cornername,
uint16_t color )

Function to draw a circle that you can choose the corner to draw. Singleton function that automatically calls setAddrWindow.

Parameters
x0Center x coord of the circle
y0Center y coord of the circle
rRadius of the circle
cornernameCorner of the circle to draw. Mask bit #1, #2, #4, and #8 to indicate which quarters of the circle should be drawn
colorColor of the circle

◆ Display_drawEllipse()

void Display_drawEllipse ( int16_t x0,
int16_t y0,
int16_t rw,
int16_t rh,
uint16_t color )

Function to draw a non-filled ellipse. Singleton function that automatically calls setAddrWindow.

Parameters
x0Center x coord of the ellipse
y0Center y coord of the ellipse
rwRadius along the x-axis
rhRadius along the y-axis
colorColor of the ellipse

◆ Display_drawFastHLine()

void Display_drawFastHLine ( int16_t x,
int16_t y,
int16_t w,
uint16_t color )

Optimized horizontal line drawing function. Singleton function that automatically calls setAddrWindow.

Parameters
xStarting x coord for the line
yThe y coord to draw the line on
wThe width of the line
colorColor to draw the line in

◆ Display_drawFastVLine()

void Display_drawFastVLine ( int16_t x,
int16_t y,
int16_t h,
uint16_t color )

Optimized vertical line drawing function. Singleton function that automatically calls setAddrWindow.

Parameters
xX coord to draw the line on
yStarting y coord for the line
hHeight of the line
colorColor to draw the line in

◆ Display_drawGrayscaleBitmap()

void Display_drawGrayscaleBitmap ( int16_t x,
int16_t y,
uint8_t * bitmap,
int16_t w,
int16_t h )

Draws a grayscale bitmap to the display. Singleton function that automatically calls setAddrWindow.

Parameters
xTop-left corner x coord of the bitmap
yTop-left corner y coord of the bitmap
bitmapPointer to the bitmap data
wWidth of the bitmap
hHeight of the bitmap

◆ Display_drawGrayscaleBitmapMask()

void Display_drawGrayscaleBitmapMask ( int16_t x,
int16_t y,
uint8_t * bitmap,
int16_t w,
int16_t h,
uint8_t * mask )

Draws a grayscale bitmap with a mask to the display. Singleton function that automatically calls setAddrWindow.

Parameters
xTop-left corner x coord of the bitmap
yTop-left corner y coord of the bitmap
bitmapPointer to the bitmap data
wWidth of the bitmap
hHeight of the bitmap
maskPointer to the mask data (1=bit mask where 1 is set and 0 is clear)

◆ Display_drawLine()

void Display_drawLine ( int16_t x0,
int16_t y0,
int16_t x1,
int16_t y1,
uint16_t color )

Function to draw a line between two points. Singleton function that automatically calls setAddrWindow.

Parameters
x0Starting x coord of the line
y0Starting y coord of the line
x1Ending x coord of the line
y1Ending y coord of the line
colorColor of the line

◆ Display_drawPixel()

void Display_drawPixel ( int16_t x,
int16_t y,
uint16_t color )

Draws a single pixel with a color to the display. Singleton function that automatically calls setAddrWindow.

Parameters
xX coord of the pixel
yY coord of the pixel
colorColor to set the pixel

◆ Display_drawRect()

void Display_drawRect ( int16_t x,
int16_t y,
int16_t w,
int16_t h,
uint16_t color )

Function to draw a non-filled rectangle. Singleton function that automatically calls setAddrWindow.

Parameters
xStarting x coord of the rectangle
yStarting y coord of the rectangle
wWidth of the rectangle
hHeight of the rectangle
colorColor of the rectangle

◆ Display_drawRGBBitmap()

void Display_drawRGBBitmap ( int16_t x,
int16_t y,
uint16_t * pcolors,
int16_t w,
int16_t h )

Function to draw an RGB bitmap to the display. Singleton function that automatically calls setAddrWindow.

Parameters
xStarting x coord to draw the bitmap at the top left corner
yStarting y coord to draw the bitmap at the top left corner
pcolorsPointer to the bitmap data in an array of 16-bit color values in 565 RGB format
wWidth of the bitmap
hHeight of the bitmap

◆ Display_drawRGBBitmapMask()

void Display_drawRGBBitmapMask ( int16_t x,
int16_t y,
uint16_t * pcolors,
int16_t w,
int16_t h,
uint8_t * mask )

Function to draw an RGB bitmap to the display with an optional mask. Singleton function that automatically calls setAddrWindow.

Parameters
xStarting x coord to draw the bitmap at the top left corner
yStarting y coord to draw the bitmap at the top left corner
pcolorsPointer to the bitmap data in an array of 16-bit color values in 565 RGB format
wWidth of the bitmap
hHeight of the bitmap
maskPointer to the mask data in an array of 8-bit values

◆ Display_drawRoundRect()

void Display_drawRoundRect ( int16_t x0,
int16_t y0,
int16_t w,
int16_t h,
int16_t radius,
uint16_t color )

Draws a rounded non-filled rectangle. Singleton function that automatically calls setAddrWindow.

Parameters
x0Top-left corner x coord of the rectangle
y0Top-left corner y coord of the rectangle
wWidth of the rectangle
hHeight of the rectangle
radiusRadius of the rounded corners
colorColor of the rectangle

◆ Display_drawTriangle()

void Display_drawTriangle ( int16_t x0,
int16_t y0,
int16_t x1,
int16_t y1,
int16_t x2,
int16_t y2,
uint16_t color )

Function to draw a non-filled triangle. Singleton function that automatically calls setAddrWindow.

Parameters
x0First vertex x coord of the triangle
y0First vertex y coord of the triangle
x1Second vertex x coord of the triangle
y1Second vertex y coord of the triangle
x2Third vertex x coord of the triangle
y2Third vertex y coord of the triangle
colorColor of the triangle

◆ Display_drawXBitmap()

void Display_drawXBitmap ( int16_t x,
int16_t y,
uint8_t * bitmap,
int16_t w,
int16_t h,
uint16_t color )

Draws an XBM format bitmap exported from GIMP to the display. Singleton function that automatically calls setAddrWindow.

Parameters
xTop-left corner x coord of the bitmap
yTop-left corner y coord of the bitmap
bitmapPointer to the bitmap data
wWidth of the bitmap
hHeight of the bitmap
colorColor to draw the bitmap

◆ Display_drawXBitmapBg()

void Display_drawXBitmapBg ( int16_t x,
int16_t y,
uint8_t * bitmap,
int16_t w,
int16_t h,
uint16_t color,
uint16_t bg )

Draws an XBM format bitmap exported from GIMP to the display with a background color. Singleton function that automatically calls setAddrWindow.

Parameters
xTop-left corner x coord of the bitmap
yTop-left corner y coord of the bitmap
bitmapPointer to the bitmap data
wWidth of the bitmap
hHeight of the bitmap
colorColor to draw the bitmap
bgBackground color of the bitmap

◆ Display_enableDisplay()

void Display_enableDisplay ( bool enable)

Turns the display on or off.

Parameters
enableTrue turns the display on, false turns the display off

◆ Display_enableSleep()

void Display_enableSleep ( bool enable)

Enables whether the display should be able to enter sleep mode when given a command. Not typically used.

Parameters
enableTrue enables sleeping, flase disables sleeping

◆ Display_enableTearing()

void Display_enableTearing ( bool enable)

Enables a display tearing correction pin. Unused on the TFT 1.8" display.

Parameters
enableTrue turns enables tearing correct, false disables tearing correction

◆ Display_fillCircle()

void Display_fillCircle ( int16_t x0,
int16_t y0,
int16_t r,
uint16_t color )

Function to draw a filled circle. Singleton function that automatically calls setAddrWindow.

Parameters
x0Center x coord of the circle
y0Center y coord of the circle
rRadius of the circle
colorColor of the circle

◆ Display_fillCircleHelper()

void Display_fillCircleHelper ( int16_t x0,
int16_t y0,
int16_t r,
uint8_t cornername,
int16_t delta,
uint16_t color )

Function to draw a filled circle that you can choose the corner to draw. Singleton function that automatically calls setAddrWindow.

Parameters
x0Center x coord of the circle
y0Center y coord of the circle
rRadius of the circle
cornernameCorner of the circle to draw. Mask bit #1, #2, #4, and #8 to indicate which quarters of the circle should be drawn
deltaOffset from the circle's radius
colorColor of the circle

◆ Display_fillEllipse()

void Display_fillEllipse ( int16_t x0,
int16_t y0,
int16_t rw,
int16_t rh,
uint16_t color )

Function to draw a filled ellipse. Singleton function that automatically calls setAddrWindow.

Parameters
x0Center x coord of the ellipse
y0Center y coord of the ellipse
rwRadius along the x-axis
rhRadius along the y-axis
colorColor of the ellipse

◆ Display_fillRect()

void Display_fillRect ( int16_t x,
int16_t y,
int16_t w,
int16_t h,
uint16_t color )

Fills a rectangle on the display with a color. Singleton function that automatically calls setAddrWindow.

Parameters
xX coord of the top left corner of the rectangle
yY coord of the top left corner of the rectangle
wWidth of the rectangle
hHeight of the rectangle
colorColor to fill the rectangle with. In the (565) bit RGB format

◆ Display_fillRoundRect()

void Display_fillRoundRect ( int16_t x0,
int16_t y0,
int16_t w,
int16_t h,
int16_t radius,
uint16_t color )

Draws a filled rounded rectangle. Singleton function that automatically calls setAddrWindow.

Parameters
x0Top-left corner x coord of the rectangle
y0Top-left corner y coord of the rectangle
wWidth of the rectangle
hHeight of the rectangle
radiusRadius of the rounded corners
colorColor of the rectangle

◆ Display_fillScreen()

void Display_fillScreen ( uint16_t color)

Function to fill the entire screen with a single color. Singleton function that automatically calls setAddrWindow.

Parameters
colorColor to fill the screen with

◆ Display_fillTriangle()

void Display_fillTriangle ( int16_t x0,
int16_t y0,
int16_t x1,
int16_t y1,
int16_t x2,
int16_t y2,
uint16_t color )

Function to draw a filled triangle. Singleton function that automatically calls setAddrWindow.

Parameters
x0First vertex x coord of the triangle
y0First vertex y coord of the triangle
x1Second vertex x coord of the triangle
y1Second vertex y coord of the triangle
x2Third vertex x coord of the triangle
y2Third vertex y coord of the triangle
colorColor of the triangle

◆ Display_getCursorX()

int16_t Display_getCursorX ( )

Gets the current x coord of the display's cursor.

Returns
int16_t the current x coord of the display's cursor

◆ Display_getCursorY()

int16_t Display_getCursorY ( )

Gets the current y coord of the display's cursor.

Returns
int16_t the current y coord of the display's cursor

◆ Display_getRotation()

uint8_t Display_getRotation ( )

Get the current rotation of the display.

Returns
uint8_t rotation of display (0-3 corresponding to 0, 90, 180, and 270 degrees)

◆ Display_getTextBounds()

void Display_getTextBounds ( const char * string,
int16_t x,
int16_t y,
int16_t * x1,
int16_t * y1,
uint16_t * w,
uint16_t * h )

Gets the bounding box of a string of text. Used to determine how much space a string of text will take up on the display. Singleton function that does not call setAddrWindow.

Parameters
stringPointer to the string of text
xTop-left corner x coord of the text
yTop-left corner y coord of the text
x1Pointer to store the top-left corner x coord of the bounding box
y1Pointer to store the top-left corner y coord of the bounding box
wPointer to store the width of the bounding box
hPointer to store the height of the bounding box

◆ Display_height()

int16_t Display_height ( )

Get the height of the initialized display. Adjusts based on the current rotation of the display.

Returns
int16_t height of display

◆ Display_init()

void Display_init ( uint8_t options)

Function used to initialize the display using the given options.

Parameters
optionsOne of the preset Adafruit INITR intialization options presets. Can be found in Adafruit_ST7735_Macros.h

◆ Display_invertDisplay()

void Display_invertDisplay ( bool i)

Function to invert the display colors. Singleton function that automatically calls setAddrWindow.

Parameters
iTrue inverts the display, false sets the display to normal colors

◆ Display_print()

void Display_print ( const char * str)

Print a string of text to the display.

Parameters
strPointer to the string of text to print

◆ Display_println()

void Display_println ( const char * str)

Print a string of text to the display followed by a newline.

Parameters
strPointer to the string of text to print

◆ Display_setAddrWindow()

void Display_setAddrWindow ( uint16_t x,
uint16_t y,
uint16_t w,
uint16_t h )

Sets the address windows that the display expects to receive data in from another function call. Typically not used as singleton.

Parameters
xStarting x pixel
yStarting y pixel
wWidth of window
hHeight of window

◆ Display_setCursor()

void Display_setCursor ( int16_t x,
int16_t y )

Sets the cursor position for the display. The cursor is used as the starting point for drawing text. Singleton function that does not call setAddrWindow.

Parameters
xx coord of the cursor
yy coord of the cursor

◆ Display_setFont()

void Display_setFont ( const GFXfont * f)

Function to set the font for the display.

Parameters
fPointer to the font to set. Fonts are defined in header files stored in Core/Inc/graphics/Fonts.

◆ Display_setRotation()

void Display_setRotation ( uint8_t m)

Function to change rotation of display.

Parameters
mHow many 90 degree turns to apply to the display. 0 is no change, 1 rotates clockwise by 90 degrees, 2 clockwise 180 degrees, and 3 clockwise 270 degrees

◆ Display_setTextColor()

void Display_setTextColor ( uint16_t c)

Sets the color used to draw text on the display.

Parameters
cColor to set the text to

◆ Display_setTextColorWithBg()

void Display_setTextColorWithBg ( uint16_t c,
uint16_t bg )

Sets the text color and background color behind the characters.

Parameters
cColor to draw the text in
bgColor to draw behind the text

◆ Display_setTextSize()

void Display_setTextSize ( uint8_t sx,
uint8_t sy )

Function to set the text size for the display.

Parameters
sxHorizontal size
syVertical size

◆ Display_setTextWrap()

void Display_setTextWrap ( bool w)

Sets whether text should wrap when it reaches the edge of the display.

Parameters
wtrue to enable text wrapping, false to clip text at the edge of the display

◆ Display_width()

int16_t Display_width ( )

Get the width of the initialized display. Adjusts based on the current rotation of the display.

Returns
int16_t width of display