CDL Modules
Files
apb_target_de1_cl_inputs

Files

file  apb_target_timer.cdl
 Simple timer target for an APB bus.
 

Detailed Description

Modules

module apb_target_de1_cl_inputs::apb_target_de1_cl_inputs ( clock  clk,
input bit  reset_n,
input t_apb_request  apb_request,
output t_apb_response  apb_response,
input t_de1_cl_user_inputs  user_inputs 
)
Parameters
[in]clkSystem clock
[in]reset_nActive low reset
[in]apb_requestAPB request
[out]apb_responseAPB response
[in]user_inputsThis 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)