4e6cf8ea418d0bc91abd79d57f474fc390911c5f
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

1) LIBRARY IEEE;
2) USE IEEE.STD_LOGIC_1164.ALL;
3) USE IEEE.NUMERIC_STD.ALL;
4) USE work.io_switches_pins.all;
5) 
6) ENTITY e_io_switches IS
7)     PORT (
8)         rst:            IN  std_logic;
9)         clk:            IN  std_logic;
10)         i_addr:         IN  std_logic_vector( 0 DOWNTO 0);
11)         o_rd_data:      OUT std_logic_vector(31 DOWNTO 0);
12)         pin_i_switches: IN  t_io_switches_pins
13)     );
14) END ENTITY e_io_switches;
15) 
16) ARCHITECTURE a_io_switches OF e_io_switches IS
17) 
18)     SIGNAL n_sample: std_logic_vector(1 DOWNTO 0);
19)     SIGNAL r_sample: std_logic_vector(1 DOWNTO 0)  := (OTHERS => '0');
20)     SIGNAL r_prev:   std_logic_vector(1 DOWNTO 0)  := (OTHERS => '0');
21)     SIGNAL n_cnt:    std_logic_vector(31 DOWNTO 0);
22)     SIGNAL r_cnt:    std_logic_vector(31 DOWNTO 0) := (OTHERS => '0');
23) 
24) BEGIN
25) 
26)     p_sample: PROCESS(pin_i_switches)
27)     BEGIN
28)         -- de-gray-code rotary inputs
29)         IF pin_i_switches.rot_b = '1' THEN
30)             IF pin_i_switches.rot_a = '1' THEN
Stefan Schuermans implemented displaying rota...

Stefan Schuermans authored 12 years ago

31)                 n_sample <= "00";
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

32)             ELSE
33)                 n_sample <= "11";
34)             END IF;
35)         ELSE
36)             IF pin_i_switches.rot_a = '1' THEN
37)                 n_sample <= "01";
38)             ELSE
Stefan Schuermans implemented displaying rota...

Stefan Schuermans authored 12 years ago

39)                 n_sample <= "10";