|
From: Pierre C. <Sup...@us...> - 2010-01-21 08:43:49
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "krobot-resources".
The branch, master has been updated
via 2ed5b75bc97dc9f10baf67f6f9a199a514e992b5 (commit)
from 53d3fd5f24468a828638064afc10bcbc691c4959 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2ed5b75bc97dc9f10baf67f6f9a199a514e992b5
Author: chambart <cha...@cr...>
Date: Thu Jan 21 09:20:14 2010 +0100
Add componnent keyboard
-----------------------------------------------------------------------
Changes:
diff --git a/fpga/components/keyboard.vhd b/fpga/components/keyboard.vhd
new file mode 100644
index 0000000..88a8882
--- /dev/null
+++ b/fpga/components/keyboard.vhd
@@ -0,0 +1,57 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.std_logic_unsigned.all;
+
+entity keyboard is
+ port (clk : in std_logic;
+ data_in : in std_logic_vector ( 0 to 7 );
+ int_in : in std_logic;
+
+ extended : out std_logic;
+ up : out std_logic;
+ code : out std_logic_vector ( 0 to 7 );
+ int : out std_logic );
+end entity keyboard;
+
+architecture keyboard of keyboard is
+ type state_type is ( waiting, end_state );
+ signal tmp_extended, tmp_up : std_logic;
+begin
+
+process (clk)
+ variable state : state_type := end_state;
+ variable old_int_in : std_logic := '0';
+begin
+ if(rising_edge(clk))
+ then
+ case state is
+ when end_state =>
+ state := waiting;
+ int <= '0';
+ tmp_extended <= '0';
+ tmp_up <= '0';
+ when waiting =>
+ if(int_in = '1' and old_int_in = '0')
+ then
+ case data_in is
+ when "11100000" =>
+ tmp_extended <= '1';
+ state := waiting;
+ when "11110000" =>
+ tmp_up <= '1';
+ state := waiting;
+ when others =>
+ code <= data_in;
+ extended <= tmp_extended;
+ up <= tmp_up;
+ state := end_state;
+ int <= '1';
+ end case;
+ end if;
+ end case;
+
+ old_int_in := int_in;
+ end if;
+end process;
+
+end keyboard;
hooks/post-receive
--
krobot-resources
|