Arduino-LCD
LCD library for Arduino
LCD::SR4W< SDA_PIN, SCL_PIN, EN_PIN, BT_PIN > Class Template Reference

#include <SR4W.h>

Inheritance diagram for LCD::SR4W< SDA_PIN, SCL_PIN, EN_PIN, BT_PIN >:
Inheritance graph
Collaboration diagram for LCD::SR4W< SDA_PIN, SCL_PIN, EN_PIN, BT_PIN >:
Collaboration graph

Public Member Functions

 SR4W ()
 
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

GPIO< SDA_PIN > m_sda
 Serial data output. More...
 
GPIO< SCL_PIN > m_scl
 Serial clock. More...
 
GPIO< EN_PIN > m_en
 Starts data read/write. More...
 
GPIO< BT_PIN > m_bt
 Backlight control. More...
 
uint8_t m_rs
 Command/Data select. More...
 

Static Protected Attributes

static const uint16_t SHORT_EXEC_TIME = 30
 

Detailed Description

template<BOARD::pin_t SDA_PIN, BOARD::pin_t SCL_PIN, BOARD::pin_t EN_PIN, BOARD::pin_t BT_PIN>
class LCD::SR4W< SDA_PIN, SCL_PIN, EN_PIN, BT_PIN >

Definition at line 93 of file SR4W.h.

Constructor & Destructor Documentation

template<BOARD::pin_t SDA_PIN, BOARD::pin_t SCL_PIN, BOARD::pin_t EN_PIN, BOARD::pin_t BT_PIN>
LCD::SR4W< SDA_PIN, SCL_PIN, EN_PIN, BT_PIN >::SR4W ( )
inline

Construct HD44780 4-wire/8-bit serial port connected to given data (rs), clock, enable and backlight control pins.

Definition at line 99 of file SR4W.h.

Member Function Documentation

template<BOARD::pin_t SDA_PIN, BOARD::pin_t SCL_PIN, BOARD::pin_t EN_PIN, BOARD::pin_t BT_PIN>
virtual void LCD::SR4W< SDA_PIN, SCL_PIN, EN_PIN, BT_PIN >::set_backlight ( uint8_t  flag)
inlinevirtual

Set backlight on/off using bt pin.

Parameters
[in]flag.

Implements HD44780::Adapter.

Definition at line 165 of file SR4W.h.

template<BOARD::pin_t SDA_PIN, BOARD::pin_t SCL_PIN, BOARD::pin_t EN_PIN, BOARD::pin_t BT_PIN>
virtual void LCD::SR4W< SDA_PIN, SCL_PIN, EN_PIN, BT_PIN >::set_mode ( uint8_t  flag)
inlinevirtual

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

Parameters
[in]flag.

Implements HD44780::Adapter.

Definition at line 155 of file SR4W.h.

template<BOARD::pin_t SDA_PIN, BOARD::pin_t SCL_PIN, BOARD::pin_t EN_PIN, BOARD::pin_t BT_PIN>
virtual bool LCD::SR4W< SDA_PIN, SCL_PIN, EN_PIN, BT_PIN >::setup ( )
inlinevirtual

Initiate port for 8-bit serial mode.

Returns
true(1).

Reimplemented from HD44780::Adapter.

Definition at line 114 of file SR4W.h.

template<BOARD::pin_t SDA_PIN, BOARD::pin_t SCL_PIN, BOARD::pin_t EN_PIN, BOARD::pin_t BT_PIN>
virtual void LCD::SR4W< SDA_PIN, SCL_PIN, EN_PIN, BT_PIN >::write4b ( uint8_t  data)
inlinevirtual

Write LSB nibble to display using serial port.

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

Implements HD44780::Adapter.

Definition at line 124 of file SR4W.h.

template<BOARD::pin_t SDA_PIN, BOARD::pin_t SCL_PIN, BOARD::pin_t EN_PIN, BOARD::pin_t BT_PIN>
virtual void LCD::SR4W< SDA_PIN, SCL_PIN, EN_PIN, BT_PIN >::write8b ( uint8_t  data)
inlinevirtual

Write byte (8bit) to display.

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

Reimplemented from HD44780::Adapter.

Definition at line 134 of file SR4W.h.

virtual void HD44780::Adapter::write8n ( const void *  buf,
size_t  size 
)
inlinevirtualinherited

Write character/command buffer to display.

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

Reimplemented in LCD::DFRobot_IIC, and LCD::MJKDZ.

Definition at line 77 of file HD44780.h.

Member Data Documentation

template<BOARD::pin_t SDA_PIN, BOARD::pin_t SCL_PIN, BOARD::pin_t EN_PIN, BOARD::pin_t BT_PIN>
GPIO<BT_PIN> LCD::SR4W< SDA_PIN, SCL_PIN, EN_PIN, BT_PIN >::m_bt
protected

Backlight control.

Definition at line 177 of file SR4W.h.

template<BOARD::pin_t SDA_PIN, BOARD::pin_t SCL_PIN, BOARD::pin_t EN_PIN, BOARD::pin_t BT_PIN>
GPIO<EN_PIN> LCD::SR4W< SDA_PIN, SCL_PIN, EN_PIN, BT_PIN >::m_en
protected

Starts data read/write.

Definition at line 176 of file SR4W.h.

template<BOARD::pin_t SDA_PIN, BOARD::pin_t SCL_PIN, BOARD::pin_t EN_PIN, BOARD::pin_t BT_PIN>
uint8_t LCD::SR4W< SDA_PIN, SCL_PIN, EN_PIN, BT_PIN >::m_rs
protected

Command/Data select.

Definition at line 178 of file SR4W.h.

template<BOARD::pin_t SDA_PIN, BOARD::pin_t SCL_PIN, BOARD::pin_t EN_PIN, BOARD::pin_t BT_PIN>
GPIO<SCL_PIN> LCD::SR4W< SDA_PIN, SCL_PIN, EN_PIN, BT_PIN >::m_scl
protected

Serial clock.

Definition at line 175 of file SR4W.h.

template<BOARD::pin_t SDA_PIN, BOARD::pin_t SCL_PIN, BOARD::pin_t EN_PIN, BOARD::pin_t BT_PIN>
GPIO<SDA_PIN> LCD::SR4W< SDA_PIN, SCL_PIN, EN_PIN, BT_PIN >::m_sda
protected

Serial data output.

Definition at line 174 of file SR4W.h.

template<BOARD::pin_t SDA_PIN, BOARD::pin_t SCL_PIN, BOARD::pin_t EN_PIN, BOARD::pin_t BT_PIN>
const uint16_t LCD::SR4W< SDA_PIN, SCL_PIN, EN_PIN, BT_PIN >::SHORT_EXEC_TIME = 30
staticprotected

Execution time delay (us).

Definition at line 172 of file SR4W.h.


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