c2b040193a777c09bdc595c95492b57a2521db87
Stefan Schuermans added file headers

Stefan Schuermans authored 12 years ago

1) -- MIPS I system
2) -- Copyright 2011-2012 Stefan Schuermans <stefan@schuermans.info>
3) -- Copyleft GNU public license V2 or later
4) --          http://www.gnu.org/copyleft/gpl.html
5) 
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

6) LIBRARY ieee;
7) USE ieee.std_logic_1164.all;
8) USE ieee.numeric_std.all;
9) 
10) PACKAGE io_switches_pins IS
11) 
12)     TYPE t_io_switches_pins IS
13)         RECORD
14)             sw:     std_logic_vector(3 DOWNTO 0);
15)             east:   std_logic;
16)             north:  std_logic;
17)             south:  std_logic;
18)             west:   std_logic;
19)             center: std_logic;
20)             rot_a:  std_logic;
21)             rot_b:  std_logic;
22)         END RECORD;
23) 
Stefan Schuermans debounce switches

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

41) END PACKAGE io_switches_pins;
42)