MHVLib  20111227
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 (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

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 ( 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

Parameters:
datapin declaration for the first bit of the data port DB4..DB7 (will use a nibble starting at this bit)
controlpin declaration for the first bit of the control port (will use 3 bits)
visualpin declaration for the first bit of the visual port (will use 2 bits)
colCountthe number of columns on the display
rowCountthe number of rows on the display
txBuffersbuffers 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

Parameters:
datapin declaration for the first bit of the data port DB4..DB7 (will use a nibble starting at this bit)
controlpin declaration for the first bit of the control port (will use 3 bits)
colCountthe number of columns on the display
rowCountthe number of rows on the display
txBuffersbuffers for async writing

Definition at line 119 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 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

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 292 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 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

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

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

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

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

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

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

Definition at line 159 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: