![]() |
PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Support for the common "character LCD" modules using the HD44780 controller for the Parallax Propeller. More...
#include <PropWare/hmi/output/hd44780.h>
Public Types | |
enum | BusWidth { BusWidth::WIDTH4 = 4, BusWidth::WIDTH8 = 8 } |
LCD databus width. More... | |
enum | Dimensions { Dimensions::DIM_8x1, Dimensions::DIM_8x2, Dimensions::DIM_8x4, Dimensions::DIM_16x1_1, Dimensions::DIM_16x1_2, Dimensions::DIM_16x2, Dimensions::DIM_16x4, Dimensions::DIM_20x1, Dimensions::DIM_20x2, Dimensions::DIM_20x4, Dimensions::DIM_24x1, Dimensions::DIM_24x2, Dimensions::DIM_40x1, Dimensions::DIM_40x2 } |
Supported LCD dimensions; Used for determining cursor placement. More... | |
enum | ErrorCode { NO_ERROR = 0, BEG_ERROR = HD44780_ERRORS_BASE, INVALID_CTRL_SGNL = HD44780::BEG_ERROR, INVALID_DIMENSIONS, END_ERROR = HD44780::INVALID_DIMENSIONS } |
Public Member Functions | |
HD44780 (const Pin::Mask lsbDataPin, const Pin::Mask rs, const Pin::Mask rw, const Pin::Mask en, const HD44780::BusWidth bitMode, const HD44780::Dimensions dimensions) | |
Construct an LCD object. More... | |
void | start () |
Initialize an HD44780 LCD display. More... | |
void | clear (void) |
Clear the LCD display and return cursor to home. | |
void | move (const uint8_t row, const uint8_t col) |
Move the cursor to a specified column and row. More... | |
void | puts (const char string[]) |
Send a null-terminated character array. Though this method could be created using put_char, some objects (such as PropWare::UART), have optimized methods for sending a string and PrintCapable::puts can utilize them. More... | |
void | put_char (const char c) |
Print a single character. More... | |
void | cmd (const uint8_t command) const |
Send a control command to the LCD module. More... | |
Static Public Member Functions | |
static void | print_error_str (const Printer &printer, const HD44780::ErrorCode err) |
Static Public Attributes | |
static const uint8_t | TAB_WIDTH = 4 |
Commands | |
| |
static const uint8_t | CLEAR = BIT_0 |
static const uint8_t | RET_HOME = BIT_1 |
static const uint8_t | ENTRY_MODE_SET = BIT_2 |
static const uint8_t | DISPLAY_CTRL = BIT_3 |
static const uint8_t | SHIFT = BIT_4 |
static const uint8_t | FUNCTION_SET = BIT_5 |
static const uint8_t | SET_CGRAM_ADDR = BIT_6 |
static const uint8_t | SET_DDRAM_ADDR = BIT_7 |
Entry mode arguments | |
static const uint8_t | SHIFT_INC = BIT_1 |
static const uint8_t | SHIFT_EN = BIT_0 |
Display control arguments | |
static const uint8_t | DISPLAY_PWR = BIT_2 |
static const uint8_t | CURSOR = BIT_1 |
static const uint8_t | BLINK = BIT_0 |
Cursor/display shift arguments | |
static const uint8_t | SHIFT_DISPLAY = BIT_3 |
static const uint8_t | SHIFT_RIGHT = BIT_2 |
Function set arguments | |
static const uint8_t | FUNC_8BIT_MODE = BIT_4 |
static const uint8_t | FUNC_2LINE_MODE = BIT_3 |
static const uint8_t | FUNC_5x10_CHAR = BIT_2 |
Support for the common "character LCD" modules using the HD44780 controller for the Parallax Propeller.
|
strong |
|
strong |
Supported LCD dimensions; Used for determining cursor placement.
PropWare::HD44780::HD44780 | ( | const Pin::Mask | lsbDataPin, |
const Pin::Mask | rs, | ||
const Pin::Mask | rw, | ||
const Pin::Mask | en, | ||
const HD44780::BusWidth | bitMode, | ||
const HD44780::Dimensions | dimensions | ||
) |
Construct an LCD object.
[in] | lsbDataPin | Pin mask for the least significant pin of the data port |
[in] | rs | Pin mask connected to the register select control pin of the LCD driver |
[in] | rw | Pin mask connected to the read/write control pin of the LCD driver |
[in] | en | Pin mask connected to the enable control pin of the LCD driver |
[in] | bitMode | Select between whether the parallel bus is using 4 or 8 pins |
[in] | dimensions | Dimensions of your LCD device. Most common is HD44780::DIM_16x2 |
Definition at line 189 of file hd44780.h.
void PropWare::HD44780::cmd | ( | const uint8_t | command | ) | const |
void PropWare::HD44780::move | ( | const uint8_t | row, |
const uint8_t | col | ||
) |
|
virtual |
Print a single character.
[in] | c | Individual char to be printed |
Implements PropWare::PrintCapable.
Definition at line 324 of file hd44780.h.
|
virtual |
Send a null-terminated character array. Though this method could be created using put_char, some objects (such as PropWare::UART), have optimized methods for sending a string and PrintCapable::puts can utilize them.
string[]
must be terminated with a null terminator[in] | string[] | Array of data words with the final word being 0 - the null terminator |
Implements PropWare::PrintCapable.
Definition at line 315 of file hd44780.h.
void PropWare::HD44780::start | ( | ) |
|
static |
|
static |
|
static |
|
static |