User`s manual
PK220062 s Software Reference
int kpDefGetKey()
This is the default get key function. This function returns the key
previously pressed (i.e., from the one-keypress buffer). The key
pressed is actually interpreted by kpDefStChgFn, which is called back
by kpScanState. The function kpDefInit should be used to
initialize the module.
RETURN VALUE: -1 if no key is pressed. Otherwise it returns the
normalized key number. The normalized key number is
8*row+col+edge*256. Edge is 1if the key is released, and 0 if the key
is pressed.
void kpDefInit()
Initializes the module to use the default state change function to
interpret key presses when kpScanState is called. Use
kpDefGetKey to get the code of the last key pressed.
RETURN VALUE: NA.
Sample Programs
The sample programs listed in Table 5-1 are specific to the PK2200.
They can be found in the SAMPLES\CPLC directory.
Table 5-1. PK2200 Sample Programs
Program Description
5KEYCODE.C
Code-driven sample program for the five-key
system.
5KEYDEMO.C Uses a code-driven five-key system and the
RT-kbyte for I/O monitor and control.
5KEYLAD.C Combines 5KEYCODE.C and LADDERC.C.
5KEYLINK.C
Linked-list sample program for the five-key
system.
5KEYSCAN.C Combines 5KEYCODE.C and SCANBLK.C.
CDEMO_RT.C Demonstrate the use of the real-time kernel.
DIGDEMO.C Use the keypad to select which digital input
channel to monitor.
DIGVDVR.C Similar to DIGDEMO.C. but uses the virtual
driver to monitor the state of the input.
DMACOUNT.C
Demonstrates the use of the high speed
counters
.
continued…