30 char c = (char) m_buf[0];
31 if (c != (
char) COMMAND) {
33 for (uint8_t i = 1; i < size; i++)
39 uint8_t cmd = m_buf[1];
44 case DISPLAY_ON_CMD: m_lcd->
display_on();
return;
49 info_t* info = (info_t*) m_buf;
71 buf[0] = Slave::COMMAND;
76 int res =
twi.
write(buf,
sizeof(buf));
77 if (res ==
sizeof(buf))
break;
86 write(Slave::INIT_CMD);
91 int res =
twi.
read(&info,
sizeof(info));
92 if (res ==
sizeof(info))
break;
112 write(Slave::BACKLIGHT_OFF_CMD);
118 write(Slave::BACKLIGHT_ON_CMD);
124 write(Slave::DISPLAY_OFF_CMD);
130 write(Slave::DISPLAY_ON_CMD);
159 if (n != 1)
return (-1);
160 if (c >=
' ')
return (c & 0xff);
190 int n =
twi.
write((
void*) buf, size);
192 if (n < 0)
return (-1);
uint8_t m_y
Cursor position y.
virtual int putchar(char c)
uint8_t m_x
Cursor position x.
virtual void backlight_on()
virtual void display_on()
virtual int write(const void *buf, size_t size)
virtual void display_off()=0
virtual void backlight_off()
virtual int putchar(char c)
virtual void set_cursor(uint8_t x, uint8_t y)=0
virtual void display_on()=0
virtual void backlight_off()
int read(void *buf, size_t size)
virtual void backlight_on()
virtual void display_off()
virtual void display_clear()=0
int write(void *buf, size_t size)
virtual void display_clear()
void(* sleep)(uint16_t s)
void acquire(TWI::Driver *dev)
virtual void set_cursor(uint8_t x, uint8_t y)
virtual void on_request(void *buf, size_t size)