Arduino-LCD
LCD library for Arduino
LCD4884.h
Go to the documentation of this file.
1 
19 #ifndef LCD4884_H
20 #define LCD4884_H
21 
22 #include "LCD.h"
23 #include "GPIO.h"
24 #include "Keypad.h"
25 #include "Driver/PCD8544.h"
26 
31 class LCD4884 :
32  public Keypad<A0>,
33  public PCD8544<BOARD::D5, BOARD::D4, BOARD::D3, BOARD::D2>
34 {
35 public:
36  enum {
37  NO_KEY = 0,
43  } __attribute__((packed));
44 
51  LCD4884(const uint8_t* font = NULL) :
52  Keypad(keymap()),
53  PCD8544(font)
54  {
55  m_rst.output();
56  m_bl.output();
57  }
58 
64  virtual bool begin()
65  {
66  m_rst.high();
67  return (PCD8544::begin());
68  }
69 
74  virtual void backlight_on()
75  {
76  m_bl.high();
77  }
78 
83  virtual void backlight_off()
84  {
85  m_bl.low();
86  }
87 
88 protected:
90  GPIO<BOARD::D6> m_rst;
91 
93  GPIO<BOARD::D7> m_bl;
94 
99  const uint16_t* keymap()
100  __attribute__((always_inline))
101  {
102  static const uint16_t map[] PROGMEM = {
103  800, 600, 400, 200, 50, 0
104  };
105  return (map);
106  }
107 };
108 
109 #endif
virtual void backlight_on()
Definition: LCD4884.h:74
GPIO< BOARD::D6 > m_rst
Definition: LCD4884.h:90
virtual bool begin()
Definition: PCD8544.h:187
LCD4884(const uint8_t *font=NULL)
Definition: LCD4884.h:51
GPIO< BOARD::D7 > m_bl
Definition: LCD4884.h:93
virtual bool begin()
Definition: LCD4884.h:64
virtual void backlight_off()
Definition: LCD4884.h:83
const uint16_t * keymap()
Definition: LCD4884.h:99