Cypress CY4672 Espresso Maker User Manual


 
CY4672 Reference Design Guide, Document # 001-16968 Revision ** 41
Mouse
In the PRoC RDK mouse design, the master SPI communicates with both the radio and optical sen-
sor. Because the optical sensor does not supports 3-wire SPI mode, the 4-wire mode is employed. In
order to save the GPIO pin, the IRQ pin function is multiplexed onto the MOSI pin.
3.3.4.4 Radio 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 PRoC LP Radio Driver documentation for
details.
3.3.4.5 Protocol Module
The protocol module defines and implements the layer used to deliver packets from the device to the
bridge. It manages the binding of devices to a bridge as well as the connection and interference
immunity by channel hopping. This module has a dependency on the Radio Driver for sending for-
matted packets and the flash module for storing the manufacturing ID of the bridge the device is
bound to.
3.3.4.6 Flash Module
The flash module is a smaller version of E2PROM module provided in PSoC Designer. It is limited in
functionality and only implements the read/write routines required by the device. The
flashsecurity.txt
file must be modified so that the block being modified by this module is given read/write privilege,
such as unprotected. Currently the very top most block in flash is used for this module.
3.3.4.7 Port Module
GPIO pins on the PRoC LP ports can be configured as outputs with a pull up resistor. This is the
case for mouse buttons and the Bind button. In order to activate the pull up, a data value of one must
be written to the port data latch for the pin. This feature presents a problem when performing a read-
modify-write on the port. For example, if a button is pressed (grounding the pin), a zero is read and
written back out on the read-modify-write operation. This turns off the pull up for the button thereby,
essentially disables the button. The port module provides an interface to treat ports, using the pull up
feature, in a special way by caching the drive data for the port.
3.3.4.8 Poll Module
The poll module manages the timing, enabling/disabling and polling of the mouse buttons and z-
wheel inputs. When the mouse is active, polling is enabled and occurs at a rate of about 250 µs for
the z-wheel (see the Timer Module) and a rate of about 3 ms for the mouse buttons. When the
mouse is inactive, the buttons are changed to interrupt mode and the z-wheel is polled for change
only when the sleep timer expires; see the Buttons Module and Wheel Module on page 44.
3.3.4.9 Timer Module
The PRoC LP has an internal low power oscillator (ILO) that is used for generating a clock to a Pro-
grammable Interval Timer. This clock is affected by voltage and temperature and may drift over time.
This module provides an interface to calibrate this clock to the system clock. The Programmable
Interval Timer period is calibrated to be approximately 250 µs. Be especially careful when changing
this period since the poll/debounce modules are coupled to this time value; see Poll Module and the
Debounce Module on page 40.
The timer module also provides a set of functions for performing busy waits in the microsecond res-
olution. For more coarse timing requirements, an API is provided for millisecond delays. The milli-
second delay routines must be used as often as possible to provide for better power consumption
[+] Feedback