CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A
83
Code Examples
The process first sets the LVI threshold to 1.8 V and then checks for an LVI interrupt. If the interrupt
does not occur then it repeatedly sets the LVI TH and PMU OUTV with the following combination
and checks the status.
It then returns a battery level between 1 and 10: 1 being below 1.8 V and 10 being above 2.7 V.
Test Module.
This RDK keyboard provides a compile-time option of adding test modes to the key-
board; see section KEYBOARD_TEST_MODES for enabling this option. The test mode module is
implemented in a way that it can be easily extended to add other test modes. Currently there are
only two test modes supported in the module. When this option is not enabled then all test mode
code is removed from the compilation.
The first test mode is initiated by holding down the left ctrl, left alt, right alt, right ctrl, and F1 keys at
the same time. If PANGRAM_TEST_MODE is defined, the test sends the key up/down scan codes
for the test pangram:"a quick brown fox jumps over the lazy dog.<carriage return>" . Otherwise the
up/down scan codes are repeatedly sent for the test sequence 'wirelessusb' followed by the same
number of backspaces. The test repeats the appropriate sequence until the escape key is pressed.
Once the test has finished execution, the keyboard returns to normal operation. The repeating 'x' test
selection is initiated by holding down the left ctrl, left alt, right alt, right ctrl, and F3 keys at the same
time. The test continuously sends the 'x' key up/down scan codes. The test continues until the
escape key is pressed. After the test finishes execution, the keyboard returns to normal operation.
Encrypt Module.
This module may be conditionally compiled in to provide encryption/decryption
support. Encrypted data transfers are typically used between RDK keyboard devices and the RDK
bridge. Contact Cypress Applications support for the encryption source code.
5.3.3.3
Configuration Options
All configuration options for the application can be found in the
config.h
file. Each item is explained
below and can be changed to values that meet the developer's requirements.
KEYBOARD_KEEP_ALIVE_TIMEOUT.
When a key is held down, this configuration value sets the
period at which the firmware generates a KEEP_ALIVE packet since the last keyboard report. The
default is 65 milliseconds.
KEY_DOWN_DELAY_SAMPLE_PERIOD.
This configuration value sets the period at which the
firmware polls the hardware for keyboard events to transmit over the radio. This poll period is only
active when the keyboard has not entered sleep because keys are currently being pressed. The
default value is 10 milliseconds.
KEYBOARD_DEBOUNCE_COUNT.
The button debounce logic detects changes in the button
state and immediately indicates a change causing a report to be sent to the radio. The debounce
logic then blocks out any further button state changes for the specified debounce time. This opera-
tion is somewhat different from the usual method of waiting for a button to stabilize during a
debounce interval, and then reporting the change in button state. It is implemented this way to
improve button-reporting latency.
Table 5-13. LVI TH and PMU OUTV Combinations
LVI TH
PMU OUTV
VOLTAGE IF INTERRUPT OCCURS
1.8V
2.7 V
<1.8 V
2.0V
2.7 V
<2.0 V
2.2V
2.7 V
<2.2 V
PMU OUTV
2.7 V
<2.7 V