BPW5007 Button/LED Peripheral Core
The Button/LED Controller Peripheral interface consists of 5 user accessible registers:
Base address is defined by the bus controller in higher hierarchy of HDL code. All these registers are 16-bit wide. For 8-bit access, above registers are broken into two 8-bit registers each with suffixes 'L' and 'H' for low and high bytes respectively.
|0||LED1||LED 1 Output|
|1||LED2||LED 2 Output|
|2||LED3||LED 3 Output|
|3||LED4||LED 4 Output|
This register allows you to switch on one or more LEDs without concern for others. The bits where '1's are written will switch on the corresponding LEDs. A '0' has no effect.
|0||LED1||LED 1 ON|
|1||LED2||LED 2 ON|
|2||LED3||LED 3 ON|
|3||LED4||LED 4 ON|
This register allows you to switch off one or more LEDs without concern for others. The bits where '1's are written will switch off the corresponding LEDs. A '0' has no effect.
|0||LED1||LED 1 OFF|
|1||LED2||LED 2 OFF|
|2||LED3||LED 3 OFF|
|3||LED4||LED 4 OFF|
This interrupt control allows you to control the way this peripheral reports button press events. Two bits control whether a button down or button up or both or none are reported by way of interrupts.
Definition of INTCTL1:0 is as follows:
|0||1||Interrupt on button down (press)|
|1||0||Interrupt on button up (release)|
|1||1||Interrupt on both|
- In the new version of this core it is proposed to use the above bits for every button.
- Also, the debounce timing can be made programmable, which is currently set as overflow of a 8-bit counter at given frequency.
- The two INTCLT bits to be used for each individual button, giving more control over the pad as individual buttons can be enabled, disabled or responded to.
- Add a matrix mode to control larger keypad array.
- Add PWM control to each LED output, allowing it to control brightness with high frequency PWM or just set rate of flashing with etremely low frequency.
- Register based LED and Pushbutton control to be used with Soft Processors, Tech Adapters, or HDL.
- Easy interface to control LED arrays and button arrays.
This code is realeased under the Creative Commons Attribution license. Please give attribution to the original author and Gadget Factory (www.gadgetfactory.net).
This work is licensed under a Creative Commons Attribution 3.0 License.
|20:30:04||Commit: REDe example of controlling the Stepper Motor Wing with a Button/LED Wing.||Jack Gassett|
|23:13:02||Commit: First revision of core for BPW5007 Button and LED Wing.||Jack Gassett|
An IP core for the BPW5007 Button/LED
Wing. Allows the Button/LED Wing to be
used with stand alone HDL or a REDe
Discuss/Request new Projects
Start a new Project
Follow Gadget Factory on Twitter!