|
40 | 40 | #define USE_FAST_PINIO ///< Use direct PORT register access |
41 | 41 | #define HAS_PORT_SET_CLR ///< PORTs have set & clear registers |
42 | 42 | #elif defined(CORE_TEENSY) |
| 43 | + // PJRC Teensy 4.x |
| 44 | + #if defined(__IMXRT1052__) || defined(__IMXRT1062__) // Teensy 4.x |
| 45 | + typedef uint32_t PORT_t; ///< PORT values are 32-bit |
43 | 46 | // PJRC Teensy 3.x |
| 47 | + #else |
44 | 48 | typedef uint8_t PORT_t; ///< PORT values are 8-bit |
| 49 | + #endif |
45 | 50 | #define USE_FAST_PINIO ///< Use direct PORT register access |
46 | 51 | #define HAS_PORT_SET_CLR ///< PORTs have set & clear registers |
47 | 52 | #else |
@@ -428,13 +433,24 @@ class Adafruit_SPITFT : public Adafruit_GFX { |
428 | 433 | } swspi; ///< Software SPI values |
429 | 434 | struct { // Values specific to 8-bit parallel: |
430 | 435 | #if defined(USE_FAST_PINIO) |
| 436 | + |
| 437 | + #if defined(__IMXRT1052__) || defined(__IMXRT1062__) // Teensy 4.x |
| 438 | + volatile uint32_t *writePort; ///< PORT register for DATA WRITE |
| 439 | + volatile uint32_t *readPort; ///< PORT (PIN) register for DATA READ |
| 440 | + #else |
431 | 441 | volatile uint8_t *writePort; ///< PORT register for DATA WRITE |
432 | 442 | volatile uint8_t *readPort; ///< PORT (PIN) register for DATA READ |
| 443 | + #endif |
433 | 444 | #if defined(HAS_PORT_SET_CLR) |
434 | 445 | // Port direction register pointers are always 8-bit regardless of |
435 | 446 | // PORTreg_t -- even if 32-bit port, we modify a byte-aligned 8 bits. |
| 447 | + #if defined(__IMXRT1052__) || defined(__IMXRT1062__) // Teensy 4.x |
| 448 | + volatile uint32_t *dirSet; ///< PORT byte data direction SET |
| 449 | + volatile uint32_t *dirClr; ///< PORT byte data direction CLEAR |
| 450 | + #else |
436 | 451 | volatile uint8_t *dirSet; ///< PORT byte data direction SET |
437 | 452 | volatile uint8_t *dirClr; ///< PORT byte data direction CLEAR |
| 453 | + #endif |
438 | 454 | PORTreg_t wrPortSet; ///< PORT register for write strobe SET |
439 | 455 | PORTreg_t wrPortClr; ///< PORT register for write strobe CLEAR |
440 | 456 | PORTreg_t rdPortSet; ///< PORT register for read strobe SET |
|
0 commit comments