Difference between revisions of "Unit AF16x2LCD"
Line 90: | Line 90: | ||
<br /> | <br /> | ||
+ | '''AF16x2LCD functions''' | ||
+ | |||
+ | <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 AF16x2LCDGetButton(Handle:THandle; Button:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the GPIO level of a button on the AF16x2LCD display</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the AF16x2LCD or INVALID_HANDLE_VALUE for the default display | ||
+ | |- | ||
+ | ! '''Button''' | ||
+ | | The button to get the level for (eg AF16X2LCD_BUTTON_LEFT) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The GPIO level of the button (eg GPIO_LEVEL_HIGH) or GPIO_LEVEL_UNKNOWN on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <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 AF16x2LCDBacklightOn(Handle:THandle):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Turn on the backlight on the AF16x2LCD display</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the AF16x2LCD or INVALID_HANDLE_VALUE for the default display | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | True if completed or False on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <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 AF16x2LCDBacklightOff(Handle:THandle):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Turn off the backlight on the AF16x2LCD display</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the AF16x2LCD or INVALID_HANDLE_VALUE for the default display | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | True if completed or False on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <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 AF16x2LCDBacklightColor(Handle:THandle; Red,Green,Blue:Byte):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the backlight color on the AF16x2LCD display</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the AF16x2LCD or INVALID_HANDLE_VALUE for the default display | ||
+ | |- | ||
+ | ! '''Red''' | ||
+ | | The Red value (0 for Off / 1 for On) | ||
+ | |- | ||
+ | ! '''Green''' | ||
+ | | The Green value (0 for Off / 1 for On) | ||
+ | |- | ||
+ | ! '''Blue''' | ||
+ | | The Blue value (0 for Off / 1 for On) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | True if completed or False on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
Return to [[Unit_Reference|Unit Reference]] | Return to [[Unit_Reference|Unit Reference]] |
Revision as of 23:48, 13 October 2016
Return to Unit Reference
Contents
[hide]Description
The Adafruit 16x2 LCD + Keypad is a kit that includes both a 16x2 LCD display using the Hitachi HD44780 LCD controller as well as a custom PCB with an MCP23017 I/O expander to connect it to a Raspberry Pi (any model) using I2C. It is available in Monochrome or RGB Positive and Negative versions.
This unit ties together the various components needed to make one of these boards work with Ultibo by finding the correct I2C device, creating the MCP230XX GPIO device, creating the HD44780 Console device and registering all of it with the correct parameters for the Adafruit kit.
The unit also includes functions to read the 5 buttons on the board and control the LCD backlight.
You will find many LCD display boards based on the Hitachi HD44780 controller and this unit gives an example of how to assembler the available units to create your own driver for a different board.
Constants
To be documented
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
function AF16x2LCDStart(Model:LongWord;Invert:Boolean; const Device:String; Address:Word):THandle;
function AF16x2LCDStop(Handle:THandle):Boolean;
AF16x2LCD functions
function AF16x2LCDGetButton(Handle:THandle; Button:LongWord):LongWord;
function AF16x2LCDBacklightOn(Handle:THandle):Boolean;
function AF16x2LCDBacklightOff(Handle:THandle):Boolean;
function AF16x2LCDBacklightColor(Handle:THandle; Red,Green,Blue:Byte):Boolean;
Return to Unit Reference