Cypress CY4672 Espresso Maker User Manual


 
CY4672 Reference Design Guide, Document # 001-16968 Revision ** 61
Keyboard
4.3.4.3 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 and
receiving formatted packets and the flash module for storing the manufacturing ID of the bridge the
device is bound to.
4.3.4.4 Flash Module
The flash module is a smaller version of the E2PROM module provided in PSoC Designer. It is lim-
ited in functionality and only implements the read/write routines required by the device. The
flashse-
curity.txt
file must be modified so that the block being modified by this module is given read/write
privilege, such as unprotected. Currently the one very top most block in flash is used by this module
for storing the encryption key if encryption is enabled and the bind parameters.
4.3.4.5 ISR Module
This module provides an interface to initialize the interrupt.
4.3.4.6 Timer Module
The timer module provides a one-millisecond tick for the system. The tick resolution can be
changed, but is set for one millisecond for the keyboard. This module requires the use of a 12-bit
Programmable Interval Timer user module of the enCoRe II LV. The delay function used for millisec-
ond timing provides at least the delay requested with no more than one additional millisecond of
delay. The millisecond delay function puts the PSoC in the sleep mode for the duration of the
requested delay. The microprocessor wakes just long enough to update the tick every millisecond
and check if the delay has been met and then returns to sleep state if it has not. See the documenta-
tion in the module for requirements on configuring the enCoRe II LV block.
4.3.5 Application Code
The group of modules that make up the application code is responsible for implementing the key-
board functionality and behavior. Following is a high level description of each module responsibility
and associated algorithms.
4.3.5.1 Keyboard Module
The keyboard module is the controlling code for the application. It has many responsibilities in imple-
menting various features and functions offered by the keyboard.
The function main() is the entry point for the keyboard application. This function is called from the
boot.asm file. The keyboard first initializes all of the application modules and then initializes the pro-
tocol module. There is an order dependency for some of these, so care must be taken in modifying
the keyboard_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
keyboard operation begins.
There are two states for the keyboard operation: the idle state and the active state. The keyboard ini-
tially enters idle state; when there is any keystroke, it enters the active state.
In active state the keyboard is scanned for both the keys and the Bind button. The keystrokes are
collected, formatted and reported to the bridge. After that, the keyboard goes into the idle state.
[+] Feedback