This commit is contained in:
Melissa LeBlanc-Williams 2019-05-09 14:32:16 -07:00
commit 898773f095
3 changed files with 55 additions and 13 deletions

View File

@ -662,7 +662,7 @@ void Adafruit_GFX::fillTriangle(int16_t x0, int16_t y0,
@param y Top left corner y coordinate
@param bitmap byte array with monochrome bitmap
@param w Width of bitmap in pixels
@param h Hieght of bitmap in pixels
@param h Height of bitmap in pixels
@param color 16-bit 5-6-5 Color to draw with
*/
/**************************************************************************/
@ -690,7 +690,7 @@ void Adafruit_GFX::drawBitmap(int16_t x, int16_t y,
@param y Top left corner y coordinate
@param bitmap byte array with monochrome bitmap
@param w Width of bitmap in pixels
@param h Hieght of bitmap in pixels
@param h Height of bitmap in pixels
@param color 16-bit 5-6-5 Color to draw pixels with
@param bg 16-bit 5-6-5 Color to draw background with
*/
@ -720,7 +720,7 @@ void Adafruit_GFX::drawBitmap(int16_t x, int16_t y,
@param y Top left corner y coordinate
@param bitmap byte array with monochrome bitmap
@param w Width of bitmap in pixels
@param h Hieght of bitmap in pixels
@param h Height of bitmap in pixels
@param color 16-bit 5-6-5 Color to draw with
*/
/**************************************************************************/
@ -748,7 +748,7 @@ void Adafruit_GFX::drawBitmap(int16_t x, int16_t y,
@param y Top left corner y coordinate
@param bitmap byte array with monochrome bitmap
@param w Width of bitmap in pixels
@param h Hieght of bitmap in pixels
@param h Height of bitmap in pixels
@param color 16-bit 5-6-5 Color to draw pixels with
@param bg 16-bit 5-6-5 Color to draw background with
*/
@ -781,7 +781,7 @@ void Adafruit_GFX::drawBitmap(int16_t x, int16_t y,
@param y Top left corner y coordinate
@param bitmap byte array with monochrome bitmap
@param w Width of bitmap in pixels
@param h Hieght of bitmap in pixels
@param h Height of bitmap in pixels
@param color 16-bit 5-6-5 Color to draw pixels with
*/
/**************************************************************************/
@ -813,7 +813,7 @@ void Adafruit_GFX::drawXBitmap(int16_t x, int16_t y,
@param y Top left corner y coordinate
@param bitmap byte array with grayscale bitmap
@param w Width of bitmap in pixels
@param h Hieght of bitmap in pixels
@param h Height of bitmap in pixels
*/
/**************************************************************************/
void Adafruit_GFX::drawGrayscaleBitmap(int16_t x, int16_t y,
@ -835,7 +835,7 @@ void Adafruit_GFX::drawGrayscaleBitmap(int16_t x, int16_t y,
@param y Top left corner y coordinate
@param bitmap byte array with grayscale bitmap
@param w Width of bitmap in pixels
@param h Hieght of bitmap in pixels
@param h Height of bitmap in pixels
*/
/**************************************************************************/
void Adafruit_GFX::drawGrayscaleBitmap(int16_t x, int16_t y,

View File

@ -255,9 +255,16 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs,
@param rst Arduino pin # for display reset (optional, display reset
can be tied to MCU reset, default of -1 means unused).
@return Adafruit_SPITFT object.
@note Output pins are not initialized; application typically will
need to call subclass' begin() function, which in turn calls
this library's initSPI() function to initialize pins.
@note Output pins are not initialized in constructor; application
typically will need to call subclass' begin() function, which
in turn calls this library's initSPI() function to initialize
pins. EXCEPT...if you have built your own SERCOM SPI peripheral
(calling the SPIClass constructor) rather than one of the
built-in SPI devices (e.g. &SPI, &SPI1 and so forth), you will
need to call the begin() function for your object as well as
pinPeripheral() for the MOSI, MISO and SCK pins to configure
GPIO manually. Do this BEFORE calling the display-specific
begin or init function. Unfortunate but unavoidable.
*/
Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass,
int8_t cs, int8_t dc, int8_t rst) : Adafruit_GFX(w, h),
@ -517,8 +524,43 @@ void Adafruit_SPITFT::initSPI(uint32_t freq) {
#else
hwspi._freq = freq; // Save freq value for later
#endif
// Call hwspi._spi->begin() ONLY if this is among the 'established'
// SPI interfaces in variant.h. For DIY roll-your-own SERCOM SPIs,
// begin() and pinPeripheral() calls MUST be made in one's calling
// code, BEFORE the screen-specific begin/init function is called.
// Reason for this is that SPI::begin() makes its own calls to
// pinPeripheral() based on g_APinDescription[n].ulPinType, which
// on non-established SPI interface pins will always be PIO_DIGITAL
// or similar, while we need PIO_SERCOM or PIO_SERCOM_ALT...it's
// highly unique between devices and variants for each pin or
// SERCOM so we can't make those calls ourselves here. And the SPI
// device needs to be set up before calling this because it's
// immediately followed with initialization commands. Blargh.
if(
#if !defined(SPI_INTERFACES_COUNT)
1
#endif
#if SPI_INTERFACES_COUNT > 0
(hwspi._spi == &SPI)
#endif
#if SPI_INTERFACES_COUNT > 1
|| (hwspi._spi == &SPI1)
#endif
#if SPI_INTERFACES_COUNT > 2
|| (hwspi._spi == &SPI2)
#endif
#if SPI_INTERFACES_COUNT > 3
|| (hwspi._spi == &SPI3)
#endif
#if SPI_INTERFACES_COUNT > 4
|| (hwspi._spi == &SPI4)
#endif
#if SPI_INTERFACES_COUNT > 5
|| (hwspi._spi == &SPI5)
#endif
) {
hwspi._spi->begin();
}
} else if(connection == TFT_SOFT_SPI) {
pinMode(swspi._mosi, OUTPUT);

View File

@ -1,5 +1,5 @@
name=Adafruit GFX Library
version=1.4.11
version=1.4.13
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=Adafruit GFX graphics core library, this is the 'core' class that all our other graphics libraries derive from.