Appendix C. LCD/Keypad Module
An optional LCD/keypad is available for the LP3500. Appendix C describes the LCD/keypad module and provides the software calls to make full use of the LCD/keypad module.
C.1 Specifications
Two optional LCD/keypad modules--with or without a panel-mounted NEMA 4 water-resistant bezel--are available for use with the LP3500. They are shown in Figure C-1.
Figure C-1. LCD/Keypad Module Models
LCD/keypad modules sold prior to the launch of the LP3500 might not be voltage-compatible with the LP3500. Contact your Rabbit sales representative or your authorized distributor for further assistance in purchasing an LCD/keypad module.
Mounting hardware and a 127 mm (5") or 60 cm (24") extension cable are also available for the LCD/keypad module through your Rabbit sales representative or authorized distributor.
Table C-1 lists the electrical, mechanical, and environmental specifications for the LCD/keypad module.
Table C-1. LCD/Keypad Specifications
Parameter
|
Specification
|
Board Size
|
2.60" × 3.00" × 0.75" (66 mm × 76 mm × 19 mm)
|
Bezel Size
|
4.50" × 3.60" × 0.30" (114 mm × 91 mm × 7.6 mm)
|
Temperature
|
Operating Range: 0°C to +50°C Storage Range: -40°C to +85°C
|
Humidity
|
5% to 95%, noncondensing
|
Power Consumption
|
1.5 W maximum with backlight on1
|
Connections
|
Connects to header J9 (Display Interface) on LP3500
|
LCD Panel Size
|
122 × 32 graphic display
|
Keypad
|
7-key keypad
|
LEDs
|
Seven user-programmable LEDs
|
1
The backlight adds approximately 650 mW to the power consumption.
|
|
The LCD/keypad module has 0.1" IDC header sockets at J1, J2, and J3 for physical connection to other boards or ribbon cables. Figure C-2 shows the LCD/keypad module footprint. These values are relative to one of the mounting holes.
|
NOTE
|
All measurements are in inches followed by millimeters enclosed in parentheses. All dimensions have a manufacturing tolerance of ±0.01" (0.25 mm).
|
|
Figure C-2. User Board Footprint for
LCD/Keypad Module
|
C.2 Contrast Adjustment
Starting in 2005, LCD/keypad modules were factory-configured to optimize their contrast based on the voltage of the system they would be used in. Be sure to select a KDU3V LCD/keypad module for use with the LP3500 -- these modules operate at 3.3 V. You may adjust the contrast using the potentiometer at R2 as shown in Figure C-3. KDU5V LCD/keypad modules configured for 5 V may be used with the LP3500, but the backlight will be dim.
Figure C-3. LCD/Keypad Module Contrast Adjustment
You can set the contrast on the LCD display of pre-2005 LCD/keypad modules by adjusting the potentiometer at R2 or by setting the voltage for 2.8 V by connecting the jumper across pins 1-2 on header J5 as shown in Figure C-3. Only one of these two options is available on these older LCD/keypad modules.
|
NOTE
|
Older LCD/keypad modules that do not have a header at J5 or a contrast adjustment potentiometer at R2 are limited to operate only at 5 V, and will not work with the LP3500. The older LCD/keypad modules are no longer being sold.
|
C.3 Keypad Labeling
The keypad may be labeled according to your needs. A template is provided in Figure C-4 to allow you to design your own keypad label insert.
Figure C-4. Keypad Template
To replace the keypad legend, remove the old legend and insert your new legend prepared according to the template in Figure C-4. The keypad legend is located under the blue keypad matte, and is accessible from the left only as shown in Figure C-5.
Figure C-5. Removing and Inserting Keypad Label
The sample program KEYBASIC.C in the 122x32_1x7 folder in SAMPLES\LCD_KEYPAD shows how to reconfigure the keypad for different applications.
C.4 Header Pinouts
Figure C-6 shows the pinouts for the LCD/keypad module.
Figure C-6. LCD/Keypad Module Pinouts
|
NOTE
|
Note that there are no connections from headers J2 and J3 of the LCD/keypad module to the LP3500. These headers interface to the keypad and to the LEDs on the LCD/keypad module, and need to be interfaced to the digital I/O on the LP3500 if you need keypad or LED functionality. The LEDs may be driven by an active signal either in software or in hardware.
|
C.4.1 I/O Address Assignments
The LCD and keypad on the LCD/keypad module are addressed by the /CS strobe as explained in Table C-2.
Table C-2. LCD/Keypad Module Address Assignment
Address
|
Function
|
0xE000
|
Device select base address (/CS)
|
0xExx0-0xExx7
|
LCD control
|
0xExx8
|
LED enable
|
0xExx9
|
Not used
|
0xExxA
|
7-key keypad
|
0xExxB (bits 0-6)
|
7-LED driver
|
0xExxB (bit 7)
|
LCD backlight on/off
|
0xExxC-ExxF
|
Not used
|
C.5 Bezel-Mount Installation
This section describes and illustrates how to bezel-mount the LCD/keypad module. Follow these steps for bezel-mount installation.
- Cut mounting holes in the mounting panel in accordance with the recommended dimensions in Figure C-7, then use the bezel faceplate to mount the LCD/keypad module onto the panel.
Figure C-7. Recommended Cutout Dimensions
- Carefully "drop in" the LCD/keypad module with the bezel and gasket attached.
- Fasten the unit with the four 4-40 screws and washers included with the LCD/keypad module. If your panel is thick, use a 4-40 screw that is approximately 3/16" (5 mm) longer than the thickness of the panel.
Figure C-8. LCD/Keypad Module Mounted in Panel (rear view)
Carefully tighten the screws until the gasket is compressed and the plastic bezel faceplate is touching the panel.
Do not tighten each screw fully before moving on to the next screw. Apply only one or two turns to each screw in sequence until all are tightened manually as far as they can be so that the gasket is compressed and the plastic bezel faceplate is touching the panel.
C.6 Connect the LCD/Keypad Module to Your LP3500
The LCD/keypad module can be located as far as 2 ft. (60 cm) away from the LP3500, and is connected via a ribbon cable as shown in Figure C-9.
Figure C-9. Connecting LCD/Keypad Module to LP3500
Note the locations and connections relative to pin 1 on both the LP3500 and the LCD/keypad module.
Rabbit offers two different lengths of ribbon cable-5" (127 mm) and 2 ft. (60 cm). Contact your authorized distributor or a Rabbit sales representative for more information.
C.7 LCD/Keypad Module Function Calls
The LCD/keypad module is normally off. Add the devPowerSet function call after brdInit to turn on the LCD/keypad buffers.
brdInit(); // Initialize the LP3500
devPowerSet(DISPDEV, 1); // Enable LCD/keypad buffer
C.7.1 LEDs
When power is applied to the LCD/keypad module for the first time, the red LED (DS1) will come on, indicating that power is being applied to the LCD/keypad module. The red LED is turned off when the brdInit function executes.
One function is available to control the LEDs, and can be found in the LIB\Rabbit3000\DISPLAYS\LCD122KEY7.LIB library.
void dispLedOut(int led, int value);
|
- LED on/off control. This function will only work when the LCD/keypad module is connected to the
LP3500.
PARAMETERS
-
led is the LED to control.
- 0 = LED DS1
1 = LED DS2
2 = LED DS3
3 = LED DS4
4 = LED DS5
5 = LED DS6
6 = LED DS7
-
value is the value used to control whether the LED is on or off (0 or 1).
- 0 = off
1 = on
RETURN VALUE
- None.
SEE ALSO
brdInit
C.7.2 LCD Display
The functions used to control the LCD display are contained in the LIB\Rabbit3000\DISPLAYS\GRAPHIC.LIB library. When x and y coordinates on the display screen are specified, x can range from 0 to 121, and y can range from 0 to 31. These numbers represent pixels from the top left corner of the display.
- Initializes the display devices, clears the screen.
RETURN VALUE
- None.
SEE ALSO
glDispOnOFF, glBacklight, glSetContrast, glPlotDot, glBlock, glPlotDot, glPlotPolygon, glPlotCircle, glHScroll, glVScroll, glXFontInit, glPrintf, glPutChar, glSetBrushType, glBuffLock, glBuffUnlock, glPlotLine
void glBackLight(int onOff);
|
- Turns the display backlight on or off.
PARAMETER
- onOff turns the backlight on or off
- 1--turn the backlight on
0--turn the backlight off
RETURN VALUE
- None.
SEE ALSO
glInit, glDispOnoff, glSetContrast
void glDispOnOff(int onOff);
|
- Sets the LCD screen on or off. Data will not be cleared from the screen.
PARAMETER
- onOff turns the LCD screen on or off
- 1--turn the LCD screen on
0--turn the LCD screen off
RETURN VALUE
- None.
SEE ALSO
glInit, glSetContrast, glBackLight
void glSetContrast(unsigned level);
|
- Sets display contrast.
|
NOTE
|
This function is not used with the LCD/keypad module since the support circuits are not available on the LCD/keypad module.
|
void glFillScreen(char pattern);
|
- Fills the LCD display screen with a pattern.
PARAMETER
- The screen will be set to all black if
pattern is 0xFF, all white if pattern is 0x00, and vertical stripes
for any other pattern.
RETURN VALUE
- None.
SEE ALSO
glBlock, glBlankScreen, glPlotPolygon, glPlotCircle
void glBlankScreen(void);
|
- Blanks the LCD display screen (sets LCD display screen to white).
RETURN VALUE
- None.
SEE ALSO
glFillScreen, glBlock, glPlotPolygon, glPlotCircle
void glBlock(int x, int y, int bmWidth,
int bmHeight);
|
- Draws a rectangular block in the page buffer and on the LCD if the buffer is unlocked. Any portion of the
block that is outside the LCD display area will be clipped.
PARAMETERS
-
x is the x coordinate of the top left corner of the block.
-
y is the y coordinate of the top left corner of the block.
-
bmWidth is the width of the block.
-
bmWidth is the height of the block.
RETURN VALUE
- None.
SEE ALSO
glFillScreen, glBlankScreen, glPlotPolygon, glPlotCircle
void glPlotVPolygon(int n, int *pFirstCoord);
|
- Plots the outline of a polygon in the LCD page buffer, and on the LCD if the buffer is unlocked. Any
portion of the polygon that is outside the LCD display area will be clipped. If fewer than 3 vertices are
specified, the function will return without doing anything.
PARAMETERS
-
n is the number of vertices.
-
*pFirstCoord is a pointer to array of vertex coordinates: x1,y1, x2,y2, x3,y3,...
RETURN VALUE
- None.
SEE ALSO
glPlotPolygon, glFillPolygon, glFillVPolygon
void glPlotPolygon(int n, int y1, int x2, int y2,
...);
|
- Plots the outline of a polygon in the LCD page buffer and on the LCD if the buffer is unlocked. Any
portion of the polygon that is outside the LCD display area will be clipped. If fewer than 3 vertices are
specified, the function will return without doing anything.
PARAMETERS
-
n is the number of vertices.
-
y1 is the y coordinate of the first vertex.
-
x1 is the x coordinate of the first vertex.
-
y2 is the y coordinate of the second vertex.
-
x2 is the x coordinate of the second vertex.
-
... are the coordinates of additional vertices.
RETURN VALUE
- None.
SEE ALSO
glPlotVPolygon, glFillPolygon, glFillVPolygon
void glFillVPolygon(int n, int *pFirstCoord);
|
- Fills a polygon in the LCD page buffer and on the LCD screen if the buffer is unlocked. Any portion of
the polygon that is outside the LCD display area will be clipped. If fewer than 3 vertices are specified,
the function will return without doing anything.
PARAMETERS
-
n is the number of vertices.
-
*pFirstCoord is a pointer to array of vertex coordinates: x1,y1, x2,y2, x3,y3,...
RETURN VALUE
- None.
SEE ALSO
glFillPolygon, glPlotPolygon, glPlotVPolygon
void glFillPolygon(int n, int x1, int y1, int x2,
int y2, ...);
|
- Fills a polygon in the LCD page buffer and on the LCD if the buffer is unlocked. Any portion of the
polygon that is outside the LCD display area will be clipped. If fewer than 3 vertices are specified, the
function will return without doing anything.
PARAMETERS
-
n is the number of vertices.
-
x1 is the x coordinate of the first vertex.
-
y1 is the y coordinate of the first vertex.
-
x2 is the x coordinate of the second vertex.
-
y2 is the y coordinate of the second vertex.
-
... are the coordinates of additional vertices.
RETURN VALUE
- None.
SEE ALSO
glFillVPolygon, glPlotPolygon, glPlotVPolygon
void glPlotCircle(int xc, int yc, int rad);
|
- Draws the outline of a circle in the LCD page buffer and on the LCD if the buffer is unlocked. Any portion
of the circle that is outside the LCD display area will be clipped.
PARAMETERS
-
xc is the x coordinate of the center of the circle.
-
yc is the y coordinate of the center of the circle.
-
rad is the radius of the center of the circle (in pixels).
RETURN VALUE
- None.
SEE ALSO
glFillCircle, glPlotPolygon, glFillPolygon
void glFillCircle(int xc, int yc, int rad);
|
- Draws a filled circle in the LCD page buffer and on the LCD if the buffer is unlocked. Any portion of the
circle that is outside the LCD display area will be clipped.
PARAMETERS
-
xc is the x coordinate of the center of the circle.
-
yc is the y coordinate of the center of the circle.
-
rad is the radius of the center of the circle (in pixels).
RETURN VALUE
- None.
SEE ALSO
glPlotCircle, glPlotPolygon, glFillPolygon
void glXFontInit(fontInfo *pInfo, char pixWidth,
char pixHeight, unsigned startChar,
unsigned endChar, unsigned long xmemBuffer);
|
- Initializes the font descriptor structure, where the font is stored in
xmem.
PARAMETERS
-
*pInfo is a pointer to the font descriptor to be initialized.
-
pixWidth is the width (in pixels) of each font item.
-
pixHeight is the height (in pixels) of each font item.
-
startChar is the value of the first printable character in the font character set.
-
endChar is the value of the last printable character in the font character set.
-
xmemBuffer is the xmem pointer to a linear array of font bitmaps.
RETURN VALUE
- None.
SEE ALSO
glPrinf
unsigned long glFontCharAddr(fontInfo *pInfo,
char letter);
|
- Returns the
xmem address of the character from the specified font set.
PARAMETERS
-
*pInfo is the xmem address of the bitmap font set.
-
letter is an ASCII character.
RETURN VALUE
-
xmem address of bitmap character font, column major, and byte-aligned.
SEE ALSO
glPutFont, glPrintf
void glPutFont(int x, int y, fontInfo *pInfo,
char code);
|
- Puts an entry from the font table to the page buffer and on the LCD if the buffer is unlocked. Each font
character's bitmap is column major and byte-aligned. Any portion of the bitmap character that is outside
the LCD display area will be clipped.
PARAMETERS
-
x is the x coordinate (column) of the top left corner of the text.
-
y is the y coordinate (row) of the top left corner of the text.
-
*pInfo is a pointer to the font descriptor.
-
code is the ASCII character to display.
RETURN VALUE
- None.
SEE ALSO
glFontCharAddr, glPrintf
void glSetPfStep(int stepX, int stepY);
|
- Sets the
glPrintf() printing step direction. The x and y step directions are independent signed values.
The actual step increments depend on the height and width of the font being displayed, which are multiplied
by the step values.
PARAMETERS
-
stepX is the glPrintf x step value
-
stepY is the glPrintf y step value
RETURN VALUE
- None.
SEE ALSO
- Use
glGetPfStep() to examine the current x and y printing step direction.
- Gets the current
glPrintf() printing step direction. Each step direction is independent of the other,
and is treated as an 8-bit signed value. The actual step increments depends on the height and width of the
font being displayed, which are multiplied by the step values.
RETURN VALUE
- The x step is returned in the MSB, and the y step is returned in the LSB of the integer result.
SEE ALSO
- Use
glGetPfStep() to control the x and y printing step direction.
void glPutChar(char ch, char *ptr, int *cnt,
glPutCharInst *pInst)
|
- Provides an interface between the STDIO string-handling functions and the graphic library. The
STDIO string-formatting function will call this function, one character at a time, until the entire formatted
string has been parsed. Any portion of the bitmap character that is outside the LCD display area will
be clipped.
PARAMETERS
-
ch is the character to be displayed on the LCD.
-
*ptr is not used, but is a place holder for STDIO string functions.
-
*cnt is not used, is a place holder for STDIO string functions.
-
*pInst is a font descriptor pointer.
RETURN VALUE
- None.
SEE ALSO
glPrintf, glPutFont, doprnt
void glPrintf(int x, int y, fontInfo *pInfo,
char *fmt, ...);
|
- Prints a formatted string (much like
printf) on the LCD screen. Only the character codes that exist in
the font set are printed, all others are skipped. For example, '\b', '\t', '\n' and '\r' (ASCII backspace, tab,
new line, and carriage return, respectively) will be printed if they exist in the font set, but will not have
any effect as control characters. Any portion of the bitmap character that is outside the LCD display area
will be clipped.
PARAMETERS
-
x is the x coordinate (column) of the top left corner of the text.
-
y is the y coordinate (row) of the top left corner of the text.
-
*pInfo is a font descriptor pointer.
-
*fmt is a formatted string.
-
... are formatted string conversion parameter(s).
EXAMPLE
glprintf(0,0, &fi12x16, "Test %d\n", count);
RETURN VALUE
- None.
SEE ALSO
glXFontInit
- Increments LCD screen locking counter. Graphic calls are recorded in the LCD memory buffer and are
not transferred to the LCD if the counter is non-zero.
|
NOTE
|
glBuffLock() and glBuffUnlock() can be nested up to a level of 255, but be sure to balance the calls. It is not a requirement to use these procedures, but a set of glBuffLock() and glBuffUnlock() bracketing a set of related graphic calls speeds up the rendering significantly.
|
RETURN VALUE
- None.
SEE ALSO
glBuffUnlock, glSwap
- Decrements the LCD screen locking counter. The contents of the LCD buffer are transferred to the LCD
if the counter goes to zero.
RETURN VALUE
- None.
SEE ALSO
glBuffLock, glSwap
- Checks the LCD screen locking counter. The contents of the LCD buffer are transferred to the LCD if the
counter is zero.
RETURN VALUE
- None.
SEE ALSO
glBuffUnlock, glBuffLock, _glSwapData (located in the library specifically for the LCD that you are using)
void glSetBrushType(int type);
|
- Sets the drawing method (or color) of pixels drawn by subsequent graphic calls.
PARAMETER
-
type value can be one of the following macros.
-
PIXBLACK draws black pixels (turns pixel on).
PIXWHITE draws white pixels (turns pixel off).
PIXXOR draws old pixel XOR'ed with the new pixel.
RETURN VALUE
- None.
SEE ALSO
glGetBrushType
int glGetBrushType(void);
|
- Gets the current method (or color) of pixels drawn by subsequent graphic calls.
RETURN VALUE
- The current brush type.
SEE ALSO
glSetBrushType
void glPlotDot(int x, int y);
|
- Draws a single pixel in the LCD buffer, and on the LCD if the buffer is unlocked. If the coordinates are
outside the LCD display area, the dot will not be plotted.
PARAMETERS
-
x is the x coordinate of the dot.
-
y is the y coordinate of the dot.
RETURN VALUE
- None.
SEE ALSO
glPlotline, glPlotPolygon, glPlotCircle
void glPlotLine(int x0, int y0, int x1, int y1);
|
- Draws a line in the LCD buffer, and on the LCD if the buffer is unlocked. Any portion of the line that is
beyond the LCD display area will be clipped.
PARAMETERS
-
x0 is the x coordinate of one endpoint of the line.
-
y0 is the y coordinate of one endpoint of the line.
-
x1 is the x coordinate of the other endpoint of the line.
-
y1 is the y coordinate of the other endpoint of the line.
RETURN VALUE
- None.
SEE ALSO
glPlotDot, glPlotPolygon, glPlotCircle
void glLeft1(int left, int top, int cols, int rows);
|
- Scrolls byte-aligned window left one pixel, right column is filled by current pixel type (color).
PARAMETERS
-
left is the top left corner of bitmap, must be evenly divisible by 8, otherwise truncates.
-
top is the top left corner of the bitmap.
-
cols is the number of columns in the window, must be evenly divisible by 8, otherwise truncates.
-
rows is the number of rows in the window.
RETURN VALUE
- None.
SEE ALSO
glHScroll, glRight1
void glRight1(int left, int top, int cols, int rows);
|
- Scrolls byte-aligned window right one pixel, left column is filled by current pixel type (color).
PARAMETERS
-
left is the top left corner of bitmap, must be evenly divisible by 8, otherwise truncates.
-
top is the top left corner of the bitmap.
-
cols is the number of columns in the window, must be evenly divisible by 8, otherwise truncates.
-
rows is the number of rows in the window.
RETURN VALUE
- None.
SEE ALSO
glHScroll, glLeft1
void glUp1(int left, int top, int cols, int rows);
|
- Scrolls byte-aligned window up one pixel, bottom column is filled by current pixel type (color).
PARAMETERS
-
left is the top left corner of bitmap, must be evenly divisible by 8, otherwise truncates.
-
top is the top left corner of the bitmap.
-
cols is the number of columns in the window, must be evenly divisible by 8, otherwise truncates.
-
rows is the number of rows in the window.
RETURN VALUE
- None.
SEE ALSO
glVScroll, glDown1
void glDown1(int left, int top, int cols, int rows);
|
- Scrolls byte-aligned window down one pixel, top column is filled by current pixel type (color).
PARAMETERS
-
left is the top left corner of bitmap, must be evenly divisible by 8, otherwise truncates.
-
top is the top left corner of the bitmap.
-
cols is the number of columns in the window, must be evenly divisible by 8, otherwise truncates.
-
rows is the number of rows in the window.
RETURN VALUE
- None.
SEE ALSO
glVScroll, glUp1
void glHScroll(int left, int top, int cols,
int rows, int nPix);
|
- Scrolls right or left, within the defined window by x number of pixels. The opposite edge of the scrolled
window will be filled in with white pixels. The window must be byte-aligned.
- Parameters will be verified for the following:
- 1. The
left and cols parameters will be verified that they are evenly divisible by 8. If not, they will be truncated to a value that is a multiple of 8.
- 2. Parameters will be checked to verify that the scrolling area is valid. The minimum scrolling area is a width of 8 pixels and a height of one row.
PARAMETERS
-
left is the top left corner of bitmap, must be evenly divisible by 8.
-
top is the top left corner of the bitmap.
-
cols is the number of columns in the window, must be evenly divisible by 8.
-
rows is the number of rows in the window.
-
nPix is the number of pixels to scroll within the defined window (a negative value will produce a scroll
to the left).
RETURN VALUE
- None.
SEE ALSO
glVScroll
void glVScroll(int left, int top, int cols,
int rows, int nPix);
|
- Scrolls up or down, within the defined window by x number of pixels. The opposite edge of the scrolled
window will be filled in with white pixels. The window must be byte-aligned.
- Parameters will be verified for the following:
- 1. The
left and cols parameters will be verified that they are evenly divisible by 8. If not, they will be truncated to a value that is a multiple of 8.
- 2. Parameters will be checked to verify that the scrolling area is valid. The minimum scrolling area is a width of 8 pixels and a height of one row.
PARAMETERS
-
left is the top left corner of bitmap, must be evenly divisible by 8.
-
top is the top left corner of the bitmap.
-
cols is the number of columns in the window, must be evenly divisible by 8.
-
rows is the number of rows in the window.
-
nPix is the number of pixels to scroll within the defined window (a negative value will produce a scroll
up).
RETURN VALUE
- None.
SEE ALSO
glHScroll
void glXPutBitmap(int left, int top, int width,
int height, unsigned long bitmap);
|
- Draws bitmap in the specified space. The data for the bitmap are stored in
xmem. This function calls
glXPutFastmap automatically if the bitmap is byte-aligned (the left edge and the width are each
evenly divisible by 8).
- Any portion of a bitmap image or character that is outside the LCD display area will be clipped.
PARAMETERS
-
left is the top left corner of the bitmap.
-
top is the top left corner of the bitmap.
-
width is the width of the bitmap.
-
height is the height of the bitmap.
-
bitmap is the address of the bitmap in xmem.
RETURN VALUE
- None.
SEE ALSO
glXPutFastmap, glPrintf
void glXPutFastmap(int left, int top, int width,
int height, unsigned long bitmap);
|
- Draws bitmap in the specified space. The data for the bitmap are stored in
xmem. This function is like
glXPutBitmap, except that it is faster. The restriction is that the bitmap must be byte-aligned.
- Any portion of a bitmap image or character that is outside the LCD display area will be clipped.
PARAMETERS
-
left is the top left corner of the bitmap, must be evenly divisible by 8, otherwise truncates.
-
top is the top left corner of the bitmap.
-
width is the width of the bitmap, must be evenly divisible by 8, otherwise truncates.
-
height is the height of the bitmap.
-
bitmap is the address of the bitmap in xmem.
RETURN VALUE
- None.
SEE ALSO
glXPutBitmap, glPrintf
int TextWindowFrame(windowFrame *window,
fontInfo *pFont, int x, int y, int winWidth,
int winHeight)
|
- Defines a text-only display window. This function provides a way to display characters within the text
window using only character row and column coordinates. The text window feature provides end-of-line
wrapping and clipping after the character in the last column and row is displayed.
|
NOTE
|
Execute the TextWindowFrame function before other Text... functions.
|
PARAMETERS
-
*window is a window frame descriptor pointer.
-
*pFont is a font descriptor pointer.
-
x is the x coordinate of the top left corner of the text window frame.
-
y is the y coordinate of the top left corner of the text window frame.
-
winWidth is the width of the text window frame.
-
winHeight is the height of the text window frame.
RETURN VALUE
- 0--window frame was successfully created.
-1--x coordinate + width has exceeded the display boundary.
-2--y coordinate + height has exceeded the display boundary.
void TextGotoXY(windowFrame *window, int col,
int row);
|
- Sets the cursor location to display the next character. The display location is based on the height and
width of the character to be displayed.
|
NOTE
|
Execute the TextWindowFrame function before using this function.
|
PARAMETERS
-
*window is a pointer to a font descriptor.
-
col is a character column location.
-
row is a character row location.
RETURN VALUE
- None.
SEE ALSO
TextPutChar, TextPrintf, TextWindowFrame
void TextCursorLocation(windowFrame *window,
int *col, int *row);
|
- Gets the current cursor location that was set by a Graphic
Text... function.
|
NOTE
|
Execute the TextWindowFrame function before using this function.
|
PARAMETERS
-
*window is a pointer to a font descriptor.
-
*col is a pointer to cursor column variable.
-
*row is a pointer to cursor row variable.
RETURN VALUE
- Lower word = Cursor Row location
Upper word = Cursor Column location
SEE ALSO
TextGotoXY, TextPrintf, TextWindowFrame, TextCursorLocation
void TextPutChar(struct windowFrame *window, char ch);
|
- Displays a character on the display where the cursor is currently pointing. If any portion of a bitmap
character is outside the LCD display area, the character will not be displayed. The cursor increments its
position as needed.
|
NOTE
|
Execute the TextWindowFrame function before using this function.
|
PARAMETERS
-
*window is a pointer to a font descriptor.
-
ch is a character to be displayed on the LCD.
RETURN VALUE
- None.
SEE ALSO
TextGotoXY, TextPrintf, TextWindowFrame, TextCursorLocation
void TextPrintf(struct windowFrame *window,
char *fmt, ...);
|
- Prints a formatted string (much like
printf) on the LCD screen. Only printable characters in the font
set are printed, also escape sequences, '\r' and '\n' are recognized. All other escape sequences will be
skipped over; for example, '\b' and 't' will print if they exist in the font set, but will not have any effect as
control characters.
- The text window feature provides end-of-line wrapping and clipping after the character in the last column
and row is displayed. The cursor then remains at the end of the string.
|
NOTE
|
Execute the TextWindowFrame function before using this function.
|
PARAMETERS
-
*window is a pointer to a font descriptor.
-
*fmt is a formatted string.
-
... are formatted string conversion parameter(s).
EXAMPLE
TextPrintf(&TextWindow, "Test %d\n", count);
RETURN VALUE
- None.
SEE ALSO
TextGotoXY, TextPutChar, TextWindowFrame, TextCursorLocation
C.7.3 Keypad
The functions used to control the keypad are contained in the Dynamic C LIB\Rabbit3000\DISPLAYS\KEYPADS\KEYPAD7.LIB library.
- Initializes keypad process
RETURN VALUE
- None.
SEE ALSO
brdInit
void keyConfig(char cRaw, char cPress,
char cRelease, char cCntHold, char cSpdLo,
char cCntLo, char cSpdHi);
|
- Assigns each key with key press and release codes, and hold and repeat ticks for auto repeat and
debouncing.
PARAMETERS
-
cRaw is a raw key code index.
- 1x7 keypad matrix with raw key code index assignments (in brackets):
- User Keypad Interface
-
cPress is a key press code
- An 8-bit value is returned when a key is pressed.
0 = Unused.
- See
keypadDef() for default press codes.
-
cRelease is a key release code.
- An 8-bit value is returned when a key is pressed.
0 = Unused.
-
cCntHold is a hold tick, which is approximately one debounce period or 5 µs.
- How long to hold before repeating.
0 = No Repeat.
-
cSpdLo is a low-speed repeat tick, which is approximately one debounce period or 5 µs.
- How many times to repeat.
0 = None.
-
cCntLo is a low-speed hold tick, which is approximately one debounce period or 5 µs.
- How long to hold before going to high-speed repeat.
0 = Slow Only.
-
cSpdHi is a high-speed repeat tick, which is approximately one debounce period or 5 µs.
- How many times to repeat after low speed repeat.
0 = None.
RETURN VALUE
- None.
SEE ALSO
keyProcess, keyGet, keypadDef
- Scans and processes keypad data for key assignment, debouncing, press and release, and repeat.
|
NOTE
|
This function is also able to process an 8 x 8 matrix keypad.
|
RETURN VALUE
- None
SEE ALSO
keyConfig, keyGet, keypadDef
- Get next keypress.
RETURN VALUE
- The next keypress, or 0 if none
SEE ALSO
keyConfig, keyProcess, keypadDef
- Pushes the value of
cKey to the top of the input queue, which is 16 bytes deep.
PARAMETER
-
cKey
RETURN VALUE
- None.
SEE ALSO
keyGet
- Configures the physical layout of the keypad with the default ASCII return key codes.
- Keypad physical mapping 1 x 7
- where
'D' represents Down Scroll
'U' represents Up Scroll
'R' represents Right Scroll
'L' represents Left Scroll
'-' represents Page Down
'+' represents Page Up
'E' represents the ENTER key
- Example: Do the following for the above physical vs. ASCII return key codes.
keyConfig ( 3,'R',0, 0, 0, 0, 0 );
keyConfig ( 6,'E',0, 0, 0, 0, 0 );
keyConfig ( 2,'D',0, 0, 0, 0, 0 );
keyConfig ( 4,'-',0, 0, 0, 0, 0 );
keyConfig ( 1,'U',0, 0, 0, 0, 0 );
keyConfig ( 5,'+',0, 0, 0, 0, 0 );
keyConfig ( 0,'L',0, 0, 0, 0, 0 );
- Characters are returned upon keypress with no repeat.
RETURN VALUE
- None.
SEE ALSO
keyConfig, keyGet, keyProcess
void keyScan(char *pcKeys);
|
- Writes "1" to each row and reads the value. The position of a keypress is indicated by a zero value in a bit
position.
Parameter
-
*pcKeys is a pointer to the address of the value read.
RETURN VALUE
- None.
SEE ALSO
keyConfig, keyGet, keypadDef, keyProcess
C.8 Sample Programs
Sample programs illustrating the use of the LCD/keypad module with the LP3500 board are provided in the SAMPLES\LP3500\Display_Keypad directory.
To run a sample program, open it with the File menu (if it is not still open), compile it using the Compile menu, and then run it by selecting Run in the Run menu. The LP3500 must be connected to a PC using the programming cable as described in Section 2.1, "LP3500 Connections." Each sample program contains detailed instructions for running it.