Compare commits

...

6 Commits

Author SHA1 Message Date
Jiri Drozd
c1e064b824
Merge 3bb45ed24c into 0e32d7dc76 2024-10-02 01:20:28 +05:30
Tyeth Gundry
0e32d7dc76
Update library.properties - bump version to 1.11.10
Some checks failed
Arduino Library CI / build (push) Has been cancelled
2024-07-23 15:16:47 +01:00
Zane Bauman
5080bec822
Allow using ATtiny84 (#455)
Some checks failed
Arduino Library CI / build (push) Has been cancelled
2024-07-18 10:16:19 -04:00
Buger
3bb45ed24c Revert "added ARDUINO_ARCH_STM32 platform detection and change dc/rst/ce pin variables from int8_t to int16_t for this platform"
This reverts commit 83224c7198.
2021-11-01 21:14:20 +01:00
Buger
83224c7198 added ARDUINO_ARCH_STM32 platform detection and change dc/rst/ce pin variables from int8_t to int16_t for this platform 2021-11-01 20:16:08 +01:00
Buger
188f238fbc variables for pin definitions changed from int8_t to int16_t to make this comatible with stm32duino (tested using 2.1.0) 2021-11-01 18:13:10 +01:00
5 changed files with 40 additions and 36 deletions

View File

@ -15,7 +15,8 @@
*
*/
#if !defined(__AVR_ATtiny85__) // Not for ATtiny, at all
// Not for ATtiny, at all
#if !defined(__AVR_ATtiny85__) && !defined(__AVR_ATtiny84__)
#include "Adafruit_GrayOLED.h"
#include <Adafruit_GFX.h>

View File

@ -24,7 +24,8 @@
#ifndef _Adafruit_GRAYOLED_H_
#define _Adafruit_GRAYOLED_H_
#if !defined(__AVR_ATtiny85__) // Not for ATtiny, at all
// Not for ATtiny, at all
#if !defined(__AVR_ATtiny85__) && !defined(__AVR_ATtiny84__)
#include <Adafruit_GFX.h>
#include <Adafruit_I2CDevice.h>
@ -96,5 +97,5 @@ private:
TwoWire *_theWire = NULL; ///< The underlying hardware I2C
};
#endif // end __AVR_ATtiny85__
#endif // end __AVR_ATtiny85__ __AVR_ATtiny84__
#endif // _Adafruit_GrayOLED_H_

View File

