COSA
An Object-Oriented Platform for Arduino Programming
HD44780_Port4b.cpp
Go to the documentation of this file.
1 
21 #include "Cosa/Board.hh"
22 #if !defined(BOARD_ATTINYX5)
23 #include "HD44780.hh"
24 
25 bool
27 {
28  return (false);
29 }
30 
31 void
33 {
34  synchronized {
35  m_d0._set(data & 0x01);
36  m_d1._set(data & 0x02);
37  m_d2._set(data & 0x04);
38  m_d3._set(data & 0x08);
39  m_en._toggle();
40  m_en._toggle();
41  }
42 }
43 
44 void
46 {
47  synchronized {
48  m_d0._set(data & 0x10);
49  m_d1._set(data & 0x20);
50  m_d2._set(data & 0x40);
51  m_d3._set(data & 0x80);
52  m_en._toggle();
53  m_en._toggle();
54  m_d0._set(data & 0x01);
55  m_d1._set(data & 0x02);
56  m_d2._set(data & 0x04);
57  m_d3._set(data & 0x08);
58  m_en._toggle();
59  m_en._toggle();
60  }
62 }
63 
64 void
66 {
67  m_rs.write(flag);
68 }
69 
70 void
72 {
73  m_bt.write(flag);
74 }
75 #endif
OutputPin m_d1
Data pin; d1.
Definition: HD44780.hh:421
virtual void set_backlight(uint8_t flag)
OutputPin m_bt
Back-light control (0/on, 1/off).
Definition: HD44780.hh:426
virtual bool setup()
OutputPin m_d2
Data pin; d2.
Definition: HD44780.hh:422
OutputPin m_d0
Data pin; d0.
Definition: HD44780.hh:420
virtual void write8b(uint8_t data)
#define DELAY(us)
Definition: Types.h:280
void write(int value) const
Definition: OutputPin.hh:236
virtual void write4b(uint8_t data)
void _toggle() const
Definition: OutputPin.hh:153
OutputPin m_rs
Register select (0/instruction, 1/data).
Definition: HD44780.hh:424
void _set() const
Definition: OutputPin.hh:75
OutputPin m_en
Starts data read/write.
Definition: HD44780.hh:425
OutputPin m_d3
Data pin; d3.
Definition: HD44780.hh:423
virtual void set_mode(uint8_t flag)
static const uint16_t SHORT_EXEC_TIME
Definition: HD44780.hh:418