CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A
67
Code Examples
5.2.3
Firmware Architecture
Figure 5-16. Firmware Architecture Model
The mouse firmware is partitioned into two logical groups. The common group is a collection of code
modules that provide the underlying support for the application. This group provides services such
as radio protocol, radio driver, timing, polling, flash access, contact debounce, SPI, and interrupts.
The application group implements the core functionality and features of the RDK wireless mouse.
This includes power management, optical sensor, button, z-wheel, packet formatting and reporting,
various test modes and battery level sensing. The code modules for each of these groups are
described below in further detail.
All of the following module descriptions have corresponding
<module name>.c
or
<module
name>.asm
and
<module name>.h
source code files. The module API and definitions are exported
in the header file while the module implementation and local definitions are contained in the C/
assembly file.
5.2.3.1
Common Code
The modules in the common code group are a combination of two sources. The first is PSoC
Designer generated files in the lib directory that have been modified to support the application. The
second group is modules that are generally used by the application.
Generated Library Code.
There are currently only two files, generated by PSoC Designer, that are
modified for the use of the application. A minimal amount of code has been added to these modules
in user protected areas that are preserved across code generation.
■
GPIO Interrupt Module
Due to inefficiency in the handling of compiler defined registers at interrupt level, code was added to
this module to improve the efficiency of interrupt handling in C modules to maintain modularity. Refer
to the isr module for more details.