COSA
An Object-Oriented Platform for Arduino Programming
ERM1602_5 Class Reference

#include <ERM1602_5.hh>

Inheritance diagram for ERM1602_5:
Inheritance graph
Collaboration diagram for ERM1602_5:
Collaboration graph

Public Member Functions

 ERM1602_5 (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 write8n (const void *buf, size_t size)
 
virtual void set_mode (uint8_t flag)
 
virtual void set_backlight (uint8_t flag)
 

Protected Member Functions

void flush ()
 

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
 Back-light control (0/on, 1/off). More...
 
uint8_t m_rs
 Register select (0/instruction, 1/data). More...
 
uint8_t m_dirty
 Mark register select change required. More...
 

Static Protected Attributes

static const uint16_t SHORT_EXEC_TIME = 20
 

Detailed Description

ERM1602-5 Series, Character Display Module, adapter with digital output pins.

Circuit

The serial 3-line SPI circuit for ERM1602-5.

ERM1602-5
+------------+
(GND)---------------1-|VSS |
(VCC)---------------2-|VDD |
3-|VO |
(D5)----------------4-|CS |
(D6)----------------5-|SCL |
(D7)----------------6-|DI |
7-|PS |
8-|RST |
(VCC)---------------9-|LED+ |
(GND)--------------10-|LED- |
+------------+

Definition at line 49 of file ERM1602_5.hh.

Constructor & Destructor Documentation

Construct ERM1602-5 3-wire serial port connected to given serial data, clock, enable pulse and backlight control pin.

Parameters
[in]sdaserial data pin (Default D7)
[in]sclserial clock pin (Default D6)
[in]enenable pulse (Default D5)
[in]btbacklight control (Default D4)

Definition at line 23 of file ERM1602_5.cpp.

Member Function Documentation

void ERM1602_5::flush ( )
protected

Flush register setting if dirty.

Definition at line 97 of file ERM1602_5.cpp.

void ERM1602_5::set_backlight ( uint8_t  flag)
virtual

Set backlight on/off using bt pin.

Parameters
[in]flag.

Implements HD44780::IO.

Definition at line 91 of file ERM1602_5.cpp.

void ERM1602_5::set_mode ( uint8_t  flag)
virtual

Set instruction/data mode using given rs pin; zero for instruction, non-zero for data mode.

Parameters
[in]flag.

Implements HD44780::IO.

Definition at line 83 of file ERM1602_5.cpp.

bool ERM1602_5::setup ( )
virtual

Initiate serial port. Returns true.

Returns
bool.

Implements HD44780::IO.

Definition at line 37 of file ERM1602_5.cpp.

void ERM1602_5::write4b ( uint8_t  data)
virtual

Write LSB nibble to display using serial port.

Parameters
[in]data(4b) to write.

Implements HD44780::IO.

Definition at line 43 of file ERM1602_5.cpp.

void ERM1602_5::write8b ( uint8_t  data)
virtual

Write byte (8bit) to display.

Parameters
[in]data(8b) to write.

Reimplemented from HD44780::IO.

Definition at line 49 of file ERM1602_5.cpp.

void ERM1602_5::write8n ( const void *  buf,
size_t  size 
)
virtual

Write character buffer to display.

Parameters
[in]bufpointer to buffer.
[in]sizenumber of bytes in buffer.

Reimplemented from HD44780::IO.

Definition at line 63 of file ERM1602_5.cpp.

Member Data Documentation

OutputPin ERM1602_5::m_bt
protected

Back-light control (0/on, 1/off).

Definition at line 122 of file ERM1602_5.hh.

uint8_t ERM1602_5::m_dirty
protected

Mark register select change required.

Definition at line 124 of file ERM1602_5.hh.

OutputPin ERM1602_5::m_en
protected

Starts data read/write.

Definition at line 121 of file ERM1602_5.hh.

uint8_t ERM1602_5::m_rs
protected

Register select (0/instruction, 1/data).

Definition at line 123 of file ERM1602_5.hh.

OutputPin ERM1602_5::m_scl
protected

Serial clock.

Definition at line 120 of file ERM1602_5.hh.

OutputPin ERM1602_5::m_sda
protected

Serial data output.

Definition at line 119 of file ERM1602_5.hh.

const uint16_t ERM1602_5::SHORT_EXEC_TIME = 20
staticprotected

Execution time delay (us).

Definition at line 117 of file ERM1602_5.hh.


The documentation for this class was generated from the following files: