Adafruit Library
Adafruit_TFTShield18.h
1 #ifndef _TFT_SHIELD_18_H
2 #define _TFT_SHIELD_18_H
3 
4 #include "Adafruit_seesaw.h"
5 
6 #define TFTSHIELD_ADDR 0x2E
7 #define TFTSHIELD_RESET_PIN 3
8 
9 #define TFTSHIELD_BACKLIGHT_ON 0xFFFF
10 #define TFTSHIELD_BACKLIGHT_OFF 0x0000
11 
12 #define TFTSHIELD_BUTTON_UP_PIN 5
13 #define TFTSHIELD_BUTTON_UP (1UL << TFTSHIELD_BUTTON_UP_PIN)
14 
15 #define TFTSHIELD_BUTTON_DOWN_PIN 8
16 #define TFTSHIELD_BUTTON_DOWN (1UL << TFTSHIELD_BUTTON_DOWN_PIN)
17 
18 #define TFTSHIELD_BUTTON_LEFT_PIN 6
19 #define TFTSHIELD_BUTTON_LEFT (1UL << TFTSHIELD_BUTTON_LEFT_PIN)
20 
21 #define TFTSHIELD_BUTTON_RIGHT_PIN 9
22 #define TFTSHIELD_BUTTON_RIGHT (1UL << TFTSHIELD_BUTTON_RIGHT_PIN)
23 
24 #define TFTSHIELD_BUTTON_IN_PIN 7
25 #define TFTSHIELD_BUTTON_IN (1UL << TFTSHIELD_BUTTON_IN_PIN)
26 
27 #define TFTSHIELD_BUTTON_1_PIN 10
28 #define TFTSHIELD_BUTTON_1 (1UL << TFTSHIELD_BUTTON_1_PIN)
29 
30 #define TFTSHIELD_BUTTON_2_PIN 11
31 #define TFTSHIELD_BUTTON_2 (1UL << TFTSHIELD_BUTTON_2_PIN)
32 
33 #define TFTSHIELD_BUTTON_3_PIN 14
34 #define TFTSHIELD_BUTTON_3 (1UL << TFTSHIELD_BUTTON_3_PIN)
35 
36 #define TFTSHIELD_BUTTON_ALL \
37  (TFTSHIELD_BUTTON_UP | TFTSHIELD_BUTTON_DOWN | TFTSHIELD_BUTTON_LEFT | \
38  TFTSHIELD_BUTTON_RIGHT | TFTSHIELD_BUTTON_IN | TFTSHIELD_BUTTON_1 | \
39  TFTSHIELD_BUTTON_2 | TFTSHIELD_BUTTON_3)
40 
41 /**************************************************************************/
46 /**************************************************************************/
48 public:
51 
52  bool begin(uint8_t addr = TFTSHIELD_ADDR, int8_t flow = -1);
53 
54  void setBacklight(uint16_t value);
55  void setBacklightFreq(uint16_t freq);
56  void tftReset(bool rst = true);
57  uint32_t readButtons();
58 };
59 
60 #endif
uint32_t readButtons()
read all buttons on the wing and return as a 32 bit integer
Definition: Adafruit_TFTShield18.cpp:63
void tftReset(bool rst=true)
reset the TFT screen by setting the value of the reset pin
Definition: Adafruit_TFTShield18.cpp:53
void setBacklight(uint16_t value)
set the intensity of the backlight
Definition: Adafruit_TFTShield18.cpp:31
Class that stores state and functions for interacting with seesaw helper IC.
Definition: Adafruit_seesaw.h:234
Class that stores state and functions for interacting with 1.8" tft shield variant of seesaw helper I...
Definition: Adafruit_TFTShield18.h:47
bool begin(uint8_t addr=TFTSHIELD_ADDR, int8_t flow=-1)
set up the TFT shield
Definition: Adafruit_TFTShield18.cpp:11
void setBacklightFreq(uint16_t freq)
set the PWM frequency for the backlight
Definition: Adafruit_TFTShield18.cpp:42