Fork of https://os.mbed.com/users/sebastiken/code/Adafruit_RA8875/ ; Adapted for use with K64F and in the process of adding more functions.
Diff: RA8875.cpp
- Revision:
- 2:040a687cea93
- Parent:
- 1:ac22f0f36d6b
- Child:
- 3:4a3e169866a2
--- a/RA8875.cpp Fri Sep 08 14:14:54 2017 +0000 +++ b/RA8875.cpp Fri Sep 08 16:30:24 2017 +0000 @@ -63,13 +63,12 @@ */ /**************************************************************************/ Adafruit_RA8875::Adafruit_RA8875(PinName MOSI, PinName MISO, PinName SCLK, - PinName CS, PinName RST, Serial *pc) + PinName CS, PinName RST) : //Adafruit_GFX(800, 480) _cs(CS) , _rst(RST) , spi(MOSI, MISO, SCLK) { - pc = pc; } /**************************************************************************/ @@ -107,11 +106,10 @@ spi.format(8, 0); // Configure SPI frequency - spi_speed = 2000000; + spi_speed = 1000000; spi.frequency(spi_speed); uint8_t x = readReg(0); - pc->printf("x = 0x"); pc->printf("%x\n" , x); if (x != 0x75) { return false; } @@ -649,12 +647,12 @@ @args color[in] The RGB565 color to use when drawing the pixel */ /**************************************************************************/ -/* + void Adafruit_RA8875::drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color) { circleHelper(x0, y0, r, color, false); } -*/ + /**************************************************************************/ /*! Draws a HW accelerated filled circle on the display @@ -665,12 +663,12 @@ @args color[in] The RGB565 color to use when drawing the pixel */ /**************************************************************************/ -/* + void Adafruit_RA8875::fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color) { circleHelper(x0, y0, r, color, true); } -*/ + /**************************************************************************/ /*! Draws a HW accelerated triangle on the display @@ -684,12 +682,12 @@ @args color[in] The RGB565 color to use when drawing the pixel */ /**************************************************************************/ -/* + 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) { triangleHelper(x0, y0, x1, y1, x2, y2, color, false); } -*/ + /**************************************************************************/ /*! Draws a HW accelerated filled triangle on the display @@ -703,12 +701,12 @@ @args color[in] The RGB565 color to use when drawing the pixel */ /**************************************************************************/ -/* + 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) { triangleHelper(x0, y0, x1, y1, x2, y2, color, true); } -*/ + /**************************************************************************/ /*! Draws a HW accelerated ellipse on the display @@ -720,12 +718,12 @@ @args color[in] The RGB565 color to use when drawing the pixel */ /**************************************************************************/ -/* + void Adafruit_RA8875::drawEllipse(int16_t xCenter, int16_t yCenter, int16_t longAxis, int16_t shortAxis, uint16_t color) { ellipseHelper(xCenter, yCenter, longAxis, shortAxis, color, false); } -*/ + /**************************************************************************/ /*! Draws a HW accelerated filled ellipse on the display @@ -737,12 +735,12 @@ @args color[in] The RGB565 color to use when drawing the pixel */ /**************************************************************************/ -/* + void Adafruit_RA8875::fillEllipse(int16_t xCenter, int16_t yCenter, int16_t longAxis, int16_t shortAxis, uint16_t color) { ellipseHelper(xCenter, yCenter, longAxis, shortAxis, color, true); } -*/ + /**************************************************************************/ /*! Draws a HW accelerated curve on the display @@ -759,12 +757,12 @@ @args color[in] The RGB565 color to use when drawing the pixel */ /**************************************************************************/ -/* + void Adafruit_RA8875::drawCurve(int16_t xCenter, int16_t yCenter, int16_t longAxis, int16_t shortAxis, uint8_t curvePart, uint16_t color) { curveHelper(xCenter, yCenter, longAxis, shortAxis, curvePart, color, false); } -*/ + /**************************************************************************/ /*! Draws a HW accelerated filled curve on the display @@ -781,12 +779,12 @@ @args color[in] The RGB565 color to use when drawing the pixel */ /**************************************************************************/ -/* + void Adafruit_RA8875::fillCurve(int16_t xCenter, int16_t yCenter, int16_t longAxis, int16_t shortAxis, uint8_t curvePart, uint16_t color) { curveHelper(xCenter, yCenter, longAxis, shortAxis, curvePart, color, true); } -*/ + /**************************************************************************/ /*! Helper function for higher level circle drawing code