Arduino-LCD
LCD library for Arduino
LCD_Keypad Class Reference

#include <LCD_Keypad.h>

Inheritance diagram for LCD_Keypad:
Inheritance graph
Collaboration diagram for LCD_Keypad:
Collaboration graph

Public Types

enum  {
  NO_KEY = 0, SELECT_KEY, LEFT_KEY, DOWN_KEY,
  UP_KEY, RIGHT_KEY
}
 

Public Member Functions

 LCD_Keypad ()
 
virtual bool begin ()
 
virtual void backlight_on ()
 
virtual void backlight_off ()
 
virtual void display_on ()
 
virtual void display_off ()
 
virtual void display_clear ()
 
virtual void cursor_blink_on ()
 
virtual void cursor_blink_off ()
 
virtual void cursor_set (uint8_t x, uint8_t y)
 
virtual void cursor_home ()
 
void display_scroll_left ()
 
void display_scroll_right ()
 
void cursor_underline_on ()
 
void cursor_underline_off ()
 
void text_flow_right_to_left ()
 
void text_scroll_left_adjust ()
 
void text_scroll_right_adjust ()
 
void set_custom_char (uint8_t id, const uint8_t *bitmap)
 
void set_custom_char_P (uint8_t id, const uint8_t *bitmap)
 
virtual size_t write (uint8_t c)
 
virtual bool end ()
 
virtual void display_contrast (uint8_t level)
 
virtual void display_normal ()
 
virtual void display_inverse ()
 
void cursor_get (uint8_t &x, uint8_t &y) const
 
virtual void cursor_update ()
 
uint8_t tab_step () const
 
void tab_step (uint8_t step)
 
uint8_t text_mode () const
 
void text_normal_mode ()
 
void text_inverted_mode ()
 

Public Attributes

const uint8_t WIDTH
 
const uint8_t HEIGHT
 

Static Public Attributes

static const uint8_t BITMAP_MAX = 8
 

Protected Types

enum  {
  CLEAR_DISPLAY = 0x01, RETURN_HOME = 0x02, ENTRY_MODE_SET = 0x04, CONTROL_SET = 0x08,
  SHIFT_SET = 0x10, FUNCTION_SET = 0x20, SET_CGRAM_ADDR = 0x40, SET_CGRAM_MASK = 0x3f,
  SET_DDRAM_ADDR = 0x80, SET_DDRAM_MASK = 0x7f, BIAS_RESISTOR_SET = 0x04, BIAS_RESISTOR_MASK = 0x03,
  COM_SEG_SET = 0x40, COM_SET_MASK = 0x0f, SET_DDATA_LENGTH = 0x80, SET_DDATA_MASK = 0x7f
}
 
enum  { DISPLAY_SHIFT = 0x01, INCREMENT = 0x02, DECREMENT = 0x00 }
 
enum  { BLINK_ON = 0x01, CURSOR_ON = 0x02, DISPLAY_ON = 0x04 }
 
enum  { MOVE_LEFT = 0x00, MOVE_RIGHT = 0x04, CURSOR_MODE = 0x00, DISPLAY_MOVE = 0x08 }
 
enum  {
  DATA_LENGTH_4BITS = 0x00, DATA_LENGTH_8BITS = 0x10, NR_LINES_1 = 0x00, NR_LINES_2 = 0x08,
  FONT_5X8DOTS = 0x00, FONT_5X10DOTS = 0x04, BASIC_SET = 0x00, EXTENDED_SET = 0x04
}
 

Protected Member Functions

const uint16_t * keymap ()
 

Protected Attributes

LCD::PP7W< BOARD::D4, BOARD::D5, BOARD::D6, BOARD::D7, BOARD::D8, BOARD::D9, BOARD::D10 > m_io
 
uint8_t m_mode
 Entry mode. More...
 
uint8_t m_cntl
 Control. More...
 
uint8_t m_func
 Function set. More...
 
const uint8_t * m_offset
 Row offset table. More...
 
uint8_t m_x
 Cursor position x. More...
 
uint8_t m_y
 Cursor position y. More...
 
uint8_t m_tab
 Tab step. More...
 

Static Protected Attributes

static const uint16_t LONG_EXEC_TIME = 1600
 
