Difference between revisions of "Unit HD44780"
(3 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
---- | ---- | ||
− | '''Hitachi HD44780 LCD | + | '''Hitachi HD44780 LCD Controller Driver unit''' |
The Hitachi HD44780 is a dot matrix liquid crystal display controller. It supports 5x8 or 5x10 characters and includes a 240 character font in ROM, 80 bytes of character RAM and 64 bytes of character generator RAM for custom characters. | The Hitachi HD44780 is a dot matrix liquid crystal display controller. It supports 5x8 or 5x10 characters and includes a 240 character font in ROM, 80 bytes of character RAM and 64 bytes of character generator RAM for custom characters. | ||
Line 31: | Line 31: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''HD44780 instruction | + | <div style="font-size: 14px; padding-left: 12px;">'''HD44780 instruction''' <code> HD44780_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 63: | Line 63: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''HD44780 entry mode set | + | <div style="font-size: 14px; padding-left: 12px;">'''HD44780 entry mode set''' <code> HD44780_ENTRYMODESET_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 83: | Line 83: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''HD44780 display control | + | <div style="font-size: 14px; padding-left: 12px;">'''HD44780 display control''' <code> HD44780_DISPLAYCONTROL_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 109: | Line 109: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''HD44780 cursor shift | + | <div style="font-size: 14px; padding-left: 12px;">'''HD44780 cursor shift''' <code> HD44780_CURSORSHIFT_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 129: | Line 129: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''HD44780 function set | + | <div style="font-size: 14px; padding-left: 12px;">'''HD44780 function set''' <code> HD44780_FUNCTIONSET_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 155: | Line 155: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''HD44780 row offset | + | <div style="font-size: 14px; padding-left: 12px;">'''HD44780 row offset''' <code> HD44780_ROW_OFFSETS* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 171: | Line 171: | ||
− | '''HD44780 character | + | '''HD44780 character''' |
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
Line 186: | Line 186: | ||
</div></div> | </div></div> | ||
− | '''HD44780 console | + | '''HD44780 console''' |
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
Line 272: | Line 272: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 284: | Line 284: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 299: | Line 299: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use ConsoleDeviceOpen instead | + | | Not intended to be called directly by applications, use ConsoleDeviceOpen instead. |
|- | |- | ||
|} | |} | ||
Line 311: | Line 311: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use ConsoleDeviceClose instead | + | | Not intended to be called directly by applications, use ConsoleDeviceClose instead. |
|- | |- | ||
|} | |} | ||
Line 323: | Line 323: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use ConsoleDeviceClear instead | + | | Not intended to be called directly by applications, use ConsoleDeviceClear instead. |
|- | |- | ||
|} | |} | ||
Line 335: | Line 335: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use ConsoleDeviceScroll instead | + | | Not intended to be called directly by applications, use ConsoleDeviceScroll instead. |
|- | |- | ||
|} | |} | ||
Line 347: | Line 347: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use ConsoleDeviceDrawChar instead | + | | Not intended to be called directly by applications, use ConsoleDeviceDrawChar instead. |
|- | |- | ||
|} | |} | ||
Line 359: | Line 359: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use ConsoleDeviceDrawText instead | + | | Not intended to be called directly by applications, use ConsoleDeviceDrawText instead. |
|- | |- | ||
|} | |} | ||
Line 371: | Line 371: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use ConsoleDeviceDrawBlock instead | + | | Not intended to be called directly by applications, use ConsoleDeviceDrawBlock instead. |
|- | |- | ||
|} | |} | ||
Line 378: | Line 378: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function HD44780ConsoleDrawWindow(Console:PConsoleDevice; Handle:TWindowHandle):LongWord;</pre> | + | <pre style="border: 0; padding-bottom:0px;">function HD44780ConsoleDrawWindow(Console:PConsoleDevice; Handle:TWindowHandle; Flags:LongWord):LongWord;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of ConsoleDeviceDrawWindow API for HD44780</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of ConsoleDeviceDrawWindow API for HD44780</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the Window lock | | Caller must hold the Window lock | ||
− | Not intended to be called directly by applications, use ConsoleDeviceDrawWindow instead | + | Not intended to be called directly by applications, use ConsoleDeviceDrawWindow instead. |
|- | |- | ||
|} | |} | ||
Line 396: | Line 396: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use ConsoleDevicePutText instead | + | | Not intended to be called directly by applications, use ConsoleDevicePutText instead. |
|- | |- | ||
|} | |} | ||
Line 408: | Line 408: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use ConsoleDeviceGetPosition instead | + | | Not intended to be called directly by applications, use ConsoleDeviceGetPosition instead. |
|- | |- | ||
|} | |} | ||
Line 423: | Line 423: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the Console lock | | Caller must hold the Console lock | ||
|- | |- | ||
Line 435: | Line 435: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the Console lock | | Caller must hold the Console lock | ||
|- | |- | ||
Line 447: | Line 447: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the Console lock | | Caller must hold the Console lock | ||
|- | |- | ||
Line 459: | Line 459: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the Console lock | | Caller must hold the Console lock | ||
|- | |- | ||
Line 471: | Line 471: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the Console lock | | Caller must hold the Console lock | ||
|- | |- | ||
Line 483: | Line 483: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the Console lock | | Caller must hold the Console lock | ||
|- | |- | ||
Line 495: | Line 495: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the Console lock | | Caller must hold the Console lock | ||
|- | |- | ||
Line 507: | Line 507: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the Console lock | | Caller must hold the Console lock | ||
|- | |- | ||
Line 519: | Line 519: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the Console lock | | Caller must hold the Console lock | ||
|- | |- |
Latest revision as of 05:43, 31 August 2021
Return to Unit Reference
Contents
[hide]Description
Hitachi HD44780 LCD Controller Driver unit
The Hitachi HD44780 is a dot matrix liquid crystal display controller. It supports 5x8 or 5x10 characters and includes a 240 character font in ROM, 80 bytes of character RAM and 64 bytes of character generator RAM for custom characters.
The device support 4 bit or 8 bit modes, and has a range of standard functions for display clear, display on/off, cursor on/off, character blink, cursor shift etc.
This unit creates a Console device to represent the LCD and provides the standard console device functions (where appropriate) to draw text, clear the screen, scroll text and manage the cursor.
Currently only 4 bit mode is supported but extension to include 8 bit mode is possible with some additional setup and support functions.
Constants
HD44780_CONSOLE_*
HD44780_*
HD44780_ENTRYMODESET_*
HD44780_DISPLAYCONTROL_*
HD44780_CURSORSHIFT_*
HD44780_FUNCTIONSET_*
HD44780_ROW_OFFSETS*
Type definitions
HD44780 character
HD44780 console
Public variables
None defined
Function declarations
HD44780 functions
function HD44780ConsoleCreate(GPIO:PGPIODevice; const Name:String; Width,Height,RS,RW,EN,D4,D5,D6,D7:LongWord):PConsoleDevice;
function HD44780ConsoleDestroy(Console:PConsoleDevice):LongWord;
HD44780 console functions
function HD44780ConsoleOpen(Console:PConsoleDevice):LongWord;
function HD44780ConsoleClose(Console:PConsoleDevice):LongWord;
function HD44780ConsoleClear(Console:PConsoleDevice; Color:LongWord):LongWord;
function HD44780ConsoleScroll(Console:PConsoleDevice; X1,Y1,X2,Y2,Count,Direction:LongWord):LongWord;
function HD44780ConsoleDrawChar(Console:PConsoleDevice; Handle:TFontHandle; Ch:Char; X,Y,Forecolor,Backcolor:LongWord):LongWord;
function HD44780ConsoleDrawText(Console:PConsoleDevice; Handle:TFontHandle; const Text:String; X,Y,Forecolor,Backcolor,Len:LongWord):LongWord;
function HD44780ConsoleDrawBlock(Console:PConsoleDevice; X1,Y1,X2,Y2,Color:LongWord):LongWord;
function HD44780ConsoleDrawWindow(Console:PConsoleDevice; Handle:TWindowHandle; Flags:LongWord):LongWord;
function HD44780ConsolePutText(Console:PConsoleDevice; Handle:TFontHandle; const Source,Dest:TConsolePoint; Buffer:PConsoleChar; Width,Height,Skip:LongWord):LongWord;
function HD44780ConsoleGetPosition(Console:PConsoleDevice; Position:LongWord; var X1,Y1,X2,Y2:LongWord):LongWord;
HD44780 helper functions
function HD44780WriteChar(Console:PHD44780Console; Ch:Char):LongWord;
function HD44780WriteData(Console:PHD44780Console; Value:Byte):LongWord;
function HD44780PulseEnable(Console:PHD44780Console):LongWord;
function HD44780CursorHome(Console:PHD44780Console):LongWord;
function HD44780CursorBlink(Console:PHD44780Console; Blink:Boolean):LongWord;
function HD44780CursorVisible(Console:PHD44780Console; Visible:Boolean):LongWord;
function HD44780CursorPosition(Console:PHD44780Console; Row,Col:Byte):LongWord;
function HD44780DisplayEnabled(Console:PHD44780Console; Enabled:Boolean):LongWord;
function HD44780AddCharacter(Console:PHD44780Console; Location:Byte; Character:THD44780Character):LongWord;
Return to Unit Reference