CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A
85
Code Examples
MFG_TX_MODES.
When the MFG_TEST_CODE is defined, the definition of this name adds in a
carrier and random data TX test option. See the mfgtest module for more information on these TX
modes.
MOUSE_EMULATION_MODE.
This configuration definition is used to selectively compile in the
mouse Emulation Mode. The Scroll Lock key is used to toggle this mode on/off. Once in this mode,
the arrow keys are used to move the mouse. The Delete key is the left mouse button, the End key is
the right mouse button, and Page Up and Page Down emulate the scroll wheel.
KEYBOARD_POWER_ON_BIND.
This configuration definition is used to selectively compile in the
option to enter bind mode on powerup when the device has not been previously bound to a bridge.
PLATFORM_H.
This configuration value identifies the header file that has the platform configuration
information. The default value is pdc9265.h, which is identifier for the keyboard board that is shipped
with the RDK. It is anticipated that this macro will change when the code is ported to another plat-
form.
5.3.3.4
Platform and Architecture Portability
The keyboard firmware was designed to be easily ported from one hardware platform to another
platform with a simple re-mapping of pins on the enCoRe II LV. The file pdc9265.h maintains the pin
mapping definitions that are used throughout the code and is included in about every file by using
the macro PLATFORM_H that is defined in config.h.
The keyboard scan matrix is defined in kdefs.h and may need to be changed for different keyboards.
Porting the code to another microprocessor architecture requires modification or leverage of the
existing code for processor specific features, along with pin definitions.
5.3.3.5
Initialization
Initialization of the enCoRe II LV chip is done by code that is generated in boot.asm by the PSoC
designer software. The module boot.asm calls main once the enCoRe II LV has been configured and
initialized.
Main initializes the components of the keyboard along with timer, isr and radio modules. The main
routine then goes into an infinite loop monitoring keyboard activity and sleeping between keystrokes.
5.3.3.6
Wireless Protocol Data Payload
The keyboard protocol has been optimized to reduce the ON time of the radio and power consump-
tion. The radio driver offers the ability to send variable length packets, allowing the opportunity to
minimize the number of bytes transmitted over the air, in order to extend battery life.
The following transmission packet formats are implemented in this RDK. The report formats show
the application payload and the radio protocol overhead with example packet headers.