Bridge
5.3.4.1.2USB HID Class Module (USB_1_cls_hid.asm)
The additional user code provides support for the Battery Level and Link Quality software applica- tion.
5.3.4.1.31 Millisecond Interval Timer Interrupt Module (MSTIMER.asm)
The additional user code decrements application countdown timers and checks for USB activity to detect a USB suspend condition.
5.3.4.2Flash
The module includes routines to write to the PRoC LP Flash.
5.3.4.3Timer
The module includes busy wait time routines.
5.3.4.4Radio Driver
The radio driver module is a low level module providing basic radio communication and configura- tion. Its general application is such that it is likely not to be changed by the firmware developer. It provides an interface for reading/writing radio registers, setting PN codes and initialization of the radio and transmitting or receiving packets. See the Radio Driver documentation for details.
5.3.4.5Master Protocol
The module includes PRoC LP RDK master protocol routines to handle ping, button bind, channel agility and data packets. This module has a dependency on the radio driver for sending and receiv- ing formatted packets and the flash module.
5.3.5Application Code
The group of modules that make up the application code is responsible for implementing the bridge functionality and behavior.
5.3.5.1Bridge Module
The bridge module is the controlling code for the application. It has many responsibilities in imple- menting various features and functions offered by the bridge. The function main() is the entry point for the bridge application. This function is called from the boot.asm file. The bridge first initializes all of the application modules and then initializes the master_protocol module. There is an order depen- dency for some of these, so care must be taken in modifying the bridge_init() function. For example, other modules depend upon the timer facility running in order to perform initialization. Once each module has been initialized, then the application checks for entry to the manufacturing test mode. If the manufacturing test mode is not indicated, then normal bridge operation begins.
The bridge continuously checks the USB idle timer, received packet, the Bind button and the USB suspend.
5.3.5.1.1Check the USB Idle Timer
The check_usb_idle() function is called within the main() function to properly handle the USB Set_Idle command. The USB Set_Idle command from the host PC is used to silence the keyboard or mouse report until a new event occurs or the specified amount of time passes. If the host PC’s Set_Idle command sets the Idle Duration to ‘0’, the keyboard or mouse endpoint will inhibit reporting forever, only reporting when a change is detected in the report data. This causes the bridge to NAK any polls on the endpoint while its current report remains unchanged. If the Set_Idle command sets the Idle Duration to a
CY4672 Reference Design Guide, Document # | 83 |
[+] Feedback