COSA
An Object-Oriented Platform for Arduino Programming
HD44780_SR3WSPI.cpp
Go to the documentation of this file.
1 
21 #include "HD44780.hh"
22 
24  SPI::Driver(en, SPI::PULSE_HIGH),
25  m_port()
26 {
27 }
28 
29 bool
31 {
32  return (false);
33 }
34 
35 void
37 {
38  m_port.data = data;
39  spi.acquire(this);
40  spi.begin();
42  spi.end();
43  spi.release();
44 }
45 
46 void
48 {
49  spi.acquire(this);
50  spi.begin();
51  m_port.data = (data >> 4);
53  m_port.data = data;
54  m_cs._toggle();
55  m_cs._toggle();
57  spi.end();
58  spi.release();
60 }
61 
62 void
64 {
65  m_port.rs = flag;
66 }
67 
68 void
70 {
71  m_port.bt = flag;
72 }
SR3WSPI(Board::DigitalPin en=Board::D5)
uint8_t transfer(uint8_t data)
Definition: SOFT_SPI.cpp:87
static const uint16_t SHORT_EXEC_TIME
Definition: HD44780.hh:670
uint8_t data
Data port (Q0..Q3).
Definition: HD44780.hh:679
Definition: SPI.hh:57
void acquire(Driver *dev)
Definition: SOFT_SPI.cpp:43
virtual void set_backlight(uint8_t flag)
virtual void write8b(uint8_t data)
#define DELAY(us)
Definition: Types.h:280
virtual void set_mode(uint8_t flag)
uint8_t rs
Command/Data select (Q4).
Definition: HD44780.hh:680
void _toggle() const
Definition: OutputPin.hh:153
void begin()
Definition: SPI.hh:216
void end()
Definition: SPI.hh:226
virtual bool setup()
uint8_t bt
Back-light control (Q5).
Definition: HD44780.hh:681
virtual void write4b(uint8_t data)
SPI spi
Definition: SPI.cpp:29
void release()
Definition: SOFT_SPI.cpp:64
OutputPin m_cs
Device chip select pin.
Definition: SPI.hh:166
port_t m_port
Port setting.
Definition: HD44780.hh:694