![](/images/new-backgrounds/1092089/92089121x1.webp)
Keyboard
4.3.4.3Protocol 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.4Flash 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.5ISR Module
This module provides an interface to initialize the interrupt.
4.3.4.6Timer Module
The timer module provides a
4.3.5Application 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.1Keyboard 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.
CY4672 Reference Design Guide, Document # | 61 |
[+] Feedback