Salve
a causa di un progetto particolare che ho in lavorazione da tempo ormai, mi necessita modificare la suddetta libreria, appunto la TFTLCD di adafruit, ma non riesco con le mie modeste capacità di programmazione ad interpretare bene l'assegnazione dei pin Data.
Per favore, aiutatemi a liberare un solo pin compreso tra 2 e 7, spostando il relativo segnale del display su un qualsiasi altro pin. Aggiungo che non uso la SD, pertanto se ho ben capito, c'è possibilità di usare da 10 a 13 per lo spostamento.
Aggiungo la parte di codice che credo interessi il pin mapping.
Uso Arduino UNO.
Grazie
#ifdef USE_ADAFRUIT_SHIELD_PINOUT
// LCD control lines:
// RD (read), WR (write), CD (command/data), CS (chip select)
#define RD_PORT PORTC /*pin A0 */
#define WR_PORT PORTC /*pin A1 */
#define CD_PORT PORTC /*pin A2 */
#define CS_PORT PORTC /*pin A3 */
#define RD_MASK B00000001
#define WR_MASK B00000010
#define CD_MASK B00000100
#define CS_MASK B00001000
// These are macros for I/O operations...
// Write 8-bit value to LCD data lines
#define write8inline(d) { \
PORTD = (PORTD & B00101111) | ((d) & B11010000); \
PORTB = (PORTB & B11010000) | ((d) & B00101111); \
WR_STROBE; } // STROBEs are defined later
// Read 8-bit value from LCD data lines. The signle argument
// is a destination variable; this isn't a function and doesn't
// return a value in the conventional sense.
#define read8inline(result) { \
RD_ACTIVE; \
DELAY7; \
result = (PIND & B11010000) | (PINB & B00101111); \
RD_IDLE; }
// These set the PORT directions as required before the write and read
// operations. Because write operations are much more common than reads,
// the data-reading functions in the library code set the PORT(s) to
// input before a read, and restore them back to the write state before
// returning. This avoids having to set it for output inside every
// drawing method. The default state has them initialized for writes.
#define setWriteDirInline() { DDRD |= B11010000; DDRB |= B00101111; }
#define setReadDirInline() { DDRD &= ~B11010000; DDRB &= ~B00101111; }
Questo si trova nel file pin_magic.h