@ -31,7 +31,8 @@
* BSD license, all text here must be included in any redistribution.
*/
#if !defined(__AVR_ATtiny85__) // Not for ATtiny, at all
// Not for ATtiny, at all
#if !defined(__AVR_ATtiny85__) && !defined(__AVR_ATtiny84__)
#include "Adafruit_SPITFT.h"
@ -114,9 +115,9 @@ static const struct {
need to call subclass' begin() function, which in turn calls
this library's initSPI() function to initialize pins.
*/
Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc,
int8_t mosi, int8_t sck, int8_t rst,
int8_t miso)
Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc,
int16_t mosi, int16_t sck, int16_t rst,
int16_t miso)
: Adafruit_GFX(w, h), connection(TFT_SOFT_SPI), _rst(rst), _cs(cs),
_dc(dc) {
swspi._sck = sck;
@ -235,15 +236,15 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc,
this library's initSPI() function to initialize pins.
*/
#if defined(ESP8266) // See notes below
Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc,
int8_t rst)
Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc,
int16_t rst)
: Adafruit_GFX(w, h), connection(TFT_HARD_SPI), _rst(rst), _cs(cs),
_dc(dc) {
hwspi._spi = &SPI;
}
#else // !ESP8266
Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc,
int8_t rst)
Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc,
int16_t rst)
: Adafruit_SPITFT(w, h, &SPI, cs, dc, rst) {
// This just invokes the hardware SPI constructor below,
// passing the default SPI device (&SPI).
@ -279,7 +280,7 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc,
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)
int16_t cs, int16_t dc, int16_t rst)
: Adafruit_GFX(w, h), connection(TFT_HARD_SPI), _rst(rst), _cs(cs),
_dc(dc) {
hwspi._spi = spiClass;
@ -375,8 +376,8 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass,
wanting to break existing code).
*/
Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, tftBusWidth busWidth,
int8_t d0, int8_t wr, int8_t dc, int8_t cs,
int8_t rst, int8_t rd)
int16_t d0, int16_t wr, int16_t dc, int16_t cs,
int16_t rst, int16_t rd)
: Adafruit_GFX(w, h), connection(TFT_PARALLEL), _rst(rst), _cs(cs),
_dc(dc) {
tft8._d0 = d0;
@ -2558,4 +2559,4 @@ inline void Adafruit_SPITFT::TFT_RD_LOW(void) {
#endif // end !USE_FAST_PINIO
}
#endif // end __AVR_ATtiny85__
#endif // end __AVR_ATtiny85__ __AVR_ATtiny84__

View File

@ -20,7 +20,8 @@
#ifndef _ADAFRUIT_SPITFT_H_
#define _ADAFRUIT_SPITFT_H_
#if !defined(__AVR_ATtiny85__) // Not for ATtiny, at all
// Not for ATtiny, at all
#if !defined(__AVR_ATtiny85__) && !defined(__AVR_ATtiny84__)
#include "Adafruit_GFX.h"
#include <SPI.h>
@ -127,23 +128,23 @@ public:
// (reset, miso). cs argument is required but can be -1 if unused --
// rather than moving it to the optional arguments, it was done this way
// to avoid breaking existing code (-1 option was a later addition).
Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, int8_t mosi,
int8_t sck, int8_t rst = -1, int8_t miso = -1);
Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, int16_t mosi,
int16_t sck, int16_t rst = -1, int16_t miso = -1);
// Hardware SPI constructor using the default SPI port: expects width &
// height (at default rotation setting 0), 2 signal pins (cs, dc),
// optional reset pin. cs is required but can be -1 if unused -- rather
// than moving it to the optional arguments, it was done this way to
// avoid breaking existing code (-1 option was a later addition).
Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc,
int8_t rst = -1);
Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc,
int16_t rst = -1);
#if !defined(ESP8266) // See notes in .cpp
// Hardware SPI constructor using an arbitrary SPI peripheral: expects
// width & height (rotation 0), SPIClass pointer, 2 signal pins (cs, dc)
// and optional reset pin. cs is required but can be -1 if unused.
Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass, int8_t cs,
int8_t dc, int8_t rst = -1);
Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass, int16_t cs,
int16_t dc, int16_t rst = -1);
#endif // end !ESP8266
// Parallel constructor: expects width & height (rotation 0), flag
@ -151,9 +152,9 @@ public:
// pins (d0, wr, dc), 3 optional pins (cs, rst, rd). 16-bit parallel
// isn't even fully implemented but the 'wide' flag was added as a
// required argument to avoid ambiguity with other constructors.
Adafruit_SPITFT(uint16_t w, uint16_t h, tftBusWidth busWidth, int8_t d0,
int8_t wr, int8_t dc, int8_t cs = -1, int8_t rst = -1,
int8_t rd = -1);
Adafruit_SPITFT(uint16_t w, uint16_t h, tftBusWidth busWidth, int16_t d0,
int16_t wr, int16_t dc, int16_t cs = -1, int16_t rst = -1,
int16_t rd = -1);
// DESTRUCTOR ----------------------------------------------------------
@ -436,9 +437,9 @@ protected:
ADAGFX_PORT_t misoPinMask; ///< Bitmask for MISO
#endif // end !KINETISK
#endif // end USE_FAST_PINIO
int8_t _mosi; ///< MOSI pin #
int8_t _miso; ///< MISO pin #
int8_t _sck; ///< SCK pin #
int16_t _mosi; ///< MOSI pin #
int16_t _miso; ///< MISO pin #
int16_t _sck; ///< SCK pin #
} swspi; ///< Software SPI values
struct { // Values specific to 8-bit parallel:
#if defined(USE_FAST_PINIO)
@ -480,9 +481,9 @@ protected:
ADAGFX_PORT_t rdPinMaskClr; ///< Bitmask for read strobe CLEAR (AND)
#endif // end HAS_PORT_SET_CLR
#endif // end USE_FAST_PINIO
int8_t _d0; ///< Data pin 0 #
int8_t _wr; ///< Write strobe pin #
int8_t _rd; ///< Read strobe pin # (or -1)
int16_t _d0; ///< Data pin 0 #
int16_t _wr; ///< Write strobe pin #
int16_t _rd; ///< Read strobe pin # (or -1)
bool wide = 0; ///< If true, is 16-bit interface
} tft8; ///< Parallel interface settings
#if defined(__cplusplus) && (__cplusplus >= 201100)
@ -514,9 +515,9 @@ protected:
#endif // end HAS_PORT_SET_CLR
#endif // end USE_FAST_PINIO
uint8_t connection; ///< TFT_HARD_SPI, TFT_SOFT_SPI, etc.
int8_t _rst; ///< Reset pin # (or -1)
int8_t _cs; ///< Chip select pin # (or -1)
int8_t _dc; ///< Data/command pin #
int16_t _rst; ///< Reset pin # (or -1)
int16_t _cs; ///< Chip select pin # (or -1)
int16_t _dc; ///< Data/command pin #
int16_t _xstart = 0; ///< Internal framebuffer X offset
int16_t _ystart = 0; ///< Internal framebuffer Y offset
@ -526,5 +527,5 @@ protected:
uint32_t _freq = 0; ///< Dummy var to keep subclasses happy
};
#endif // end __AVR_ATtiny85__
#endif // end __AVR_ATtiny85__ __AVR_ATtiny84__
#endif // end _ADAFRUIT_SPITFT_H_

View File

@ -1,5 +1,5 @@
name=Adafruit GFX Library
version=1.11.9
version=1.11.10
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.