|
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
|
Class that stores state and functions for interacting with the RA8875 display controller. More...
#include <Adafruit_RA8875.h>
Public Types | |
| typedef bool(* | StorageReadFn) (void *ctx, uint32_t address, uint8_t *data, uint32_t length) |
Read length bytes at address; return true on success. | |
| typedef bool(* | StorageWriteFn) (void *ctx, uint32_t address, const uint8_t *data, uint32_t length) |
Write length bytes at address; return true on success. | |
Public Member Functions | |
| Adafruit_RA8875 (SPI_HandleTypeDef *spi, GPIO_TypeDef *csPort, uint16_t csPin, GPIO_TypeDef *rstPort, uint16_t rstPin, GPIO_TypeDef *waitPort=nullptr, uint16_t waitPin=0) | |
| boolean | begin (enum RA8875sizes s) |
| void | softReset (void) |
| void | displayOn (boolean on) |
| void | sleep (boolean sleep) |
| void | textMode (void) |
| void | textSetCursor (uint16_t x, uint16_t y) |
| void | textColor (uint16_t foreColor, uint16_t bgColor) |
| void | textTransparent (uint16_t foreColor) |
| void | textEnlarge (uint8_t scale) |
| void | textWrite (const char *buffer, uint16_t len=0) |
| void | cursorBlink (uint8_t rate) |
| void | graphicsMode (void) |
| void | setXY (uint16_t x, uint16_t y) |
| void | pushPixels (uint32_t num, uint16_t p) |
| void | fillRect (void) |
| void | drawPixel (int16_t x, int16_t y, uint16_t color) |
| void | drawPixels (uint16_t *p, uint32_t count, int16_t x, int16_t y) |
| void | drawFastVLine (int16_t x, int16_t y, int16_t h, uint16_t color) |
| void | drawFastHLine (int16_t x, int16_t y, int16_t w, uint16_t color) |
| void | fillScreen (uint16_t color) |
| void | drawLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) |
| void | drawRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) |
| void | fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) |
| void | drawCircle (int16_t x, int16_t y, int16_t r, uint16_t color) |
| void | fillCircle (int16_t x, int16_t y, int16_t r, uint16_t color) |
| void | drawTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color) |
| void | fillTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color) |
| void | drawEllipse (int16_t xCenter, int16_t yCenter, int16_t longAxis, int16_t shortAxis, uint16_t color) |
| void | fillEllipse (int16_t xCenter, int16_t yCenter, int16_t longAxis, int16_t shortAxis, uint16_t color) |
| void | drawCurve (int16_t xCenter, int16_t yCenter, int16_t longAxis, int16_t shortAxis, uint8_t curvePart, uint16_t color) |
| void | fillCurve (int16_t xCenter, int16_t yCenter, int16_t longAxis, int16_t shortAxis, uint8_t curvePart, uint16_t color) |
| void | drawRoundRect (int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, uint16_t color) |
| void | fillRoundRect (int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, uint16_t color) |
| void | setScrollWindow (int16_t x, int16_t y, int16_t w, int16_t h, uint8_t mode) |
| void | scrollX (int16_t dist) |
| void | scrollY (int16_t dist) |
| void | GPIOX (boolean on) |
| void | PWM1config (boolean on, uint8_t clock) |
| void | PWM2config (boolean on, uint8_t clock) |
| void | PWM1out (uint8_t p) |
| void | PWM2out (uint8_t p) |
| void | touchEnable (boolean on) |
| boolean | touched (void) |
| boolean | touchRead (uint16_t *x, uint16_t *y) |
| void | setCalibrationStorage (StorageReadFn read, StorageWriteFn write, void *ctx, uint32_t sizeBytes) |
| uint32_t | eepromReadS32 (int location) |
| void | eepromWriteS32 (int location, int32_t value) |
| bool | readCalibration (int location, tsMatrix_t *matrixPtr) |
| void | writeCalibration (int location, tsMatrix_t *matrixPtr) |
| void | writeReg (uint8_t reg, uint8_t val) |
| uint8_t | readReg (uint8_t reg) |
| void | writeData (uint8_t d) |
| uint8_t | readData (void) |
| void | writeCommand (uint8_t d) |
| uint8_t | readStatus (void) |
| boolean | waitPoll (uint8_t r, uint8_t f) |
| uint16_t | width (void) |
| uint16_t | height (void) |
| void | setRotation (int8_t rotation) |
| int8_t | getRotation (void) |
| virtual size_t | write (uint8_t b) |
| virtual size_t | write (const uint8_t *buffer, size_t size) |
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) | |
| 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. | |
| 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. | |
| size_t | write (const char *str) |
| 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) |
Additional Inherited Members | |
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 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. | |
Class that stores state and functions for interacting with the RA8875 display controller.
Definition at line 103 of file Adafruit_RA8875.h.
| typedef bool(* Adafruit_RA8875::StorageReadFn) (void *ctx, uint32_t address, uint8_t *data, uint32_t length) |
Read length bytes at address; return true on success.
Definition at line 191 of file Adafruit_RA8875.h.
| typedef bool(* Adafruit_RA8875::StorageWriteFn) (void *ctx, uint32_t address, const uint8_t *data, uint32_t length) |
Write length bytes at address; return true on success.
Definition at line 194 of file Adafruit_RA8875.h.
| Adafruit_RA8875::Adafruit_RA8875 | ( | SPI_HandleTypeDef * | spi, |
| GPIO_TypeDef * | csPort, | ||
| uint16_t | csPin, | ||
| GPIO_TypeDef * | rstPort, | ||
| uint16_t | rstPin, | ||
| GPIO_TypeDef * | waitPort = nullptr, | ||
| uint16_t | waitPin = 0 ) |
Constructor (STM32 HAL): replaces Adafruit's Arduino (uint8_t cs, uint8_t rst) form; see the README for the SPI/GPIO setup. The WAIT port and pin are optional. Pass nullptr (the default) if the pin isn't wired; the driver then skips WAIT polling entirely. The parameters are documented at the constructor definition.
Constructor for a new RA8875 instance
| spi | SPI handle configured by CubeMX (see README) |
| csPort | GPIO port of the chip-select pin |
| csPin | GPIO pin of the chip-select pin |
| rstPort | GPIO port of the RESET pin |
| rstPin | GPIO pin of the RESET pin |
| waitPort | GPIO port of the WAIT pin, or nullptr if not wired |
| waitPin | GPIO pin of the WAIT pin (ignored if waitPort is nullptr) |
Definition at line 102 of file Adafruit_RA8875.cpp.
| boolean Adafruit_RA8875::begin | ( | enum RA8875sizes | s | ) |
Initialises the LCD driver and any HW required by the display
| s | The display size, which can be either: 'RA8875_480x80' (3.8" displays) or 'RA8875_480x128' (3.9" displays) or 'RA8875_480x272' (4.3" displays) or 'RA8875_800x480' (5" and 7" displays) |
Definition at line 193 of file Adafruit_RA8875.cpp.
References RA8875_480x128, RA8875_480x272, RA8875_480x80, RA8875_800x480, RA8875_DEBUG_PRINTF, and readReg().
Referenced by initTest().
| void Adafruit_RA8875::cursorBlink | ( | uint8_t | rate | ) |
Enable Cursor Visibility and Blink Here we set bits 6 and 5 in 40h As well as the set the blink rate in 44h The rate is 0 through max 255 the lower the number the faster it blinks (00h is 1 frame time, FFh is 256 Frames time. Blink Time (sec) = BTCR[44h]x(1/Frame_rate)
| rate | The frame rate to blink |
Definition at line 560 of file Adafruit_RA8875.cpp.
References RA8875_BTCR, RA8875_MWCR0, RA8875_MWCR0_BLINK, RA8875_MWCR0_CURSOR, readData(), writeCommand(), and writeData().
Referenced by testLCD().
| void Adafruit_RA8875::displayOn | ( | boolean | on | ) |
Turns the display on or off
| on | Whether to turn the display on or not |
Definition at line 1678 of file Adafruit_RA8875.cpp.
References RA8875_PWRR, RA8875_PWRR_DISPOFF, RA8875_PWRR_DISPON, RA8875_PWRR_NORMAL, and writeReg().
Referenced by testLCD().
| void Adafruit_RA8875::drawCircle | ( | int16_t | x, |
| int16_t | y, | ||
| int16_t | r, | ||
| uint16_t | color ) |
Draws a HW accelerated circle on the display
| x | The 0-based x location of the center of the circle |
| y | The 0-based y location of the center of the circle |
| r | The circle's radius |
| color | The RGB565 color to use when drawing the pixel |
Definition at line 937 of file Adafruit_RA8875.cpp.
Referenced by testLCD().
| void Adafruit_RA8875::drawCurve | ( | int16_t | xCenter, |
| int16_t | yCenter, | ||
| int16_t | longAxis, | ||
| int16_t | shortAxis, | ||
| uint8_t | curvePart, | ||
| uint16_t | color ) |
Draws a HW accelerated curve on the display
| xCenter | The 0-based x location of the ellipse's center |
| yCenter | The 0-based y location of the ellipse's center |
| longAxis | The size in pixels of the ellipse's long axis |
| shortAxis | The size in pixels of the ellipse's short axis |
| curvePart | The corner to draw, where in clock-wise motion: 0 = 180-270° 1 = 270-0° 2 = 0-90° 3 = 90-180° |
| color | The RGB565 color to use when drawing the pixel |
Definition at line 1045 of file Adafruit_RA8875.cpp.
Referenced by testLCD().
| void Adafruit_RA8875::drawEllipse | ( | int16_t | xCenter, |
| int16_t | yCenter, | ||
| int16_t | longAxis, | ||
| int16_t | shortAxis, | ||
| uint16_t | color ) |
Draws a HW accelerated ellipse on the display
| xCenter | The 0-based x location of the ellipse's center |
| yCenter | The 0-based y location of the ellipse's center |
| longAxis | The size in pixels of the ellipse's long axis |
| shortAxis | The size in pixels of the ellipse's short axis |
| color | The RGB565 color to use when drawing the pixel |
Definition at line 1006 of file Adafruit_RA8875.cpp.
Referenced by testLCD().
|
virtual |
Draw a horizontal line
| x | The X position |
| y | The Y position |
| w | Width |
| color | The color |
Reimplemented from Adafruit_GFX.
Definition at line 879 of file Adafruit_RA8875.cpp.
References drawLine().
|
virtual |
Draw a vertical line
| x | The X position |
| y | The Y position |
| h | Height |
| color | The color |
Reimplemented from Adafruit_GFX.
Definition at line 864 of file Adafruit_RA8875.cpp.
References drawLine().
|
virtual |
Draws a HW accelerated line on the display
| x0 | The 0-based starting x location |
| y0 | The 0-base starting y location |
| x1 | The 0-based ending x location |
| y1 | The 0-base ending y location |
| color | The RGB565 color to use when drawing the pixel |
Reimplemented from Adafruit_GFX.
Definition at line 807 of file Adafruit_RA8875.cpp.
References RA8875_DCR, RA8875_DCR_LINESQUTRI_STATUS, waitPoll(), writeCommand(), and writeData().
Referenced by drawFastHLine(), drawFastVLine(), and testLCD().
|
virtual |
Draws a single pixel at the specified location
| x | The 0-based x location |
| y | The 0-base y location |
| color | The RGB565 color to use when drawing the pixel |
Implements Adafruit_GFX.
Definition at line 738 of file Adafruit_RA8875.cpp.
References RA8875_CURH0, RA8875_CURH1, RA8875_CURV0, RA8875_CURV1, RA8875_DATAWRITE, RA8875_MRWC, writeCommand(), and writeReg().
Referenced by testLCD().
| void Adafruit_RA8875::drawPixels | ( | uint16_t * | p, |
| uint32_t | num, | ||
| int16_t | x, | ||
| int16_t | y ) |
Draws a series of pixels at the specified location without the overhead
| p | An array of RGB565 color pixels |
| num | The number of the pixels to draw |
| x | The 0-based x location |
| y | The 0-base y location |
Definition at line 763 of file Adafruit_RA8875.cpp.
References RA8875_CURH0, RA8875_CURH1, RA8875_CURV0, RA8875_CURV1, RA8875_DATAWRITE, RA8875_MRWC, RA8875_MWCR0, RA8875_MWCR0_DIRMASK, RA8875_MWCR0_LRTD, RA8875_MWCR0_RLTD, readReg(), writeCommand(), and writeReg().
|
virtual |
Draws a HW accelerated rectangle on the display
| x | The 0-based x location of the top-right corner |
| y | The 0-based y location of the top-right corner |
| w | The rectangle width |
| h | The rectangle height |
| color | The RGB565 color to use when drawing the pixel |
Reimplemented from Adafruit_GFX.
Definition at line 895 of file Adafruit_RA8875.cpp.
Referenced by testLCD().
| void Adafruit_RA8875::drawRoundRect | ( | int16_t | x, |
| int16_t | y, | ||
| int16_t | w, | ||
| int16_t | h, | ||
| int16_t | r, | ||
| uint16_t | color ) |
Draws a HW accelerated rounded rectangle on the display
| x | The 0-based x location of the rectangle's upper left corner |
| y | The 0-based y location of the rectangle's upper left corner |
| w | The size in pixels of the rectangle's width |
| h | The size in pixels of the rectangle's height |
| r | The radius of the curves in the corners of the rectangle |
| color | The RGB565 color to use when drawing the pixel |
Definition at line 1085 of file Adafruit_RA8875.cpp.
| void Adafruit_RA8875::drawTriangle | ( | int16_t | x0, |
| int16_t | y0, | ||
| int16_t | x1, | ||
| int16_t | y1, | ||
| int16_t | x2, | ||
| int16_t | y2, | ||
| uint16_t | color ) |
Draws a HW accelerated triangle on the display
| x0 | The 0-based x location of point 0 on the triangle |
| y0 | The 0-based y location of point 0 on the triangle |
| x1 | The 0-based x location of point 1 on the triangle |
| y1 | The 0-based y location of point 1 on the triangle |
| x2 | The 0-based x location of point 2 on the triangle |
| y2 | The 0-based y location of point 2 on the triangle |
| color | The RGB565 color to use when drawing the pixel |
Definition at line 970 of file Adafruit_RA8875.cpp.
Referenced by testLCD().
| uint32_t Adafruit_RA8875::eepromReadS32 | ( | int | location | ) |
Read a big-endian 32-bit value from the calibration storage
| location | The byte address to read |
Definition at line 1848 of file Adafruit_RA8875.cpp.
Referenced by readCalibration().
| void Adafruit_RA8875::eepromWriteS32 | ( | int | location, |
| int32_t | value ) |
Write a big-endian 32-bit value to the calibration storage
| location | The byte address to write to |
| value | The value to write |
Definition at line 1864 of file Adafruit_RA8875.cpp.
Referenced by writeCalibration().
| void Adafruit_RA8875::fillCircle | ( | int16_t | x, |
| int16_t | y, | ||
| int16_t | r, | ||
| uint16_t | color ) |
Draws a HW accelerated filled circle on the display
| x | The 0-based x location of the center of the circle |
| y | The 0-based y location of the center of the circle |
| r | The circle's radius |
| color | The RGB565 color to use when drawing the pixel |
Definition at line 952 of file Adafruit_RA8875.cpp.
Referenced by testLCD().
| void Adafruit_RA8875::fillCurve | ( | int16_t | xCenter, |
| int16_t | yCenter, | ||
| int16_t | longAxis, | ||
| int16_t | shortAxis, | ||
| uint8_t | curvePart, | ||
| uint16_t | color ) |
Draws a HW accelerated filled curve on the display
| xCenter | The 0-based x location of the ellipse's center |
| yCenter | The 0-based y location of the ellipse's center |
| longAxis | The size in pixels of the ellipse's long axis |
| shortAxis | The size in pixels of the ellipse's short axis |
| curvePart | The corner to draw, where in clock-wise motion: 0 = 180-270° 1 = 270-0° 2 = 0-90° 3 = 90-180° |
| color | The RGB565 color to use when drawing the pixel |
Definition at line 1067 of file Adafruit_RA8875.cpp.
Referenced by testLCD().
| void Adafruit_RA8875::fillEllipse | ( | int16_t | xCenter, |
| int16_t | yCenter, | ||
| int16_t | longAxis, | ||
| int16_t | shortAxis, | ||
| uint16_t | color ) |
Draws a HW accelerated filled ellipse on the display
| xCenter | The 0-based x location of the ellipse's center |
| yCenter | The 0-based y location of the ellipse's center |
| longAxis | The size in pixels of the ellipse's long axis |
| shortAxis | The size in pixels of the ellipse's short axis |
| color | The RGB565 color to use when drawing the pixel |
Definition at line 1023 of file Adafruit_RA8875.cpp.
Referenced by testLCD().
|
virtual |
Draws a HW accelerated filled rectangle on the display
| x | The 0-based x location of the top-right corner |
| y | The 0-based y location of the top-right corner |
| w | The rectangle width |
| h | The rectangle height |
| color | The RGB565 color to use when drawing the pixel |
Reimplemented from Adafruit_GFX.
Definition at line 911 of file Adafruit_RA8875.cpp.
| void Adafruit_RA8875::fillRect | ( | void | ) |
Fill the screen with the current color
Definition at line 688 of file Adafruit_RA8875.cpp.
References RA8875_DCR, RA8875_DCR_DRAWSQUARE, RA8875_DCR_FILL, RA8875_DCR_LINESQUTRI_START, RA8875_DCR_LINESQUTRI_STOP, writeCommand(), and writeData().
Referenced by testLCD().
| void Adafruit_RA8875::fillRoundRect | ( | int16_t | x, |
| int16_t | y, | ||
| int16_t | w, | ||
| int16_t | h, | ||
| int16_t | r, | ||
| uint16_t | color ) |
Draws a HW accelerated filled rounded rectangle on the display
| x | The 0-based x location of the rectangle's upper left corner |
| y | The 0-based y location of the rectangle's upper left corner |
| w | The size in pixels of the rectangle's width |
| h | The size in pixels of the rectangle's height |
| r | The radius of the curves in the corners of the rectangle |
| color | The RGB565 color to use when drawing the pixel |
Definition at line 1102 of file Adafruit_RA8875.cpp.
Referenced by testLCD().
|
virtual |
Fills the screen with the spefied RGB565 color
| color | The RGB565 color to use when drawing the pixel |
Reimplemented from Adafruit_GFX.
Definition at line 923 of file Adafruit_RA8875.cpp.
Referenced by testLCD().
| void Adafruit_RA8875::fillTriangle | ( | int16_t | x0, |
| int16_t | y0, | ||
| int16_t | x1, | ||
| int16_t | y1, | ||
| int16_t | x2, | ||
| int16_t | y2, | ||
| uint16_t | color ) |
Draws a HW accelerated filled triangle on the display
| x0 | The 0-based x location of point 0 on the triangle |
| y0 | The 0-based y location of point 0 on the triangle |
| x1 | The 0-based x location of point 1 on the triangle |
| y1 | The 0-based y location of point 1 on the triangle |
| x2 | The 0-based x location of point 2 on the triangle |
| y2 | The 0-based y location of point 2 on the triangle |
| color | The RGB565 color to use when drawing the pixel |
Definition at line 989 of file Adafruit_RA8875.cpp.
Referenced by testLCD().
| int8_t Adafruit_RA8875::getRotation | ( | void | ) |
Returns the current rotation (0-3)
Definition at line 397 of file Adafruit_RA8875.cpp.
| void Adafruit_RA8875::GPIOX | ( | boolean | on | ) |
Set the Extra General Purpose IO Register
| on | Whether to turn Extra General Purpose IO on or not |
Definition at line 1531 of file Adafruit_RA8875.cpp.
References RA8875_GPIOX, and writeReg().
Referenced by testLCD().
| void Adafruit_RA8875::graphicsMode | ( | void | ) |
Sets the display in graphics mode (as opposed to text mode)
Definition at line 617 of file Adafruit_RA8875.cpp.
References RA8875_MWCR0, readData(), writeCommand(), and writeData().
Referenced by testLCD().
| uint16_t Adafruit_RA8875::height | ( | void | ) |
Returns the display height in pixels
Definition at line 386 of file Adafruit_RA8875.cpp.
| void Adafruit_RA8875::pushPixels | ( | uint32_t | num, |
| uint16_t | p ) |
HW accelerated function to push a chunk of raw pixel data
| num | The number of pixels to push |
| p | The pixel color to use |
Definition at line 667 of file Adafruit_RA8875.cpp.
References RA8875_DATAWRITE.
| void Adafruit_RA8875::PWM1config | ( | boolean | on, |
| uint8_t | clock ) |
Configure the PWM 1 Clock
| on | Whether to enable the clock |
| clock | The Clock Divider |
Definition at line 1568 of file Adafruit_RA8875.cpp.
References RA8875_P1CR, RA8875_P1CR_DISABLE, RA8875_P1CR_ENABLE, and writeReg().
Referenced by testLCD().
| void Adafruit_RA8875::PWM1out | ( | uint8_t | p | ) |
Set the duty cycle of the PWM 1 Clock
| p | The duty Cycle (0-255) |
Definition at line 1545 of file Adafruit_RA8875.cpp.
References RA8875_P1DCR, and writeReg().
Referenced by testLCD().
| void Adafruit_RA8875::PWM2config | ( | boolean | on, |
| uint8_t | clock ) |
Configure the PWM 2 Clock
| on | Whether to enable the clock |
| clock | The Clock Divider |
Definition at line 1584 of file Adafruit_RA8875.cpp.
References RA8875_P2CR, RA8875_P2CR_DISABLE, RA8875_P2CR_ENABLE, and writeReg().
| void Adafruit_RA8875::PWM2out | ( | uint8_t | p | ) |
Set the duty cycle of the PWM 2 Clock
| p | The duty Cycle (0-255) |
Definition at line 1556 of file Adafruit_RA8875.cpp.
References RA8875_P2DCR, and writeReg().
| bool Adafruit_RA8875::readCalibration | ( | int | location, |
| tsMatrix_t * | matrixPtr ) |
Read Calibration Data from the calibration storage
| location | The byte address to read from |
| matrixPtr | The pointer to the Matrix Variable |
Definition at line 1880 of file Adafruit_RA8875.cpp.
References tsMatrix_t::An, tsMatrix_t::Bn, CFG_EEPROM_TOUCHSCREEN_CAL_AN, CFG_EEPROM_TOUCHSCREEN_CAL_BN, CFG_EEPROM_TOUCHSCREEN_CAL_CN, CFG_EEPROM_TOUCHSCREEN_CAL_DIVIDER, CFG_EEPROM_TOUCHSCREEN_CAL_DN, CFG_EEPROM_TOUCHSCREEN_CAL_EN, CFG_EEPROM_TOUCHSCREEN_CAL_FN, CFG_EEPROM_TOUCHSCREEN_CALIBRATED, tsMatrix_t::Cn, tsMatrix_t::Divider, tsMatrix_t::Dn, eepromReadS32(), tsMatrix_t::En, and tsMatrix_t::Fn.
| uint8_t Adafruit_RA8875::readData | ( | void | ) |
Read the data from the current register
Definition at line 1753 of file Adafruit_RA8875.cpp.
References RA8875_DATAREAD, spi_begin, and spi_end.
Referenced by cursorBlink(), graphicsMode(), readReg(), textColor(), textEnlarge(), textMode(), and textTransparent().
| uint8_t Adafruit_RA8875::readReg | ( | uint8_t | reg | ) |
Set the register to read from
| reg | Register to read |
Definition at line 1723 of file Adafruit_RA8875.cpp.
References readData(), and writeCommand().
Referenced by begin(), drawPixels(), touched(), touchEnable(), touchRead(), and waitPoll().
| uint8_t Adafruit_RA8875::readStatus | ( | void | ) |
Read the status from the current register
Definition at line 1794 of file Adafruit_RA8875.cpp.
References RA8875_CMDREAD, spi_begin, and spi_end.
| void Adafruit_RA8875::scrollX | ( | int16_t | dist | ) |
Scroll in the X direction
| dist | The distance to scroll |
Definition at line 1499 of file Adafruit_RA8875.cpp.
References writeCommand(), and writeData().
| void Adafruit_RA8875::scrollY | ( | int16_t | dist | ) |
Scroll in the Y direction
| dist | The distance to scroll |
Definition at line 1514 of file Adafruit_RA8875.cpp.
References writeCommand(), and writeData().
| void Adafruit_RA8875::setCalibrationStorage | ( | StorageReadFn | read, |
| StorageWriteFn | write, | ||
| void * | ctx, | ||
| uint32_t | sizeBytes ) |
Provide the non-volatile memory used to keep the touch calibration. STM32 has no Arduino EEPROM, so any memory can be plugged in (external EEPROM, FRAM, flash...). Addresses passed to readCalibration() / writeCalibration() are byte addresses in that memory.
| read | Read callback (may be nullptr to disable reading) |
| write | Write callback (may be nullptr to disable writing) |
| ctx | Passed back to the callbacks (e.g. your FRAM object) |
| sizeBytes | Size of the memory, used for bounds checking |
Definition at line 1820 of file Adafruit_RA8875.cpp.
References write().
| void Adafruit_RA8875::setRotation | ( | int8_t | rotation | ) |
Sets the current rotation (0-3)
| rotation | The Rotation Setting |
Definition at line 408 of file Adafruit_RA8875.cpp.
References Adafruit_GFX::rotation.
| void Adafruit_RA8875::setScrollWindow | ( | int16_t | x, |
| int16_t | y, | ||
| int16_t | w, | ||
| int16_t | h, | ||
| uint8_t | mode ) |
Set the scroll window
| x | X position of the scroll window |
| y | Y position of the scroll window |
| w | Width of the Scroll Window |
| h | Height of the Scroll window |
| mode | Layer to Scroll |
Definition at line 1460 of file Adafruit_RA8875.cpp.
References writeCommand(), and writeData().
| void Adafruit_RA8875::setXY | ( | uint16_t | x, |
| uint16_t | y ) |
Sets the current X/Y position on the display before drawing
| x | The 0-based x location |
| y | The 0-base y location |
Definition at line 652 of file Adafruit_RA8875.cpp.
References RA8875_CURH0, RA8875_CURH1, RA8875_CURV0, RA8875_CURV1, and writeReg().
| void Adafruit_RA8875::sleep | ( | boolean | sleep | ) |
Puts the display in sleep mode, or disables sleep mode if enabled
| sleep | Whether to sleep or not |
Definition at line 1692 of file Adafruit_RA8875.cpp.
References RA8875_PWRR, RA8875_PWRR_DISPOFF, RA8875_PWRR_SLEEP, sleep(), and writeReg().
Referenced by sleep().
| void Adafruit_RA8875::softReset | ( | void | ) |
Performs a SW-based reset of the RA8875
Definition at line 245 of file Adafruit_RA8875.cpp.
References RA8875_PWRR, RA8875_PWRR_NORMAL, RA8875_PWRR_SOFTRESET, writeCommand(), and writeData().
| void Adafruit_RA8875::textColor | ( | uint16_t | foreColor, |
| uint16_t | bgColor ) |
Sets the fore and background color when rendering text
| foreColor | The RGB565 color to use when rendering the text |
| bgColor | The RGB565 colot to use for the background |
Definition at line 471 of file Adafruit_RA8875.cpp.
References readData(), writeCommand(), and writeData().
Referenced by testLCD().
| void Adafruit_RA8875::textEnlarge | ( | uint8_t | scale | ) |
Sets the text enlarge settings, using one of the following values:
0 = 1x zoom 1 = 2x zoom 2 = 3x zoom 3 = 4x zoom
| scale | The zoom factor (0..3 for 1-4x zoom) |
Definition at line 530 of file Adafruit_RA8875.cpp.
References readData(), writeCommand(), and writeData().
Referenced by testLCD().
| void Adafruit_RA8875::textMode | ( | void | ) |
Sets the display in text mode (as opposed to graphics mode)
Definition at line 426 of file Adafruit_RA8875.cpp.
References RA8875_MWCR0, RA8875_MWCR0_TXTMODE, readData(), writeCommand(), and writeData().
Referenced by testLCD().
| void Adafruit_RA8875::textSetCursor | ( | uint16_t | x, |
| uint16_t | y ) |
Sets the display in text mode (as opposed to graphics mode)
| x | The x position of the cursor (in pixels, 0..1023) |
| y | The y position of the cursor (in pixels, 0..511) |
Definition at line 448 of file Adafruit_RA8875.cpp.
References writeCommand(), and writeData().
Referenced by testLCD().
| void Adafruit_RA8875::textTransparent | ( | uint16_t | foreColor | ) |
Sets the fore color when rendering text with a transparent bg
| foreColor | The RGB565 color to use when rendering the text |
Definition at line 502 of file Adafruit_RA8875.cpp.
References readData(), writeCommand(), and writeData().
Referenced by testLCD().
| void Adafruit_RA8875::textWrite | ( | const char * | buffer, |
| uint16_t | len = 0 ) |
Renders some text on the screen when in text mode
| buffer | The buffer containing the characters to render |
| len | The size of the buffer in bytes |
Definition at line 585 of file Adafruit_RA8875.cpp.
References RA8875_MRWC, writeCommand(), and writeData().
| boolean Adafruit_RA8875::touched | ( | void | ) |
Checks if a touch event has occured
Definition at line 1631 of file Adafruit_RA8875.cpp.
References RA8875_INTC2, RA8875_INTC2_TP, and readReg().
| void Adafruit_RA8875::touchEnable | ( | boolean | on | ) |
Enables or disables the on-chip touch screen controller
| on | Whether to turn touch sensing on or not |
Definition at line 1599 of file Adafruit_RA8875.cpp.
References RA8875_800x480, RA8875_INTC1, RA8875_INTC1_TP, RA8875_TPCR0, RA8875_TPCR0_ADCCLK_DIV16, RA8875_TPCR0_ADCCLK_DIV4, RA8875_TPCR0_DISABLE, RA8875_TPCR0_ENABLE, RA8875_TPCR0_WAIT_4096CLK, RA8875_TPCR0_WAKEENABLE, RA8875_TPCR1, RA8875_TPCR1_AUTO, RA8875_TPCR1_DEBOUNCE, readReg(), and writeReg().
| boolean Adafruit_RA8875::touchRead | ( | uint16_t * | x, |
| uint16_t * | y ) |
Reads the last touch event
| x | Pointer to the uint16_t field to assign the raw X value |
| y | Pointer to the uint16_t field to assign the raw Y value |
Definition at line 1650 of file Adafruit_RA8875.cpp.
References RA8875_INTC2, RA8875_INTC2_TP, RA8875_TPXH, RA8875_TPXYL, RA8875_TPYH, readReg(), and writeReg().
| boolean Adafruit_RA8875::waitPoll | ( | uint8_t | regname, |
| uint8_t | waitflag ) |
Waits for screen to finish by polling the status!
| regname | The register name to check |
| waitflag | The value to wait for the status register to match |
Definition at line 634 of file Adafruit_RA8875.cpp.
References readReg().
Referenced by drawLine().
| uint16_t Adafruit_RA8875::width | ( | void | ) |
Returns the display width in pixels
Definition at line 375 of file Adafruit_RA8875.cpp.
|
inlinevirtual |
Alias of textWrite to Play nice with Arduino's Print class
| buffer | The buffer to write |
| size | The size of the buffer |
Reimplemented from Adafruit_GFX.
Definition at line 244 of file Adafruit_RA8875.h.
References textWrite().
|
inlinevirtual |
Alias of textWrite to Play nice with Arduino's Print class
| b | The string to write |
Reimplemented from Adafruit_GFX.
Definition at line 229 of file Adafruit_RA8875.h.
References textWrite().
Referenced by setCalibrationStorage().
| void Adafruit_RA8875::writeCalibration | ( | int | location, |
| tsMatrix_t * | matrixPtr ) |
Write Calibration Data to the calibration storage
| location | The byte address to write to |
| matrixPtr | The pointer to the Matrix Variable |
Definition at line 1910 of file Adafruit_RA8875.cpp.
References tsMatrix_t::An, tsMatrix_t::Bn, CFG_EEPROM_TOUCHSCREEN_CAL_AN, CFG_EEPROM_TOUCHSCREEN_CAL_BN, CFG_EEPROM_TOUCHSCREEN_CAL_CN, CFG_EEPROM_TOUCHSCREEN_CAL_DIVIDER, CFG_EEPROM_TOUCHSCREEN_CAL_DN, CFG_EEPROM_TOUCHSCREEN_CAL_EN, CFG_EEPROM_TOUCHSCREEN_CAL_FN, CFG_EEPROM_TOUCHSCREEN_CALIBRATED, tsMatrix_t::Cn, tsMatrix_t::Divider, tsMatrix_t::Dn, eepromWriteS32(), tsMatrix_t::En, and tsMatrix_t::Fn.
| void Adafruit_RA8875::writeCommand | ( | uint8_t | d | ) |
Write a command to the current register
| d | The data to write as a command |
Definition at line 1774 of file Adafruit_RA8875.cpp.
References RA8875_CMDWRITE, spi_begin, and spi_end.
Referenced by cursorBlink(), drawLine(), drawPixel(), drawPixels(), fillRect(), graphicsMode(), readReg(), scrollX(), scrollY(), setScrollWindow(), softReset(), textColor(), textEnlarge(), textMode(), textSetCursor(), textTransparent(), textWrite(), and writeReg().
| void Adafruit_RA8875::writeData | ( | uint8_t | d | ) |
Write data to the current register
| d | Data to write |
Definition at line 1735 of file Adafruit_RA8875.cpp.
References RA8875_DATAWRITE, spi_begin, and spi_end.
Referenced by cursorBlink(), drawLine(), fillRect(), graphicsMode(), scrollX(), scrollY(), setScrollWindow(), softReset(), textColor(), textEnlarge(), textMode(), textSetCursor(), textTransparent(), textWrite(), and writeReg().
| void Adafruit_RA8875::writeReg | ( | uint8_t | reg, |
| uint8_t | val ) |
Write data to the specified register
| reg | Register to write to |
| val | Value to write |
Definition at line 1709 of file Adafruit_RA8875.cpp.
References writeCommand(), and writeData().
Referenced by displayOn(), drawPixel(), drawPixels(), GPIOX(), PWM1config(), PWM1out(), PWM2config(), PWM2out(), setXY(), sleep(), touchEnable(), and touchRead().