|
F439_CPP_SPI_RA8875_TFT_LCD_03 1.0
STM32F439 SPI RA8875 7-inch TFT display demo built on the STM32_GFX and STM32_RA8875 libraries
|
A GFX 1-bit canvas context for graphics. More...
#include <Adafruit_GFX.h>
Public Member Functions | |
| GFXcanvas1 (uint16_t w, uint16_t h, bool allocate_buffer=true) | |
| Instatiate a GFX 1-bit canvas context for graphics. | |
| ~GFXcanvas1 (void) | |
| Delete the canvas, free memory. | |
| void | drawPixel (int16_t x, int16_t y, uint16_t color) |
| Draw a pixel to the canvas framebuffer. | |
| void | fillScreen (uint16_t color) |
| Fill the framebuffer completely with one color. | |
| void | drawFastVLine (int16_t x, int16_t y, int16_t h, uint16_t color) |
| Speed optimized vertical line drawing. | |
| void | drawFastHLine (int16_t x, int16_t y, int16_t w, uint16_t color) |
| Speed optimized horizontal line drawing. | |
| bool | getPixel (int16_t x, int16_t y) const |
| Get the pixel color value at a given coordinate. | |
| uint8_t * | getBuffer (void) const |
| Get a pointer to the internal buffer memory. | |
Public Member Functions inherited from Adafruit_GFX | |
| Adafruit_GFX (int16_t w, int16_t h) | |
| Instatiate a GFX context for graphics! Can only be done by a superclass. | |
| virtual void | startWrite (void) |
| Start a display-writing routine, overwrite in subclasses. | |
| virtual void | writePixel (int16_t x, int16_t y, uint16_t color) |
| Write a pixel, overwrite in subclasses if startWrite is defined! | |
| virtual void | writeFillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) |
| Write a rectangle completely with one color, overwrite in subclasses if startWrite is defined! | |
| virtual void | writeFastVLine (int16_t x, int16_t y, int16_t h, uint16_t color) |
| Write a perfectly vertical line, overwrite in subclasses if startWrite is defined! | |
| virtual void | writeFastHLine (int16_t x, int16_t y, int16_t w, uint16_t color) |
| Write a perfectly horizontal line, overwrite in subclasses if startWrite is defined! | |
| virtual void | writeLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) |
| Write a line. Bresenham's algorithm - thx wikpedia. | |
| virtual void | endWrite (void) |
| End a display-writing routine, overwrite in subclasses if startWrite is defined! | |
| virtual void | setRotation (uint8_t r) |
| Set rotation setting for display. | |
| virtual void | invertDisplay (bool i) |
| Invert the display (ideally using built-in hardware command) | |
| virtual void | fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) |
| Fill a rectangle completely with one color. Update in subclasses if desired! | |
| virtual void | drawLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) |
| Draw a line. | |
| virtual void | drawRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) |
| Draw a rectangle with no fill color. | |
| void | drawCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color) |
| Draw a circle outline. | |
| void | drawCircleHelper (int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint16_t color) |
| Quarter-circle drawer, used to do circles and roundrects. | |
| void | fillCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color) |
| Draw a circle with filled color. | |
| void | fillCircleHelper (int16_t x0, int16_t y0, int16_t r, uint8_t cornername, int16_t delta, uint16_t color) |
| Half-circle drawer with fill, used for circles and roundrects. | |
| void | drawEllipse (int16_t x0, int16_t y0, int16_t rw, int16_t rh, uint16_t color) |
| Draw an ellipse outline. | |
| void | fillEllipse (int16_t x0, int16_t y0, int16_t rw, int16_t rh, uint16_t color) |
| Draw an ellipse with filled colour. | |
| void | drawTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color) |
| Draw a triangle with no fill color. | |
| void | fillTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color) |
| Draw a triangle with color-fill. | |
| void | drawRoundRect (int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color) |
| Draw a rounded rectangle with no fill color. | |
| void | fillRoundRect (int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color) |
| Draw a rounded rectangle with fill color. | |
| void | drawRotatedRect (int16_t cenX, int16_t cenY, int16_t w, int16_t h, int16_t angleDeg, uint16_t color) |
| Draw a rotated rectangle. | |
| void | fillRotatedRect (int16_t cenX, int16_t cenY, int16_t w, int16_t h, int16_t angleDeg, uint16_t color) |
| Draw a filled rotated rectangle. | |
| void | rotatePoint (int16_t &x0, int16_t &y0, int16_t angleDeg) |
| Rotate a point in standard position. | |
| void | drawBitmap (int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color) |
| Draw a PROGMEM-resident 1-bit image at the specified (x,y) position, using the specified foreground color (unset bits are transparent). | |
| void | drawBitmap (int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color, uint16_t bg) |
| Draw a PROGMEM-resident 1-bit image at the specified (x,y) position, using the specified foreground (for set bits) and background (unset bits) colors. | |
| void | drawBitmap (int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color) |
| Draw a RAM-resident 1-bit image at the specified (x,y) position, using the specified foreground color (unset bits are transparent). | |
| void | drawBitmap (int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg) |
| Draw a RAM-resident 1-bit image at the specified (x,y) position, using the specified foreground (for set bits) and background (unset bits) colors. | |
| void | drawXBitmap (int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color) |
| Draw PROGMEM-resident XBitMap Files (*.xbm), exported from GIMP. Usage: Export from GIMP to *.xbm, rename *.xbm to *.c and open in editor. C Array can be directly used with this function. There is no RAM-resident version of this function; if generating bitmaps in RAM, use the format defined by drawBitmap() and call that instead. | |
| void | drawGrayscaleBitmap (int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h) |
| Draw a PROGMEM-resident 8-bit image (grayscale) at the specified (x,y) pos. Specifically for 8-bit display devices such as IS31FL3731; no color reduction/expansion is performed. | |
| void | drawGrayscaleBitmap (int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h) |
| Draw a RAM-resident 8-bit image (grayscale) at the specified (x,y) pos. Specifically for 8-bit display devices such as IS31FL3731; no color reduction/expansion is performed. | |
| void | drawGrayscaleBitmap (int16_t x, int16_t y, const uint8_t bitmap[], const uint8_t mask[], int16_t w, int16_t h) |
| Draw a PROGMEM-resident 8-bit image (grayscale) with a 1-bit mask (set bits = opaque, unset bits = clear) at the specified (x,y) position. BOTH buffers (grayscale and mask) must be PROGMEM-resident. Specifically for 8-bit display devices such as IS31FL3731; no color reduction/expansion is performed. | |
| void | drawGrayscaleBitmap (int16_t x, int16_t y, uint8_t *bitmap, uint8_t *mask, int16_t w, int16_t h) |
| Draw a RAM-resident 8-bit image (grayscale) with a 1-bit mask (set bits = opaque, unset bits = clear) at the specified (x,y) position. BOTH buffers (grayscale and mask) must be RAM-residentt, no mix-and-match Specifically for 8-bit display devices such as IS31FL3731; no color reduction/expansion is performed. | |
| void | drawRGBBitmap (int16_t x, int16_t y, const uint16_t bitmap[], int16_t w, int16_t h) |
| Draw a PROGMEM-resident 16-bit image (RGB 5/6/5) at the specified (x,y) position. For 16-bit display devices; no color reduction performed. | |
| void | drawRGBBitmap (int16_t x, int16_t y, uint16_t *bitmap, int16_t w, int16_t h) |
| Draw a RAM-resident 16-bit image (RGB 5/6/5) at the specified (x,y) position. For 16-bit display devices; no color reduction performed. | |
| void | drawRGBBitmap (int16_t x, int16_t y, const uint16_t bitmap[], const uint8_t mask[], int16_t w, int16_t h) |
| Draw a PROGMEM-resident 16-bit image (RGB 5/6/5) with a 1-bit mask (set bits = opaque, unset bits = clear) at the specified (x,y) position. BOTH buffers (color and mask) must be PROGMEM-resident. For 16-bit display devices; no color reduction performed. | |
| void | drawRGBBitmap (int16_t x, int16_t y, uint16_t *bitmap, uint8_t *mask, int16_t w, int16_t h) |
| Draw a RAM-resident 16-bit image (RGB 5/6/5) with a 1-bit mask (set bits = opaque, unset bits = clear) at the specified (x,y) position. BOTH buffers (color and mask) must be RAM-resident. For 16-bit display devices; no color reduction performed. | |
| void | drawChar (int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size) |
| Draw a single character. | |
| void | drawChar (int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size_x, uint8_t size_y) |
| Draw a single character. | |
| void | getTextBounds (const char *string, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h) |
| Helper to determine size of a string with current font/size. Pass string and a cursor position, returns UL corner and W,H. | |
| void | getTextBounds (const __FlashStringHelper *s, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h) |
| Helper to determine size of a PROGMEM string with current font/size. Pass string and a cursor position, returns UL corner and W,H. | |
| void | getTextBounds (const String &str, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h) |
| Helper to determine size of a string with current font/size. Pass string and a cursor position, returns UL corner and W,H. | |
| void | setTextSize (uint8_t s) |
| Set text 'magnification' size. Each increase in s makes 1 pixel that much bigger. | |
| void | setTextSize (uint8_t sx, uint8_t sy) |
| Set text 'magnification' size. Each increase in s makes 1 pixel that much bigger. | |
| void | setFont (const GFXfont *f=NULL) |
| Set the font to display when print()ing, either custom or default. | |
| void | setCursor (int16_t x, int16_t y) |
| Set text cursor location. | |
| void | setTextColor (uint16_t c) |
| Set text font color with transparant background. | |
| void | setTextColor (uint16_t c, uint16_t bg) |
| Set text font color with custom background color. | |
| void | setTextWrap (bool w) |
| Set whether text that is too long for the screen width should automatically wrap around to the next line (else clip right). | |
| void | cp437 (bool x=true) |
| Enable (or disable) Code Page 437-compatible charset. There was an error in glcdfont.c for the longest time – one character (#176, the 'light shade' block) was missing – this threw off the index of every character that followed it. But a TON of code has been written with the erroneous character indices. By default, the library uses the original 'wrong' behavior and old sketches will still work. Pass 'true' to this function to use correct CP437 character values in your code. | |
| virtual void | write (uint8_t) |
| Print one byte/character of data, used to support print() | |
| int16_t | width (void) const |
| Get width of the display, accounting for current rotation. | |
| int16_t | height (void) const |
| Get height of the display, accounting for current rotation. | |
| uint8_t | getRotation (void) const |
| Get rotation setting for display. | |
| int16_t | getCursorX (void) const |
| Get text cursor X location. | |
| int16_t | getCursorY (void) const |
| Get text cursor Y location. | |
| virtual size_t | write (uint8_t c)=0 |
| size_t | write (const char *str) |
| virtual size_t | write (const uint8_t *buffer, size_t size) |
| size_t | write (const char *buffer, size_t size) |
Public Member Functions inherited from Print | |
| Print () | |
| Constructor: no write error. | |
| virtual | ~Print () |
| Virtual destructor. | |
| int | getWriteError () |
| void | clearWriteError () |
| Clear the write-error flag. | |
| size_t | write (const char *str) |
| size_t | write (const char *buffer, size_t size) |
| virtual int | availableForWrite () |
| virtual void | flush () |
| Wait for pending output to finish (no-op by default). | |
| size_t | print (const __FlashStringHelper *ifsh) |
| size_t | print (const String &s) |
| size_t | print (const char str[]) |
| size_t | print (char c) |
| size_t | print (unsigned char b, int base=DEC) |
| size_t | print (int n, int base=DEC) |
| size_t | print (unsigned int n, int base=DEC) |
| size_t | print (long n, int base=DEC) |
| size_t | print (unsigned long n, int base=DEC) |
| size_t | print (double n, int digits=2) |
| size_t | println (const __FlashStringHelper *ifsh) |
| size_t | println (const String &s) |
| size_t | println (const char str[]) |
| size_t | println (char c) |
| size_t | println (unsigned char b, int base=DEC) |
| size_t | println (int n, int base=DEC) |
| size_t | println (unsigned int n, int base=DEC) |
| size_t | println (long n, int base=DEC) |
| size_t | println (unsigned long n, int base=DEC) |
| size_t | println (double n, int digits=2) |
| size_t | println (void) |
Protected Member Functions | |
| bool | getRawPixel (int16_t x, int16_t y) const |
| Get the pixel color value at a given, unrotated coordinate. This method is intended for hardware drivers to get pixel value in physical coordinates. | |
| void | drawFastRawVLine (int16_t x, int16_t y, int16_t h, uint16_t color) |
| Speed optimized vertical line drawing into the raw canvas buffer. | |
| void | drawFastRawHLine (int16_t x, int16_t y, int16_t w, uint16_t color) |
| Speed optimized horizontal line drawing into the raw canvas buffer. | |
Protected Member Functions inherited from Adafruit_GFX | |
| void | charBounds (unsigned char c, int16_t *x, int16_t *y, int16_t *minx, int16_t *miny, int16_t *maxx, int16_t *maxy) |
| Helper to determine size of a character with current font/size. Broke this out as it's used by both the PROGMEM- and RAM-resident getTextBounds() functions. | |
Protected Member Functions inherited from Print | |
| void | setWriteError (int err=1) |
Protected Attributes | |
| uint8_t * | buffer |
| Raster data: no longer private, allow subclass access. | |
| bool | buffer_owned |
Protected Attributes inherited from Adafruit_GFX | |
| int16_t | WIDTH |
| This is the 'raw' display width - never changes. | |
| int16_t | HEIGHT |
| This is the 'raw' display height - never changes. | |
| int16_t | _width |
| Display width as modified by current rotation. | |
| int16_t | _height |
| Display height as modified by current rotation. | |
| int16_t | cursor_x |
| x location to start print()ing text | |
| int16_t | cursor_y |
| y location to start print()ing text | |
| uint16_t | textcolor |
| 16-bit background color for print() | |
| uint16_t | textbgcolor |
| 16-bit text color for print() | |
| uint8_t | textsize_x |
| Desired magnification in X-axis of text to print() | |
| uint8_t | textsize_y |
| Desired magnification in Y-axis of text to print() | |
| uint8_t | rotation |
| Display rotation (0 thru 3) | |
| bool | wrap |
| If set, 'wrap' text at right edge of display. | |
| bool | _cp437 |
| If set, use correct CP437 charset (default is off) | |
| GFXfont * | gfxFont |
| Pointer to special font. | |
A GFX 1-bit canvas context for graphics.
Definition at line 312 of file Adafruit_GFX.h.
| GFXcanvas1::GFXcanvas1 | ( | uint16_t | w, |
| uint16_t | h, | ||
| bool | allocate_buffer = true ) |
Instatiate a GFX 1-bit canvas context for graphics.
| w | Display width, in pixels |
| h | Display height, in pixels |
| allocate_buffer | If true, a buffer is allocated with malloc. If false, the subclass must initialize the buffer before any drawing operation, and free it in the destructor. If false (the default), the buffer is allocated and freed by the library. |
Definition at line 2022 of file Adafruit_GFX.cpp.
References buffer.
| GFXcanvas1::~GFXcanvas1 | ( | void | ) |
Delete the canvas, free memory.
Definition at line 2039 of file Adafruit_GFX.cpp.
References buffer, and buffer_owned.
|
virtual |
Speed optimized horizontal line drawing.
| x | Line horizontal start point |
| y | Line vertical start point |
| w | Length of horizontal line to be drawn, including first point |
| color | Color to fill with |
Reimplemented from Adafruit_GFX.
Definition at line 2220 of file Adafruit_GFX.cpp.
References drawFastRawHLine(), drawFastRawVLine(), Adafruit_GFX::getRotation(), Adafruit_GFX::height(), Adafruit_GFX::HEIGHT, Adafruit_GFX::width(), and Adafruit_GFX::WIDTH.
|
protected |
Speed optimized horizontal line drawing into the raw canvas buffer.
| x | Line horizontal start point |
| y | Line vertical start point |
| w | length of horizontal line to be drawn, including first point |
| color | Binary (on or off) color to fill with |
Definition at line 2313 of file Adafruit_GFX.cpp.
References buffer, and Adafruit_GFX::WIDTH.
Referenced by drawFastHLine(), and drawFastVLine().
|
protected |
Speed optimized vertical line drawing into the raw canvas buffer.
| x | Line horizontal start point |
| y | Line vertical start point |
| h | length of vertical line to be drawn, including first point |
| color | Binary (on or off) color to fill with |
Definition at line 2275 of file Adafruit_GFX.cpp.
References buffer, and Adafruit_GFX::WIDTH.
Referenced by drawFastHLine(), and drawFastVLine().
|
virtual |
Speed optimized vertical line drawing.
| x | Line horizontal start point |
| y | Line vertical start point |
| h | Length of vertical line to be drawn, including first point |
| color | Color to fill with |
Reimplemented from Adafruit_GFX.
Definition at line 2164 of file Adafruit_GFX.cpp.
References drawFastRawHLine(), drawFastRawVLine(), Adafruit_GFX::getRotation(), Adafruit_GFX::height(), Adafruit_GFX::HEIGHT, Adafruit_GFX::width(), and Adafruit_GFX::WIDTH.
|
virtual |
Draw a pixel to the canvas framebuffer.
| x | x coordinate |
| y | y coordinate |
| color | Binary (on or off) color to fill with |
Implements Adafruit_GFX.
Definition at line 2052 of file Adafruit_GFX.cpp.
References Adafruit_GFX::_height, Adafruit_GFX::_width, buffer, Adafruit_GFX::HEIGHT, Adafruit_GFX::rotation, and Adafruit_GFX::WIDTH.
|
virtual |
Fill the framebuffer completely with one color.
| color | Binary (on or off) color to fill with |
Reimplemented from Adafruit_GFX.
Definition at line 2148 of file Adafruit_GFX.cpp.
References buffer, Adafruit_GFX::HEIGHT, and Adafruit_GFX::WIDTH.
|
inline |
Get a pointer to the internal buffer memory.
Definition at line 327 of file Adafruit_GFX.h.
References buffer.
| bool GFXcanvas1::getPixel | ( | int16_t | x, |
| int16_t | y ) const |
Get the pixel color value at a given coordinate.
| x | x coordinate |
| y | y coordinate |
Definition at line 2097 of file Adafruit_GFX.cpp.
References getRawPixel(), Adafruit_GFX::HEIGHT, Adafruit_GFX::rotation, and Adafruit_GFX::WIDTH.
|
protected |
Get the pixel color value at a given, unrotated coordinate. This method is intended for hardware drivers to get pixel value in physical coordinates.
| x | x coordinate |
| y | y coordinate |
Definition at line 2127 of file Adafruit_GFX.cpp.
References buffer, Adafruit_GFX::HEIGHT, and Adafruit_GFX::WIDTH.
Referenced by getPixel().
|
protected |
Raster data: no longer private, allow subclass access.
Definition at line 333 of file Adafruit_GFX.h.
Referenced by drawFastRawHLine(), drawFastRawVLine(), drawPixel(), fillScreen(), getBuffer(), getRawPixel(), GFXcanvas1(), and ~GFXcanvas1().
|
protected |
If true, destructor will free buffer, else it will do nothing
Definition at line 334 of file Adafruit_GFX.h.
Referenced by ~GFXcanvas1().