PropWare
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 <hd44780.h>
Public Types | |
enum | Bitmode { BM_4 = 4, BM_8 = 8 } |
LCD databus width. More... | |
enum | Dimensions { DIM_8x1, DIM_8x2, DIM_8x4, DIM_16x1_1, DIM_16x1_2, DIM_16x2, DIM_16x4, DIM_20x1, DIM_20x2, DIM_20x4, DIM_24x1, DIM_24x2, DIM_40x1, 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 | |
void | start (const PropWare::Pin::Mask lsbDataPin, const Pin rs, const Pin rw, const Pin en, const HD44780::Bitmode bitmode, const HD44780::Dimensions dimensions) |
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) const |
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.
Supported LCD dimensions; Used for determining cursor placement.
void PropWare::HD44780::cmd | ( | const uint8_t | command | ) | const |
void PropWare::HD44780::move | ( | const uint8_t | row, |
const uint8_t | col | ||
) | const |
|
virtual |
Print a single character.
[in] | c | Individual char to be printed |
Implements PropWare::PrintCapable.
Definition at line 317 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 308 of file hd44780.h.
void PropWare::HD44780::start | ( | const PropWare::Pin::Mask | lsbDataPin, |
const Pin | rs, | ||
const Pin | rw, | ||
const Pin | en, | ||
const HD44780::Bitmode | bitmode, | ||
const HD44780::Dimensions | dimensions | ||
) |
Initialize an HD44780 LCD display.
[in] | lsbDataPin | Pin mask for the least significant pin of the data port |
[in] | rs,rw,en | PropWare::Pin::Mask instances for each of the RS, RW, and EN signals |
[in] | bitmode | Select between HD44780::BM_4 and HD44780::BM_8 modes to determine whether you will need 4 data wires or 8 between the Propeller and your LCD device |
[in] | dimensions | Dimensions of your LCD device. Most common is HD44780::DIM_16x2 |
Definition at line 190 of file hd44780.h.
|
static |