|
MHVLib
20111109
An efficiency oriented runtime library for AVR microcontrollers
|
#include <MHV_Display_HD44780_Direct_Connect.h>
Public Member Functions | |
| MHV_Display_HD44780_Direct_Connect (volatile uint8_t *dataDir, volatile uint8_t *dataOut, volatile uint8_t *dataIn, uint8_t dataPin, int8_t dataPinchangeInterrupt, volatile uint8_t *controlDir, volatile uint8_t *controlOut, volatile uint8_t *controlIn, uint8_t controlPin, int8_t controlPinchangeInterrupt, volatile uint8_t *visualDir, volatile uint8_t *visualOut, volatile uint8_t *visualIn, uint8_t visualPin, int8_t visualPinchangeInterrupt, uint8_t colCount, uint16_t rowCount, MHV_RingBuffer *txBuffers) | |
| MHV_Display_HD44780_Direct_Connect (volatile uint8_t *dataDir, volatile uint8_t *dataOut, volatile uint8_t *dataIn, uint8_t dataPin, int8_t dataPinchangeInterrupt, volatile uint8_t *controlDir, volatile uint8_t *controlOut, volatile uint8_t *controlIn, uint8_t controlPin, int8_t controlPinchangeInterrupt, 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 | ( | volatile uint8_t * | dataDir, |
| volatile uint8_t * | dataOut, | ||
| volatile uint8_t * | dataIn, | ||
| uint8_t | dataPin, | ||
| int8_t | dataPinchangeInterrupt, | ||
| volatile uint8_t * | controlDir, | ||
| volatile uint8_t * | controlOut, | ||
| volatile uint8_t * | controlIn, | ||
| uint8_t | controlPin, | ||
| int8_t | controlPinchangeInterrupt, | ||
| volatile uint8_t * | visualDir, | ||
| volatile uint8_t * | visualOut, | ||
| volatile uint8_t * | visualIn, | ||
| uint8_t | visualPin, | ||
| int8_t | visualPinchangeInterrupt, | ||
| 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
| dataDir | A member of the MHV_PIN_* macro pin declaration for the first bit of the data port DB4..DB7 (will use a nibble starting at this bit) |
| dataOut | A member of the MHV_PIN_* macro |
| dataIn | A member of the MHV_PIN_* macro |
| dataPin | A member of the MHV_PIN_* macro |
| dataPinchangeInterrupt | A member of the MHV_PIN_* macro |
| controlDir | A member of the MHV_PIN_* macro pin declaration for the first bit of the control port (will use 3 bits) |
| controlOut | A member of the MHV_PIN_* macro |
| controlIn | A member of the MHV_PIN_* macro |
| controlPin | A member of the MHV_PIN_* macro |
| controlPinchangeInterrupt | A member of the MHV_PIN_* macro |
| visualDir | A member of the MHV_PIN_* macro pin declaration for the first bit of the visual port (will use 2 bits) |
| visualOut | A member of the MHV_PIN_* macro |
| visualIn | A member of the MHV_PIN_* macro |
| visualPin | A member of the MHV_PIN_* macro |
| visualPinchangeInterrupt | A member of the MHV_PIN_* macro |
| colCount | the number of columns on the display |
| rowCount | the number of rows on the display |
| txBuffers | buffers for async writing |
Definition at line 89 of file MHV_Display_HD44780_Direct_Connect.cpp.
| MHV_Display_HD44780_Direct_Connect::MHV_Display_HD44780_Direct_Connect | ( | volatile uint8_t * | dataDir, |
| volatile uint8_t * | dataOut, | ||
| volatile uint8_t * | dataIn, | ||
| uint8_t | dataPin, | ||
| int8_t | dataPinchangeInterrupt, | ||
| volatile uint8_t * | controlDir, | ||
| volatile uint8_t * | controlOut, | ||
| volatile uint8_t * | controlIn, | ||
| uint8_t | controlPin, | ||
| int8_t | controlPinchangeInterrupt, | ||
| 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
| dataDir | A member of the MHV_PIN_* macro pin declaration for the first bit of the data port DB4..DB7 (will use a nibble starting at this bit) |
| dataOut | A member of the MHV_PIN_* macro |
| dataIn | A member of the MHV_PIN_* macro |
| dataPin | A member of the MHV_PIN_* macro |
| dataPinchangeInterrupt | A member of the MHV_PIN_* macro |
| controlDir | A member of the MHV_PIN_* macro pin declaration for the first bit of the control port (will use 3 bits) |
| controlOut | A member of the MHV_PIN_* macro |
| controlIn | A member of the MHV_PIN_* macro |
| controlPin | A member of the MHV_PIN_* macro |
| controlPinchangeInterrupt | A member of the MHV_PIN_* macro |
| colCount | the number of columns on the display |
| rowCount | the number of rows on the display |
| txBuffers | buffers for async writing |
Definition at line 139 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 299 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 312 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 234 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 200 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 212 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 255 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 266 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 278 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 167 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 179 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.