52
CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A
Code Examples
■
Check the USB Suspend
The check_usb_suspend() monitors the USB suspend condition on the USB bus and takes proper
actions to put the system into a low power state when no bus activity is observed for 3 ms. When
suspended, the bridge supports remote wakeup by intermittently turning the radio on when the sleep
timer interrupt occurs, checking for valid data from the HID devices, and then turning the radio off
again if no HID traffic was detected.
USB Module.
This module parses the radio packets, builds the appropriate keyboard and mouse
USB packets and loads these packets into the endpoints.
Mfgtest Module.
The manufacturing test module may be conditionally compiled in to provide man-
ufacturing test support. The module configures the radio for reception and then enters a loop waiting
for command packets to be sent from the tester. The test echoes all echo command packets
appended with the number of invalid bits received and all other 'valid' command packets (no invalid
bits). The manufacturing test code can only be exited by cycling power. The manufacturing test code
in this bridge is compatible with the CY3631 Manufacturing Test Kit offered by Cypress Semiconduc-
tor.
The manufacturing test mode on the LP RDK bridge can be entered by three different methods
depending on the compile-time configuration.
■
Method 1: Holding the Bind button during insertion into a USB Host enters the manufacturing test
mode.
■
Method 2: Forcing an SE1 condition (D+ and D- are both high) on the USB bus and applying
power to the bridge.
■
Method 3: Grounding P0.4 during insertion into a USB Host enters the manufacturing test mode.
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.1.3.3
Configuration Options
All configuration options for the application can be found in the
config.h
file. Options may be config-
ured by defining/un-defining certain #define statements.
MFG_TEST_CODE.
This configuration definition is used to selectively compile in the manufacturing
test code. The manufacturing test code in this bridge is compatible with the CY3631 Manufacturing
Test Kit offered by Cypress Semiconductor. See the mfgtest module for a description of how this test
mode is executed. See the CY3631 Manufacturing Test Kit documentation for a description of the
test operation.
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.
MFG_ENTER_BY_PIN.
This configuration definition is used to selectively compile in a method to
enter the manufacturing test code. When this value is defined, the manufacturing test code may be
executed by grounding a specific pin during insertion of the LP RDK bridge into a powered USB port
or applying external power.
MFG_ENTER_BY_BUTTON.
This configuration definition is used to selectively compile in a
method to enter the manufacturing test code. When this value is defined, the manufacturing test