Arduino-LCD
LCD library for Arduino
Debug.h
Go to the documentation of this file.
1 
18 #ifndef LCD_ADAPTER_DEBUG_H
19 #define LCD_ADAPTER_DEBUG_H
20 
21 #include "LCD.h"
22 #include "Driver/HD44780.h"
23 
28 namespace LCD {
29 class Debug : public HD44780::Adapter {
30 public:
31  Debug(Print& os) : m_os(os) {}
32 
33  virtual bool setup()
34  {
35  m_os.print(millis());
36  m_os.println(F(":setup:"));
37  return (false);
38  }
39 
40  virtual void write4b(uint8_t data)
41  {
42  m_os.print(millis());
43  m_os.print(F(":write4b:"));
44  m_os.println(data & 0xf, HEX);
45  }
46 
47  virtual void write8b(uint8_t data)
48  {
49  m_os.print(millis());
50  m_os.print(F(":write8b:"));
51  if (data < 0x10) m_os.print('0');
52  m_os.println(data, HEX);
53  }
54 
55  virtual void set_mode(uint8_t flag)
56  {
57  m_os.print(millis());
58  m_os.print(F(":set_mode:"));
59  if (flag < 0x10) m_os.print('0');
60  m_os.println(flag, HEX);
61  }
62 
63  virtual void set_backlight(uint8_t flag)
64  {
65  m_os.print(millis());
66  m_os.print(F(":set_backlight:"));
67  if (flag < 0x10) m_os.print('0');
68  m_os.println(flag, HEX);
69  }
70 
71 protected:
72  Print& m_os;
73 };
74 };
75 #endif
Print & m_os
Definition: Debug.h:72
virtual bool setup()
Definition: Debug.h:33
Definition: Debug.h:28
virtual void write8b(uint8_t data)
Definition: Debug.h:47
virtual void write4b(uint8_t data)
Definition: Debug.h:40
virtual void set_backlight(uint8_t flag)
Definition: Debug.h:63
Debug(Print &os)
Definition: Debug.h:31
virtual void set_mode(uint8_t flag)
Definition: Debug.h:55