|
|
@@ -40,8 +40,13 @@
|
|
|
#define USE_FAST_PINIO ///< Use direct PORT register access
|
|
|
#define HAS_PORT_SET_CLR ///< PORTs have set & clear registers
|
|
|
#elif defined(CORE_TEENSY)
|
|
|
+ // PJRC Teensy 4.x
|
|
|
+ #if defined(__IMXRT1052__) || defined(__IMXRT1062__) // Teensy 4.x
|
|
|
+ typedef uint32_t PORT_t; ///< PORT values are 32-bit
|
|
|
// PJRC Teensy 3.x
|
|
|
+ #else
|
|
|
typedef uint8_t PORT_t; ///< PORT values are 8-bit
|
|
|
+ #endif
|
|
|
#define USE_FAST_PINIO ///< Use direct PORT register access
|
|
|
#define HAS_PORT_SET_CLR ///< PORTs have set & clear registers
|
|
|
#else
|
|
|
@@ -428,13 +433,24 @@ class Adafruit_SPITFT : public Adafruit_GFX {
|
|
|
} swspi; ///< Software SPI values
|
|
|
struct { // Values specific to 8-bit parallel:
|
|
|
#if defined(USE_FAST_PINIO)
|
|
|
+
|
|
|
+ #if defined(__IMXRT1052__) || defined(__IMXRT1062__) // Teensy 4.x
|
|
|
+ volatile uint32_t *writePort; ///< PORT register for DATA WRITE
|
|
|
+ volatile uint32_t *readPort; ///< PORT (PIN) register for DATA READ
|
|
|
+ #else
|
|
|
volatile uint8_t *writePort; ///< PORT register for DATA WRITE
|
|
|
volatile uint8_t *readPort; ///< PORT (PIN) register for DATA READ
|
|
|
+ #endif
|
|
|
#if defined(HAS_PORT_SET_CLR)
|
|
|
// Port direction register pointers are always 8-bit regardless of
|
|
|
// PORTreg_t -- even if 32-bit port, we modify a byte-aligned 8 bits.
|
|
|
+ #if defined(__IMXRT1052__) || defined(__IMXRT1062__) // Teensy 4.x
|
|
|
+ volatile uint32_t *dirSet; ///< PORT byte data direction SET
|
|
|
+ volatile uint32_t *dirClr; ///< PORT byte data direction CLEAR
|
|
|
+ #else
|
|
|
volatile uint8_t *dirSet; ///< PORT byte data direction SET
|
|
|
volatile uint8_t *dirClr; ///< PORT byte data direction CLEAR
|
|
|
+ #endif
|
|
|
PORTreg_t wrPortSet; ///< PORT register for write strobe SET
|
|
|
PORTreg_t wrPortClr; ///< PORT register for write strobe CLEAR
|
|
|
PORTreg_t rdPortSet; ///< PORT register for read strobe SET
|