MHVLib  20111011
An efficiency oriented runtime library for AVR microcontrollers
MHV_Display_HD44780_Direct_Connect Class Reference

#include <MHV_Display_HD44780_Direct_Connect.h>

Inheritance diagram for MHV_Display_HD44780_Direct_Connect:
MHV_Display_HD44780 MHV_Display_Character MHV_Device_TX

List of all members.

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

Detailed Description

Definition at line 32 of file MHV_Display_HD44780_Direct_Connect.h.


Constructor & Destructor Documentation

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

Parameters:
dataDirA 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)
dataOutA member of the MHV_PIN_* macro
dataInA member of the MHV_PIN_* macro
dataPinA member of the MHV_PIN_* macro
dataPinchangeInterruptA member of the MHV_PIN_* macro
controlDirA member of the MHV_PIN_* macro pin declaration for the first bit of the control port (will use 3 bits)
controlOutA member of the MHV_PIN_* macro
controlInA member of the MHV_PIN_* macro
controlPinA member of the MHV_PIN_* macro
controlPinchangeInterruptA member of the MHV_PIN_* macro
visualDirA member of the MHV_PIN_* macro pin declaration for the first bit of the visual port (will use 2 bits)
visualOutA member of the MHV_PIN_* macro
visualInA member of the MHV_PIN_* macro
visualPinA member of the MHV_PIN_* macro
visualPinchangeInterruptA member of the MHV_PIN_* macro
colCountthe number of columns on the display
rowCountthe number of rows on the display
txBuffersbuffers 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

Parameters:
dataDirA 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)
dataOutA member of the MHV_PIN_* macro
dataInA member of the MHV_PIN_* macro
dataPinA member of the MHV_PIN_* macro
dataPinchangeInterruptA member of the MHV_PIN_* macro
controlDirA member of the MHV_PIN_* macro pin declaration for the first bit of the control port (will use 3 bits)
controlOutA member of the MHV_PIN_* macro
controlInA member of the MHV_PIN_* macro
controlPinA member of the MHV_PIN_* macro
controlPinchangeInterruptA member of the MHV_PIN_* macro
colCountthe number of columns on the display
rowCountthe number of rows on the display
txBuffersbuffers for async writing

Definition at line 139 of file MHV_Display_HD44780_Direct_Connect.cpp.


Member Function Documentation

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

Parameters:
multiLinetrue if there is more than 1 line
bigFonttrue to use 5x11 fonts, false for 5x8
cursorOnturn the curson on
cursorBlinkblink the cursor
left2righttrue for text reading left to right
scrolltrue 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

Returns:
true 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

Parameters:
rstrue 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

Parameters:
rstrue 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

Parameters:
valuethe 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

Parameters:
valuethe 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

Parameters:
bytethe data to write
rstrue 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

Parameters:
nibblethe data to write (lower 4 bits)
rstrue to set the RS pin

Definition at line 179 of file MHV_Display_HD44780_Direct_Connect.cpp.


Member Data Documentation

volatile uint8_t* MHV_Display_HD44780_Direct_Connect::_controlOut [protected]

Definition at line 39 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.

volatile uint8_t* MHV_Display_HD44780_Direct_Connect::_dataOut [protected]

Definition at line 35 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.


The documentation for this class was generated from the following files: