modm API documentation
modm::Hd44780Dual< DATA, RW, RS, E1, E2 > Class Template Reference

#include <modm/driver/display/hd44780.hpp>

Inheritance diagram for modm::Hd44780Dual< DATA, RW, RS, E1, E2 >:
modm::CharacterDisplay modm::IOStream

Public Types

enum  Command {
  ClearDisplay = 0b00000001, ResetCursor = 0b00000010, IncrementCursor = 0b00000110, DecrementCursor = 0b00000100,
  DisableDisplay = 0b00001000, EnableDisplay = 0b00001100, DisableCursor = 0b00001000, EnableCursor = 0b00001010,
  DisableCursorBlink = 0b00001000, EnableCursorBlink = 0b00001001, ShiftCursorLeft = 0b00010000, ShiftCursorRight = 0b00010100
}
 

Public Member Functions

 Hd44780Dual (uint8_t width, uint8_t height)
 Constructor.
 
void initialize ()
 Initialize the display. More...
 
virtual void writeRaw (char c)
 
virtual void setCursor (uint8_t column, uint8_t line)
 
void execute (Command command)
 
void clear ()
 
IOStreamascii ()
 set the output mode to ASCII style for integer types
 
IOStreambin ()
 set the output mode to binary style for integer types
 
IOStreamendl ()
 
IOStreamflush ()
 
IOStreamget (char &c)
 Reads one character and returns it if available. Otherwise, returns IOStream::eof.
 
IOStreamget (char *s, size_t n)
 
template<size_t N>
IOStreamget (char (&s)[N])
 
IOStreamhex ()
 set the output mode to hexadecimal style for integer types
 
IOStreamoperator<< (const bool &v)
 
IOStreamoperator<< (const char &v)
 
IOStreamoperator<< (const uint8_t &v)
 
IOStreamoperator<< (const int16_t &v)
 
IOStreamoperator<< (const uint16_t &v)
 
IOStreamoperator<< (const int32_t &v)
 
IOStreamoperator<< (const uint32_t &v)
 
IOStreamoperator<< (const int64_t &v)
 
IOStreamoperator<< (const uint64_t &v)
 
IOStreamoperator<< (const int &v)
 
IOStreamoperator<< (const unsigned int &v)
 
IOStreamoperator<< (const float &v)
 
IOStreamoperator<< (const double &v)
 
IOStreamoperator<< (const char *s)
 
IOStreamoperator<< (const void *p)
 write the hex value of a pointer
 
template<class Ret , class... Args>
IOStreamoperator<< (Ret (*pointer)(Args...))
 Write the hex value of any function pointer.
 
IOStreamoperator<< (IOStream &(*format)(IOStream &))
 
IOStreamprintf (const char *fmt,...)))
 
IOStreamvprintf (const char *fmt, va_list vlist)))
 
void write (char c)
 

Static Public Attributes

static constexpr char eof = -1
 

Protected Typedefs

using driver1 = Hd44780Base< DATA, RW, RS, E1 >
 
using driver2 = Hd44780Base< DATA, RW, RS, E2 >
 

Protected Member Functions

void writeBin (uint8_t value)
 
void writeDouble (const double &value)
 
void writeFloat (float value)
 
void writeHex (uint8_t value)
 
void writeInteger (int16_t value)
 
void writeInteger (uint16_t value)
 
void writeInteger (int32_t value)
 
void writeInteger (uint32_t value)
 
void writeInteger (int64_t value)
 
void writeInteger (uint64_t value)
 
template<typename T >
void writeIntegerMode (const T v)
 
void writePointer (const void *value)
 

Protected Attributes

uint8_t column
 
uint8_t line
 
uint8_t lineCount
 
uint8_t lineWidth
 
Writer writer
 

Detailed Description

template<typename DATA, typename RW, typename RS, typename E1, typename E2>
class modm::Hd44780Dual< DATA, RW, RS, E1, E2 >

Driver for HD447800 compatible displays with two controller

This driver supports two controllers, with any configuration up to 160 characters like 40x4. You can choose to use a 4bit bus or a 8bit bus, simply by providing one with the propriate width.

Template Parameters
DATAA 8bit or 4bit Port.
RWRead/Write-Select Pin
RSCommand/Data-Select Pin
E1Enable Pin 1
E2Enable Pin 2
See also
http://en.wikipedia.org/wiki/HD44780_Character_LCD
Author
Niklas Hauser

Member Enumeration Documentation

Enum ValuesDocumentation
ClearDisplay 

Clear the display content.

ResetCursor 

Set cursor to position (0,0)

IncrementCursor 

Increments address upon write.

DecrementCursor 

Decrements address upon write.

DisableDisplay 

Disable display.

EnableDisplay 

Enable display.

DisableCursor 

Disable cursor.

EnableCursor 

Enable cursor.

DisableCursorBlink 

Disable blinking cursor.

EnableCursorBlink 

Enable blinking cursor.

ShiftCursorLeft 

Shift cursor left.

ShiftCursorRight 

Shift cursor right.

Member Function Documentation

IOStream & modm::IOStream::get ( char *  s,
size_t  n 
)
inherited

reads characters into NULL delimited c string in contrast to the standard implementation, this does not care about newline characters in the input

template<typename DATA , typename RW , typename RS , typename E1 , typename E2 >
void modm::Hd44780Dual< DATA, RW, RS, E1, E2 >::initialize ( )

Initialize the display.

The display needs some time to initialize after startup. You have to wait at least 50 ms after startup before calling this method.

template<typename DATA , typename RW , typename RS , typename E1 , typename E2 >
virtual void modm::Hd44780Dual< DATA, RW, RS, E1, E2 >::setCursor ( uint8_t  column,
uint8_t  line 
)
virtual

Set cursor to specified position

Parameters
columnhorizontal position
linevertical position

Implements modm::CharacterDisplay.

void modm::CharacterDisplay::write ( char  c)
inherited

Write a character

This method provides an automatic wrap-round if the output reaches the end of the current line or a newline character is detected.

Use writeRaw() if this behavior is not wanted.

template<typename DATA , typename RW , typename RS , typename E1 , typename E2 >
virtual void modm::Hd44780Dual< DATA, RW, RS, E1, E2 >::writeRaw ( char  c)
virtual

Write a raw character at cursor position

Unlike write() no further processing will occur.

See also
write()

Implements modm::CharacterDisplay.


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