static const uint16_t POWER_ON_TIME = 48
 
static const uint16_t INIT0_TIME = 4500
 
static const uint16_t INIT1_TIME = 150
 

Detailed Description

Device driver for the LCD_Keypad Shield with HD44780 16x2 display and five keys (SELECT, UP, DOWN, LEFT, and RIGHT).

Definition at line 32 of file LCD_Keypad.h.

Member Enumeration Documentation

anonymous enum
protectedinherited

FUNCTION_SET attributes.

Enumerator
DATA_LENGTH_4BITS 

Sets the interface data length, 4-bit or.

DATA_LENGTH_8BITS 
  • 8-bit.
NR_LINES_1 

Sets the number of display lines, 1 or.

NR_LINES_2 
  • 2.
FONT_5X8DOTS 

Sets the character font, 5X8 dots or.

FONT_5X10DOTS 
  • 5X10 dots.
BASIC_SET 

Sets basic instruction set.

EXTENDED_SET 
  • extended instruction set.

Definition at line 479 of file HD44780.h.

anonymous enum
Enumerator
NO_KEY 
SELECT_KEY 
LEFT_KEY 
DOWN_KEY 
UP_KEY 
RIGHT_KEY 

Definition at line 34 of file LCD_Keypad.h.

anonymous enum
protectedinherited

Instructions (Table 6, pp. 24), RS(0), RW(0).

Enumerator
CLEAR_DISPLAY 

Clears entrire display and return home.

RETURN_HOME 

Sets DDRAM 0 in address counter.

ENTRY_MODE_SET 

Sets cursor move direction and display shift.

CONTROL_SET 

Set display, cursor and blinking controls.

SHIFT_SET 

Set cursor and shifts display.

FUNCTION_SET 

Sets interface data length, line and font.

SET_CGRAM_ADDR 

Sets CGRAM address.

SET_CGRAM_MASK 
  • Mask (6-bit).
SET_DDRAM_ADDR 

Sets DDRAM address.

SET_DDRAM_MASK 
  • Mask (7-bit).
BIAS_RESISTOR_SET 

Bias resistor select.

BIAS_RESISTOR_MASK 
  • Mask (2-bit).
COM_SEG_SET 

COM SEG direction select.

COM_SET_MASK 
  • mask (4 bit).
SET_DDATA_LENGTH 

Set display data length.

SET_DDATA_MASK 
  • mask (7 bit, 0..79 => 1..80).

Definition at line 429 of file HD44780.h.

anonymous enum
protectedinherited

ENTRY_MODE_SET attributes.

Enumerator
DISPLAY_SHIFT 

Shift the entire display not cursor.

INCREMENT 

Increment (right) on write.

DECREMENT 

Decrement (left) on write.

Definition at line 451 of file HD44780.h.

anonymous enum
protectedinherited

CONTROL_SET attributes.

Enumerator
BLINK_ON 

The character indicated by cursor blinks.

CURSOR_ON 

The cursor is displayed.

DISPLAY_ON 

The display is on.

Definition at line 460 of file HD44780.h.

anonymous enum
protectedinherited

SHIFT_SET attributes.

Enumerator
MOVE_LEFT 

Moves cursor and shifts display.

MOVE_RIGHT 

without changing DDRAM contents.

CURSOR_MODE 
DISPLAY_MOVE 

Definition at line 469 of file HD44780.h.

Constructor & Destructor Documentation

LCD_Keypad::LCD_Keypad ( )
inline

Construct shield with device driver and keypad handler.

Definition at line 44 of file LCD_Keypad.h.

Member Function Documentation

virtual void HD44780::backlight_off ( )
inlinevirtualinherited

Turn display backlight off.

Reimplemented from LCD::Device.

Definition at line 185 of file HD44780.h.

virtual void HD44780::backlight_on ( )
inlinevirtualinherited

Turn display backlight on.

Reimplemented from LCD::Device.

Definition at line 176 of file HD44780.h.

virtual bool HD44780::begin ( )
inlinevirtualinherited

Start display for text output. Returns true(1) if successful otherwise false(0).

Returns
bool.

Implements LCD::Device.

Definition at line 132 of file HD44780.h.

virtual void HD44780::cursor_blink_off ( )
inlinevirtualinherited

Turn cursor blink off.

Reimplemented from LCD::Device.

Definition at line 234 of file HD44780.h.

virtual void HD44780::cursor_blink_on ( )
inlinevirtualinherited

Turn cursor blink on.

Reimplemented from LCD::Device.

Definition at line 225 of file HD44780.h.

void LCD::Device::cursor_get ( uint8_t &  x,
uint8_t &  y 
) const
inlineinherited

Get current cursor position.

Parameters
[out]x.
[out]y.

Definition at line 126 of file LCD.h.

virtual void HD44780::cursor_home ( )
inlinevirtualinherited

Move cursor to home position(0, 0) .

Reimplemented from LCD::Device.

Definition at line 259 of file HD44780.h.

virtual void HD44780::cursor_set ( uint8_t  x,
uint8_t  y 
)
inlinevirtualinherited

Set cursor position to given position.

Parameters
[in]x.
[in]y.

Implements LCD::Device.

Definition at line 245 of file HD44780.h.

void HD44780::cursor_underline_off ( )
inlineinherited

Turn underline cursor off.

Definition at line 297 of file HD44780.h.

void HD44780::cursor_underline_on ( )
inlineinherited

Turn underline cursor on.

Definition at line 288 of file HD44780.h.

virtual void LCD::Device::cursor_update ( )
inlinevirtualinherited

Call frequently to allow cursor blink.

Definition at line 154 of file LCD.h.

virtual void HD44780::display_clear ( )
inlinevirtualinherited

Clear display and move cursor to home(0, 0).

Implements LCD::Device.

Definition at line 212 of file HD44780.h.

virtual void LCD::Device::display_contrast ( uint8_t  level)
inlinevirtualinherited

Set display contrast level.

Parameters
[in]levelto set.

Reimplemented in PCD8544< SCE_PIN, DC_PIN, SDIN_PIN, SCLK_PIN >, PCD8544< BOARD::D5, BOARD::D4, BOARD::D3, BOARD::D2 >, and MAX72XX< SCE_PIN, SDIN_PIN, SCLK_PIN >.

Definition at line 77 of file LCD.h.

virtual void LCD::Device::display_inverse ( )
inlinevirtualinherited

Display inverse mode.

Reimplemented in PCD8544< SCE_PIN, DC_PIN, SDIN_PIN, SCLK_PIN >, and PCD8544< BOARD::D5, BOARD::D4, BOARD::D3, BOARD::D2 >.

Definition at line 101 of file LCD.h.

virtual void LCD::Device::display_normal ( )
inlinevirtualinherited

Display normal mode.

Reimplemented in PCD8544< SCE_PIN, DC_PIN, SDIN_PIN, SCLK_PIN >, and PCD8544< BOARD::D5, BOARD::D4, BOARD::D3, BOARD::D2 >.

Definition at line 95 of file LCD.h.

virtual void HD44780::display_off ( )
inlinevirtualinherited

Turn display off.

Implements LCD::Device.

Definition at line 203 of file HD44780.h.

virtual void HD44780::display_on ( )
inlinevirtualinherited

Turn display on.

Implements LCD::Device.

Definition at line 194 of file HD44780.h.

void HD44780::display_scroll_left ( )
inlineinherited

Set display scrolling left.

Definition at line 270 of file HD44780.h.

void HD44780::display_scroll_right ( )
inlineinherited

Set display scrolling right.

Definition at line 279 of file HD44780.h.

virtual bool LCD::Device::end ( )
inlinevirtualinherited

Stop display and power down. Returns true if successful otherwise false.

Reimplemented in PCD8544< SCE_PIN, DC_PIN, SDIN_PIN, SCLK_PIN >, PCD8544< BOARD::D5, BOARD::D4, BOARD::D3, BOARD::D2 >, and MAX72XX< SCE_PIN, SDIN_PIN, SCLK_PIN >.

Definition at line 52 of file LCD.h.

const uint16_t* LCD_Keypad::keymap ( )
inlineprotected

Return key map, program memory vector in descent order.

Returns
key map.

Definition at line 55 of file LCD_Keypad.h.

void HD44780::set_custom_char ( uint8_t  id,
const uint8_t *  bitmap 
)
inlineinherited

Set custom character bitmap for given identity (0..7).

