Adafruit Library
Adafruit_miniTFTWing.h
1 #ifndef _MINI_TFT_WING_H
2 #define _MINI_TFT_WING_H
3 
4 #include "Adafruit_seesaw.h"
5 
6 #define TFTWING_ADDR 0x5E
7 #define TFTWING_RESET_PIN 8
8 
9 #define TFTWING_BACKLIGHT_ON 0 // inverted output!
10 #define TFTWING_BACKLIGHT_OFF 0xFFFF // inverted output!
11 
12 #define TFTWING_BUTTON_UP_PIN 2
13 #define TFTWING_BUTTON_UP (1UL << TFTWING_BUTTON_UP_PIN)
14 
15 #define TFTWING_BUTTON_DOWN_PIN 4
16 #define TFTWING_BUTTON_DOWN (1UL << TFTWING_BUTTON_DOWN_PIN)
17 
18 #define TFTWING_BUTTON_LEFT_PIN 3
19 #define TFTWING_BUTTON_LEFT (1UL << TFTWING_BUTTON_LEFT_PIN)
20 
21 #define TFTWING_BUTTON_RIGHT_PIN 7
22 #define TFTWING_BUTTON_RIGHT (1UL << TFTWING_BUTTON_RIGHT_PIN)
23 
24 #define TFTWING_BUTTON_SELECT_PIN 11
25 #define TFTWING_BUTTON_SELECT (1UL << TFTWING_BUTTON_SELECT_PIN)
26 
27 #define TFTWING_BUTTON_A_PIN 10
28 #define TFTWING_BUTTON_A (1UL << TFTWING_BUTTON_A_PIN)
29 
30 #define TFTWING_BUTTON_B_PIN 9
31 #define TFTWING_BUTTON_B (1UL << TFTWING_BUTTON_B_PIN)
32 
33 #define TFTWING_BUTTON_ALL \
34  (TFTWING_BUTTON_UP | TFTWING_BUTTON_DOWN | TFTWING_BUTTON_LEFT | \
35  TFTWING_BUTTON_RIGHT | TFTWING_BUTTON_SELECT | TFTWING_BUTTON_A | \
36  TFTWING_BUTTON_B)
37 
38 /**************************************************************************/
43 /**************************************************************************/
45 public:
48 
49  bool begin(uint8_t addr = TFTWING_ADDR, int8_t flow = -1);
50 
51  void setBacklight(uint16_t value);
52  void setBacklightFreq(uint16_t freq);
53  void tftReset(bool rst = true);
54  uint32_t readButtons();
55 };
56 
57 #endif
void setBacklight(uint16_t value)
set the value of the backlight
Definition: Adafruit_miniTFTWing.cpp:28
Class that stores state and functions for interacting with seesaw helper IC.
Definition: Adafruit_seesaw.h:234
bool begin(uint8_t addr=TFTWING_ADDR, int8_t flow=-1)
set up the miniTFTWing
Definition: Adafruit_miniTFTWing.cpp:11
Class that stores state and functions for interacting with mini tft wing variant of seesaw helper IC...
Definition: Adafruit_miniTFTWing.h:44
void setBacklightFreq(uint16_t freq)
set the PWM frequency for the backlight
Definition: Adafruit_miniTFTWing.cpp:39
uint32_t readButtons()
read all buttons on the wing and return as a 32 bit integer
Definition: Adafruit_miniTFTWing.cpp:60
void tftReset(bool rst=true)
reset the TFT screen by setting the value of the reset pin
Definition: Adafruit_miniTFTWing.cpp:50