COSA
An Object-Oriented Platform for Arduino Programming
|
#include <HD44780.hh>
Public Member Functions | |
SR4W (Board::DigitalPin sda=Board::D7, Board::DigitalPin scl=Board::D6, Board::DigitalPin en=Board::D5, Board::DigitalPin bt=Board::D4) | |
virtual bool | setup () |
virtual void | write4b (uint8_t data) |
virtual void | write8b (uint8_t data) |
virtual void | set_mode (uint8_t flag) |
virtual void | set_backlight (uint8_t flag) |
virtual void | write8n (const void *buf, size_t size) |
Protected Attributes | |
OutputPin | m_sda |
Serial data output. More... | |
OutputPin | m_scl |
Serial clock. More... | |
OutputPin | m_en |
Starts data read/write. More... | |
OutputPin | m_bt |
Backlight control. More... | |
uint8_t | m_rs |
Command/Data select. More... | |
Static Protected Attributes | |
static const uint16_t | SHORT_EXEC_TIME = 16 |
HD44780 (LCD-II) Dot Matix Liquid Crystal Display Controller/Driver Shift Register 4-Wire/8-bit Port, 74HC595 (SR[pin]), with digital output pins.
Alternative circuit with 74HC164.
Delay required even when using Cosa serial write. No need for SPI. SCL/SDA can still be connected to other inputs. The Backlight control pin (BT) can be removed if always on.
Inspired by AVR2LCD, a solution by Frank Henriquez. The original 74HC164 based design is by Stefan Heinzmann and Marc Simons. http://frank.bol.ucla.edu/avr2lcd.htm http://web.archive.org/web/20100210142839/ http://home.iae.nl/users/pouweha/lcd/lcd_examp.shtml#_3
Definition at line 763 of file HD44780.hh.
HD44780::SR4W::SR4W | ( | Board::DigitalPin | sda = Board::D7 , |
Board::DigitalPin | scl = Board::D6 , |
||
Board::DigitalPin | en = Board::D5 , |
||
Board::DigitalPin | bt = Board::D4 |
||
) |
Construct HD44780 4-wire/8-bit serial port connected to given data, clock, enable and backlight control pins.
[in] | sda | serial data pin (Default D7, Tiny/D1) |
[in] | scl | serial clock pin (Default D6, Tiny/D2) |
[in] | en | enable pulse (Default D5, Tiny/D3) |
[in] | bt | backlight control (Default D4, Tiny/D4) |
Definition at line 23 of file HD44780_SR4W.cpp.
|
virtual |
Set backlight on/off using bt pin.
[in] | flag. |
Implements HD44780::IO.
Definition at line 66 of file HD44780_SR4W.cpp.
|
virtual |
Set instruction/data mode using given rs pin; zero for instruction, non-zero for data mode.
[in] | flag. |
Implements HD44780::IO.
Definition at line 60 of file HD44780_SR4W.cpp.
|
virtual |
Initiate port for 8-bit serial mode. Returns true(1).
Implements HD44780::IO.
Definition at line 36 of file HD44780_SR4W.cpp.
|
virtual |
Write LSB nibble to display using serial port.
[in] | data | (4b) to write. |
Implements HD44780::IO.
Definition at line 42 of file HD44780_SR4W.cpp.
|
virtual |
Write byte (8bit) to display.
[in] | data | (8b) to write. |
Reimplemented from HD44780::IO.
Definition at line 48 of file HD44780_SR4W.cpp.
|
virtualinherited |
Write character buffer to display.
[in] | buf | pointer to buffer. |
[in] | size | number of bytes in buffer. |
Reimplemented in ERM1602_5, Adafruit_I2C_LCD_Backpack, DFRobot_IIC_LCD_Module, MJKDZ_LCD_Module, and SainSmart_LCD2004.
Definition at line 31 of file HD44780_IO.cpp.
|
protected |
Backlight control.
Definition at line 828 of file HD44780.hh.
|
protected |
Starts data read/write.
Definition at line 827 of file HD44780.hh.
|
protected |
Command/Data select.
Definition at line 829 of file HD44780.hh.
|
protected |
Serial clock.
Definition at line 826 of file HD44780.hh.
|
protected |
Serial data output.
Definition at line 825 of file HD44780.hh.
|
staticprotected |
Execution time delay (us).
Definition at line 823 of file HD44780.hh.