COSA
An Object-Oriented Platform for Arduino Programming
HD44780_SR4W.cpp
Go to the documentation of this file.
1 
21 #include "HD44780.hh"
22 
26  Board::DigitalPin bt) :
27  m_sda(sda),
28  m_scl(scl),
29  m_en(en),
30  m_bt(bt, 1),
31  m_rs(0)
32 {
33 }
34 
35 bool
37 {
38  return (true);
39 }
40 
41 void
43 {
44  write8b(data);
45 }
46 
47 void
49 {
50  m_sda.write(data, m_scl);
51  synchronized {
52  m_sda._write(m_rs);
53  m_en._toggle();
54  m_en._toggle();
55  }
57 }
58 
59 void
61 {
62  m_rs = flag;
63 }
64 
65 void
67 {
68  m_bt.write(flag);
69 }
uint8_t m_rs
Command/Data select.
Definition: HD44780.hh:829
virtual void write4b(uint8_t data)
static const uint16_t SHORT_EXEC_TIME
Definition: HD44780.hh:823
virtual void set_mode(uint8_t flag)
#define DELAY(us)
Definition: Types.h:280
virtual void set_backlight(uint8_t flag)
OutputPin m_sda
Serial data output.
Definition: HD44780.hh:825
void write(int value) const
Definition: OutputPin.hh:236
SR4W(Board::DigitalPin sda=Board::D7, Board::DigitalPin scl=Board::D6, Board::DigitalPin en=Board::D5, Board::DigitalPin bt=Board::D4)
void _toggle() const
Definition: OutputPin.hh:153
virtual void write8b(uint8_t data)
OutputPin m_scl
Serial clock.
Definition: HD44780.hh:826
void _write(int value) const
Definition: OutputPin.hh:219
OutputPin m_en
Starts data read/write.
Definition: HD44780.hh:827
virtual bool setup()
OutputPin m_bt
Backlight control.
Definition: HD44780.hh:828