MHVLib
20111011
An efficiency oriented runtime library for AVR microcontrollers
|
#include <MHV_Display_HD44780.h>
Public Member Functions | |
MHV_Display_HD44780 (uint8_t colCount, uint16_t rowCount, MHV_RingBuffer *txBuffers) | |
void | init (bool byteMode, bool multiLine, bool bigFont, bool cursorOn, bool cursorBlink, bool left2right, bool scroll) |
void | clear () |
void | entryMode (bool left2Right, bool scroll) |
void | control (bool displayOn, bool cursorOn, bool cursorBlink) |
Protected Member Functions | |
void | writeCommand (MHV_HD44780_COMMAND command, uint8_t data) |
void | function (bool byteMode, bool multiLine, bool bigFont) |
void | addressCGRAM (uint8_t address) |
void | addressDDRAM (uint8_t address) |
virtual void | writeByte (uint8_t byte, bool rs)=0 |
virtual uint8_t | readByte (bool rs)=0 |
void | _setCursor (uint8_t col, uint8_t row) |
void | _setCursor (uint16_t col, uint16_t row) |
void | _writeChar (char character) |
char | _readChar () |
virtual bool | isBusy ()=0 |
virtual void | delay (MHV_HD44780_COMMAND command)=0 |
Protected Attributes | |
uint16_t | _ticks |
uint16_t | _animateTicks |
bool | _mustDelay |
bool | _byteMode |
Definition at line 45 of file MHV_Display_HD44780.h.
MHV_Display_HD44780::MHV_Display_HD44780 | ( | uint8_t | colCount, |
uint16_t | rowCount, | ||
MHV_RingBuffer * | txBuffers | ||
) |
A class for operating HD44780 based LCD displays (and compatible) Data port layout: Bit description n DB4 n+1 DB5 n+2 DB6 n+3 DB7
Control port layout: n RS Register Select n+1 R/W Read/Write n+2 E Enable
Visual port layout: n Contrast (V0) n+1 LED Positive
colCount | the number of columns on the display |
rowCount | the number of rows on the display |
txBuffers | buffers for async writing |
Definition at line 54 of file MHV_Display_HD44780.cpp.
char MHV_Display_HD44780::_readChar | ( | ) | [protected, virtual] |
Read a character from the display at the current location, incrementing the location by 1
Implements MHV_Display_Character.
Definition at line 75 of file MHV_Display_HD44780.cpp.
void MHV_Display_HD44780::_setCursor | ( | uint8_t | col, |
uint8_t | row | ||
) | [protected] |
Move the cursor to a location, so the next writeChar will write a character at that location (Origin is at the bottom left)
col | the column to put the character |
row | the row to put the character |
Definition at line 101 of file MHV_Display_HD44780.cpp.
void MHV_Display_HD44780::_setCursor | ( | uint16_t | col, |
uint16_t | row | ||
) | [protected, virtual] |
Move the cursor to a location, so the next writeChar will write a character at that location (Origin is at the bottom left)
col | the column to put the character |
row | the row to put the character |
Implements MHV_Display_Character.
Definition at line 86 of file MHV_Display_HD44780.cpp.
void MHV_Display_HD44780::_writeChar | ( | char | character | ) | [protected, virtual] |
Write a character to the display at the current location, incrementing the location by 1
character | the character to write |
Implements MHV_Display_Character.
Definition at line 65 of file MHV_Display_HD44780.cpp.
void MHV_Display_HD44780::addressCGRAM | ( | uint8_t | address | ) | [protected] |
Set the CGRAM address
address | the CGRAM address |
Definition at line 194 of file MHV_Display_HD44780.cpp.
void MHV_Display_HD44780::addressDDRAM | ( | uint8_t | address | ) | [protected] |
Set the DDRAM address
address | the DDRAM address |
Definition at line 204 of file MHV_Display_HD44780.cpp.
void MHV_Display_HD44780::clear | ( | ) | [virtual] |
Clear the display
Implements MHV_Display_Character.
Definition at line 137 of file MHV_Display_HD44780.cpp.
void MHV_Display_HD44780::control | ( | bool | displayOn, |
bool | cursorOn, | ||
bool | cursorBlink | ||
) |
Set parameters on the display
displayOn | turn the display on |
cursorOn | turn the cursor on |
cursorBlink | blink the cursor |
Definition at line 164 of file MHV_Display_HD44780.cpp.
virtual void MHV_Display_HD44780::delay | ( | MHV_HD44780_COMMAND | command | ) | [protected, pure virtual] |
Implemented in MHV_Display_HD44780_Direct_Connect, and MHV_Display_HD44780_Shift_Register.
void MHV_Display_HD44780::entryMode | ( | bool | left2Right, |
bool | scroll | ||
) |
Set the entry mode - allows for left or right printing, allows for scrolling display or moving cursor
left2Right | true for text reading left to right |
scroll | true to scroll text rather than moving the cursor |
Definition at line 150 of file MHV_Display_HD44780.cpp.
void MHV_Display_HD44780::function | ( | bool | byteMode, |
bool | multiLine, | ||
bool | bigFont | ||
) | [protected] |
Initialise the display
byteMode | true to use 8 bit protocol |
multiLine | true if there is more than 1 line |
bigFont | true to use 5x11 fonts, false for 5x8 |
Definition at line 178 of file MHV_Display_HD44780.cpp.
void MHV_Display_HD44780::init | ( | bool | byteMode, |
bool | multiLine, | ||
bool | bigFont, | ||
bool | cursorOn, | ||
bool | cursorBlink, | ||
bool | left2right, | ||
bool | scroll | ||
) |
Initialise the display
byteMode | true to use 8 bit transfers |
multiLine | true if there is more than 1 line |
bigFont | true to use 5x11 fonts, false for 5x8 |
cursorOn | turn the curson on |
cursorBlink | blink the cursor |
left2right | true for text reading left to right |
scroll | true to scroll text rather than moving the cursor |
Definition at line 221 of file MHV_Display_HD44780.cpp.
virtual bool MHV_Display_HD44780::isBusy | ( | ) | [protected, pure virtual] |
Implemented in MHV_Display_HD44780_Direct_Connect, and MHV_Display_HD44780_Shift_Register.
virtual uint8_t MHV_Display_HD44780::readByte | ( | bool | rs | ) | [protected, pure virtual] |
Implemented in MHV_Display_HD44780_Direct_Connect, and MHV_Display_HD44780_Shift_Register.
virtual void MHV_Display_HD44780::writeByte | ( | uint8_t | byte, |
bool | rs | ||
) | [protected, pure virtual] |
Implemented in MHV_Display_HD44780_Direct_Connect, and MHV_Display_HD44780_Shift_Register.
void MHV_Display_HD44780::writeCommand | ( | MHV_HD44780_COMMAND | command, |
uint8_t | data | ||
) | [protected] |
Send a command to the display
Definition at line 121 of file MHV_Display_HD44780.cpp.
uint16_t MHV_Display_HD44780::_animateTicks [protected] |
Definition at line 48 of file MHV_Display_HD44780.h.
bool MHV_Display_HD44780::_byteMode [protected] |
Definition at line 50 of file MHV_Display_HD44780.h.
bool MHV_Display_HD44780::_mustDelay [protected] |
Definition at line 49 of file MHV_Display_HD44780.h.
uint16_t MHV_Display_HD44780::_ticks [protected] |
Definition at line 47 of file MHV_Display_HD44780.h.