pi-lcd-0.1.0.0: Control an Adafruit character LCD and keypad kit on a Raspberry Pi

Copyright© Patrick Pelletier 2017
LicenseBSD3
Maintainercode@funwithsoftware.org
Safe HaskellSafe
LanguageHaskell2010

System.Hardware.PiLcd.Hd44780

Description

This module lets you control an HD44780U Dot Matrix Liquid Crystal Display Controller/Driver (datasheet), such as the one used in the Adafruit LCD+Keypad Kit.

Only supports 4-bit mode, write only. The user specifies a callback for performing the actual I/O to the chip.

Synopsis

Documentation

data LcdBus Source #

Argument to lcSend. Specifies the state of the bus going to the HD44780. The RW line is always 0, because we only do writes.

Constructors

LcdBus 

Fields

newtype LcdCallbacks Source #

Callback for communicating with the HD44780.

Constructors

LcdCallbacks 

Fields

  • lcSend :: LcdBus -> IO ()

    Sets the values on the bus. If using a direct parallel interface on a fast processor, you may need to insert a brief (500 ns) delay after writing to the bus. (This is unnecessary on the LCD+Keypad Kit, because the I²C operation of the MCP23017 provides more than enough delay.)

lcdInitialize :: LcdCallbacks -> IO () Source #

Initializes the LCD and clears the screen. You must call this function first, before any of the other LCD functions.

lcdClear :: LcdCallbacks -> IO () Source #

Clears the screen.

lcdControl Source #

Arguments

:: LcdCallbacks 
-> Bool

Enable display

-> Bool

Enable underline cursor

-> Bool

Enable blinking block cursor

-> IO () 

Controls what is shown on the LCD.

lcdWrite Source #

Arguments

:: LcdCallbacks 
-> Word8

Line number. Must be 0 or 1. (Even displays with four physical lines are modeled internally as 2 lines.)

-> Word8

Column number, starting at 0.

-> ByteString

Characters to write to the display. Must be encoded in the controller's native character encoding. See Table 4 on pages 17-18 of the HD44780U datasheet.

-> IO () 

Writes text onto the screen. To position the cursor without writing anything, you can write a zero-length string.

lcdDefineChar Source #

Arguments

:: LcdCallbacks 
-> Word8

The character code to define. Must be 0-7.

-> [Word8]

The bitmap data. Must be 8 bytes, with data in the least significant 5 bits of each byte.

-> IO () 

Defines a custom character.