a060eadf72350188236b339dbe0de1e58ac26859
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) 
5) PACKAGE io_switches_pins IS
6) 
7)     TYPE t_io_switches_pins IS
8)         RECORD
9)             sw:     std_logic_vector(3 DOWNTO 0);
10)             east:   std_logic;
11)             north:  std_logic;
12)             south:  std_logic;
13)             west:   std_logic;
14)             center: std_logic;
15)             rot_a:  std_logic;
16)             rot_b:  std_logic;
17)         END RECORD;
18) 
Stefan Schuermans debounce switches

Stefan Schuermans authored 12 years ago

19)     CONSTANT c_io_switches_pins_default: t_io_switches_pins := (
20)             sw     => "0000",
21)             east   => '0',
22)             north  => '0',
23)             south  => '0',
24)             west   => '0',
25)             center => '0',
26)             rot_a  => '1',
27)             rot_b  => '1'
28)         );
29) 
30)     FUNCTION io_switches_to_slv(switches: t_io_switches_pins)
31)         RETURN std_logic_vector;
32) 
33)     FUNCTION io_switches_from_slv(slv: std_logic_vector(31 DOWNTO 0))
34)         RETURN t_io_switches_pins;
35) 
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

36) END PACKAGE io_switches_pins;
37)