Parameters
[in]idcharacter.
[in]bitmappointer to bitmap.

Definition at line 336 of file HD44780.h.

void HD44780::set_custom_char_P ( uint8_t  id,
const uint8_t *  bitmap 
)
inlineinherited

Set custom character bitmap to given identity (0..7). The bitmap should be stored in program memory.

Parameters
[in]idcharacter.
[in]bitmappointer to program memory bitmap.

Definition at line 351 of file HD44780.h.

uint8_t LCD::Device::tab_step ( ) const
inlineinherited

Get tab step.

Returns
tab step.

Definition at line 160 of file LCD.h.

void LCD::Device::tab_step ( uint8_t  step)
inlineinherited

Set tab step to given value.

Parameters
[in]steptab.

Definition at line 170 of file LCD.h.

void HD44780::text_flow_right_to_left ( )
inlineinherited

Set text flow right-to-left.

Definition at line 307 of file HD44780.h.

void LCD::Device::text_inverted_mode ( )
inlineinherited

Set inverted text mode.

Definition at line 197 of file LCD.h.

uint8_t LCD::Device::text_mode ( ) const
inlineinherited

Get text mode. Return 0x00 for normal mode, 0xff inverted mode.

Definition at line 179 of file LCD.h.

void LCD::Device::text_normal_mode ( )
inlineinherited

Set normal text mode.

Definition at line 188 of file LCD.h.

void HD44780::text_scroll_left_adjust ( )
inlineinherited

Set text scroll left adjust.

Definition at line 316 of file HD44780.h.

void HD44780::text_scroll_right_adjust ( )
inlineinherited

Set text scroll right adjust.

Definition at line 325 of file HD44780.h.

virtual size_t HD44780::write ( uint8_t  c)
inlinevirtualinherited

Write character to display. Handles carriage-return, line-feed, backspace, alert, horizontal tab and form-feed. Returns number of characters(1) or zero(0) on error.

Parameters
[in]ccharacter to write.
Returns
number of characters written(1) or zero(0) for error.

Definition at line 368 of file HD44780.h.

Member Data Documentation

const uint8_t HD44780::BITMAP_MAX = 8
staticinherited

Max size of custom character font bitmap.

Definition at line 100 of file HD44780.h.

const uint8_t HD44780::HEIGHT
inherited

Display height (lines).

Definition at line 106 of file HD44780.h.

const uint16_t HD44780::INIT0_TIME = 4500
staticprotectedinherited

Definition at line 423 of file HD44780.h.

const uint16_t HD44780::INIT1_TIME = 150
staticprotectedinherited

Definition at line 424 of file HD44780.h.

const uint16_t HD44780::LONG_EXEC_TIME = 1600
staticprotectedinherited

Bus Timing Characteristics (in micro-seconds), fig. 25, pp. 50.

Definition at line 421 of file HD44780.h.

uint8_t HD44780::m_cntl
protectedinherited

Control.

Definition at line 493 of file HD44780.h.

uint8_t HD44780::m_func
protectedinherited

Function set.

Definition at line 494 of file HD44780.h.

LCD::PP7W<BOARD::D4, BOARD::D5, BOARD::D6, BOARD::D7, BOARD::D8, BOARD::D9, BOARD::D10> LCD_Keypad::m_io
protected

Parallel Port Adapter for shield.

Definition at line 49 of file LCD_Keypad.h.

uint8_t HD44780::m_mode
protectedinherited

Entry mode.

Definition at line 492 of file HD44780.h.

const uint8_t* HD44780::m_offset
protectedinherited

Row offset table.

Definition at line 495 of file HD44780.h.

uint8_t LCD::Device::m_tab
protectedinherited

Tab step.

Definition at line 206 of file LCD.h.

uint8_t LCD::Device::m_x
protectedinherited

Cursor position x.

Definition at line 204 of file LCD.h.

uint8_t LCD::Device::m_y
protectedinherited

Cursor position y.

Definition at line 205 of file LCD.h.

const uint16_t HD44780::POWER_ON_TIME = 48
staticprotectedinherited

Definition at line 422 of file HD44780.h.

const uint8_t HD44780::WIDTH
inherited

Display width (characters per line).

Definition at line 103 of file HD44780.h.


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