|
MHVLib
20111227
An efficiency oriented runtime library for AVR microcontrollers
|
#include <MHV_Display_HD44780_Direct_Connect.h>
Public Member Functions | |
| MHV_Display_HD44780_Direct_Connect (MHV_DECLARE_PIN(data), MHV_DECLARE_PIN(control), MHV_DECLARE_PIN(visual), uint8_t colCount, uint16_t rowCount, MHV_RingBuffer &txBuffers) | |
| MHV_Display_HD44780_Direct_Connect (MHV_DECLARE_PIN(data), MHV_DECLARE_PIN(control), uint8_t colCount, uint16_t rowCount, MHV_RingBuffer &txBuffers) | |
| void | setBacklight (uint8_t value) |
| void | setContrast (uint8_t value) |
| void | tickPWM () |
| void | init (bool multiLine, bool bigFont, bool cursorOn, bool cursorBlink, bool left2right, bool scroll) |
Protected Member Functions | |
| void | writeByte (uint8_t byte, bool rs) |
| void | writeNibble (uint8_t nibble, bool rs) |
| uint8_t | readByte (bool rs) |
| uint8_t | readNibble (bool rs) |
| bool | isBusy () |
| void | delay (MHV_HD44780_COMMAND command) |
Protected Attributes | |
| volatile uint8_t * | _dataDir |
| volatile uint8_t * | _dataOut |
| volatile uint8_t * | _dataIn |
| uint8_t | _dataPin |
| uint8_t | _dataMask |
| volatile uint8_t * | _controlOut |
| uint8_t | _controlPin |
| volatile uint8_t * | _visualOut |
| uint8_t | _visualPin |
| uint8_t | _brightness |
| uint8_t | _contrast |
Definition at line 32 of file MHV_Display_HD44780_Direct_Connect.h.
| MHV_Display_HD44780_Direct_Connect::MHV_Display_HD44780_Direct_Connect | ( | MHV_DECLARE_PIN(data) | , |
| MHV_DECLARE_PIN(control) | , | ||
| MHV_DECLARE_PIN(visual) | , | ||
| uint8_t | colCount, | ||
| uint16_t | rowCount, | ||
| MHV_RingBuffer & | txBuffers | ||
| ) |
A class for operating HD44780 based LCD displays (and compatible) in 4 bit mode 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
| data | pin declaration for the first bit of the data port DB4..DB7 (will use a nibble starting at this bit) |
| control | pin declaration for the first bit of the control port (will use 3 bits) |
| visual | pin declaration for the first bit of the visual port (will use 2 bits) |
| colCount | the number of columns on the display |
| rowCount | the number of rows on the display |
| txBuffers | buffers for async writing |
Definition at line 77 of file MHV_Display_HD44780_Direct_Connect.cpp.
| MHV_Display_HD44780_Direct_Connect::MHV_Display_HD44780_Direct_Connect | ( | MHV_DECLARE_PIN(data) | , |
| MHV_DECLARE_PIN(control) | , | ||
| uint8_t | colCount, | ||
| uint16_t | rowCount, | ||
| MHV_RingBuffer & | txBuffers | ||
| ) |
An alternate constructor without visual pins - if this constructor is used, tickPWM behaviour is undefined and will like overwrite random bits of memory, so don't call it
| data | pin declaration for the first bit of the data port DB4..DB7 (will use a nibble starting at this bit) |
| control | pin declaration for the first bit of the control port (will use 3 bits) |
| colCount | the number of columns on the display |
| rowCount | the number of rows on the display |
| txBuffers | buffers for async writing |
Definition at line 119 of file MHV_Display_HD44780_Direct_Connect.cpp.
| void MHV_Display_HD44780_Direct_Connect::delay | ( | MHV_HD44780_COMMAND | command | ) | [protected, virtual] |
Delay function No delays required as we can check whether the display is busy
Implements MHV_Display_HD44780.
Definition at line 279 of file MHV_Display_HD44780_Direct_Connect.cpp.
| void MHV_Display_HD44780_Direct_Connect::init | ( | bool | multiLine, |
| bool | bigFont, | ||
| bool | cursorOn, | ||
| bool | cursorBlink, | ||
| bool | left2right, | ||
| bool | scroll | ||
| ) |
Initialise the display
| 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 292 of file MHV_Display_HD44780_Direct_Connect.cpp.
| bool MHV_Display_HD44780_Direct_Connect::isBusy | ( | ) | [protected, virtual] |
Check if the display is busy
Implements MHV_Display_HD44780.
Definition at line 214 of file MHV_Display_HD44780_Direct_Connect.cpp.
| uint8_t MHV_Display_HD44780_Direct_Connect::readByte | ( | bool | rs | ) | [protected, virtual] |
Read a byte from the display
| rs | true to set the RS pin |
Implements MHV_Display_HD44780.
Definition at line 180 of file MHV_Display_HD44780_Direct_Connect.cpp.
| uint8_t MHV_Display_HD44780_Direct_Connect::readNibble | ( | bool | rs | ) | [protected] |
Read a nibble from the display
| rs | true to set the RS pin |
Definition at line 192 of file MHV_Display_HD44780_Direct_Connect.cpp.
| void MHV_Display_HD44780_Direct_Connect::setBacklight | ( | uint8_t | value | ) |
Manipulate the backlight
| value | the brightness of the backlight (0..15) |
Definition at line 235 of file MHV_Display_HD44780_Direct_Connect.cpp.
| void MHV_Display_HD44780_Direct_Connect::setContrast | ( | uint8_t | value | ) |
Set the contrast
| value | the contrast of the display(0..15) |
Definition at line 246 of file MHV_Display_HD44780_Direct_Connect.cpp.
| void MHV_Display_HD44780_Direct_Connect::tickPWM | ( | ) |
Tick the display for PWM - this should be called every 500 microseconds
Definition at line 258 of file MHV_Display_HD44780_Direct_Connect.cpp.
| void MHV_Display_HD44780_Direct_Connect::writeByte | ( | uint8_t | byte, |
| bool | rs | ||
| ) | [protected, virtual] |
Write a byte to the display
| byte | the data to write |
| rs | true to set the RS pin |
Implements MHV_Display_HD44780.
Definition at line 147 of file MHV_Display_HD44780_Direct_Connect.cpp.
| void MHV_Display_HD44780_Direct_Connect::writeNibble | ( | uint8_t | nibble, |
| bool | rs | ||
| ) | [protected] |
Write a nibble to the display
| nibble | the data to write (lower 4 bits) |
| rs | true to set the RS pin |
Definition at line 159 of file MHV_Display_HD44780_Direct_Connect.cpp.
uint8_t MHV_Display_HD44780_Direct_Connect::_brightness [protected] |
Definition at line 44 of file MHV_Display_HD44780_Direct_Connect.h.
uint8_t MHV_Display_HD44780_Direct_Connect::_contrast [protected] |
Definition at line 45 of file MHV_Display_HD44780_Direct_Connect.h.
volatile uint8_t* MHV_Display_HD44780_Direct_Connect::_controlOut [protected] |
Definition at line 39 of file MHV_Display_HD44780_Direct_Connect.h.
uint8_t MHV_Display_HD44780_Direct_Connect::_controlPin [protected] |
Definition at line 40 of file MHV_Display_HD44780_Direct_Connect.h.
volatile uint8_t* MHV_Display_HD44780_Direct_Connect::_dataDir [protected] |
Definition at line 34 of file MHV_Display_HD44780_Direct_Connect.h.
volatile uint8_t* MHV_Display_HD44780_Direct_Connect::_dataIn [protected] |
Definition at line 36 of file MHV_Display_HD44780_Direct_Connect.h.
uint8_t MHV_Display_HD44780_Direct_Connect::_dataMask [protected] |
Definition at line 38 of file MHV_Display_HD44780_Direct_Connect.h.
volatile uint8_t* MHV_Display_HD44780_Direct_Connect::_dataOut [protected] |
Definition at line 35 of file MHV_Display_HD44780_Direct_Connect.h.
uint8_t MHV_Display_HD44780_Direct_Connect::_dataPin [protected] |
Definition at line 37 of file MHV_Display_HD44780_Direct_Connect.h.
volatile uint8_t* MHV_Display_HD44780_Direct_Connect::_visualOut [protected] |
Definition at line 41 of file MHV_Display_HD44780_Direct_Connect.h.
uint8_t MHV_Display_HD44780_Direct_Connect::_visualPin [protected] |
Definition at line 42 of file MHV_Display_HD44780_Direct_Connect.h.