- Parameters
-
[in] | clk | System clock |
[in] | reset_n | Active low reset |
[in] | apb_request | APB request |
[out] | apb_response | APB response |
[in] | user_inputs | This module provides an APB target to get the status of inputs for the Cambridge University DE1-SOC daughterboard. |
The CL DE1-SOC daughterboard contains a joystick, a diamond of four buttons, two rotary dials, and apparently a temperature alarm and touchpanel intrerrupt (the latter two I have not used as yet).
Two registers are provided. The first is the state register,
Bits | Meaning |
31 | Inputs changed since last read of state |
5;26 | zero |
25 | temperature alarm |
24 | touchpanel interrupt |
6;18 | zero |
17 | right rotary dial is pressed in |
16 | left rotary dial is pressed in |
3;13 | zero |
12 | joystick is being pressed |
11 | joystick is being pushed right |
10 | joystick is being pushed left |
9 | joystick is being pushed down |
8 | joystick is being pushed up |
4;4 | zero |
3 | diamond y (top black button) is being pressed |
2 | diamond x (left blue button) is being pressed |
1 | diamond b (right red button) is being pressed |
0 | diamond a (bottom green button) is being pressed |
The second register relates just to the rotary dials; the hardware keeps track of directional impulses to provide an 8-bit 'rotary value' for each dial.
Bits | Meaning |
31 | Inputs changed since last read of state |
13;18 | zero |
17 | right rotary dial is pressed in |
16 | left rotary dial is pressed in |
8;8 | right rotary dial position (decremented on anticlockwise, incremented on clockwise) |
8;0 | left rotary dial position (decremented on anticlockwise, incremented on clockwise) |