Line 1... |
Line 1... |
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
--
|
--
|
-- GCpad controller core
|
-- GCpad controller core
|
--
|
--
|
-- $Id: gcpad_basic.vhd,v 1.2 2004-10-08 20:51:59 arniml Exp $
|
-- $Id: gcpad_basic.vhd,v 1.3 2004-10-09 00:33:55 arniml Exp $
|
--
|
--
|
-- Copyright (c) 2004, Arnim Laeuger (arniml@opencores.org)
|
-- Copyright (c) 2004, Arnim Laeuger (arniml@opencores.org)
|
--
|
--
|
-- All rights reserved
|
-- All rights reserved
|
--
|
--
|
Line 85... |
Line 85... |
);
|
);
|
|
|
end gcpad_basic;
|
end gcpad_basic;
|
|
|
|
|
use work.gcpad_pack.analog_axis_t;
|
use work.gcpad_pack.all;
|
|
|
architecture struct of gcpad_basic is
|
architecture struct of gcpad_basic is
|
|
|
component gcpad_ctrl
|
component gcpad_ctrl
|
generic (
|
generic (
|
Line 133... |
Line 133... |
reset_i : in std_logic;
|
reset_i : in std_logic;
|
rx_en_i : in boolean;
|
rx_en_i : in boolean;
|
rx_done_o : out boolean;
|
rx_done_o : out boolean;
|
rx_size_i : in std_logic_vector(3 downto 0);
|
rx_size_i : in std_logic_vector(3 downto 0);
|
pad_data_i : in std_logic;
|
pad_data_i : in std_logic;
|
but_a_o : out std_logic;
|
rx_data_o : out buttons_t
|
but_b_o : out std_logic;
|
|
but_x_o : out std_logic;
|
|
but_y_o : out std_logic;
|
|
but_z_o : out std_logic;
|
|
but_start_o : out std_logic;
|
|
but_tl_o : out std_logic;
|
|
but_tr_o : out std_logic;
|
|
but_left_o : out std_logic;
|
|
but_right_o : out std_logic;
|
|
but_up_o : out std_logic;
|
|
but_down_o : out std_logic;
|
|
ana_joy_x_o : out analog_axis_t;
|
|
ana_joy_y_o : out analog_axis_t;
|
|
ana_c_x_o : out analog_axis_t;
|
|
ana_c_y_o : out analog_axis_t;
|
|
ana_l_o : out analog_axis_t;
|
|
ana_r_o : out analog_axis_t
|
|
);
|
);
|
end component;
|
end component;
|
|
|
|
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
Line 176... |
Line 159... |
signal tx_finished_s : boolean;
|
signal tx_finished_s : boolean;
|
|
|
signal rx_en_s,
|
signal rx_en_s,
|
rx_done_s : boolean;
|
rx_done_s : boolean;
|
|
|
|
signal rx_data_s : buttons_t;
|
|
|
begin
|
begin
|
|
|
rx_size_s <= rx_size_c;
|
rx_size_s <= rx_size_c;
|
tx_size_s <= tx_size_c;
|
tx_size_s <= tx_size_c;
|
tx_command_s <= tx_command_c;
|
tx_command_s <= tx_command_c;
|
Line 224... |
Line 209... |
reset_i => reset_i,
|
reset_i => reset_i,
|
rx_en_i => rx_en_s,
|
rx_en_i => rx_en_s,
|
rx_done_o => rx_done_s,
|
rx_done_o => rx_done_s,
|
rx_size_i => rx_size_s,
|
rx_size_i => rx_size_s,
|
pad_data_i => pad_data_io,
|
pad_data_i => pad_data_io,
|
but_a_o => but_a_o,
|
rx_data_o => rx_data_s
|
but_b_o => but_b_o,
|
|
but_x_o => but_x_o,
|
|
but_y_o => but_y_o,
|
|
but_z_o => but_z_o,
|
|
but_start_o => but_start_o,
|
|
but_tl_o => but_tl_o,
|
|
but_tr_o => but_tr_o,
|
|
but_left_o => but_left_o,
|
|
but_right_o => but_right_o,
|
|
but_up_o => but_up_o,
|
|
but_down_o => but_down_o,
|
|
ana_joy_x_o => ana_joy_x_o,
|
|
ana_joy_y_o => ana_joy_y_o,
|
|
ana_c_x_o => ana_c_x_o,
|
|
ana_c_y_o => ana_c_y_o,
|
|
ana_l_o => ana_l_o,
|
|
ana_r_o => ana_r_o
|
|
);
|
);
|
|
|
|
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
-- Open collector driver to pad data
|
-- Open collector driver to pad data
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
pad_data_io <= '0'
|
pad_data_io <= '0'
|
when pad_data_tx_s = '0' else
|
when pad_data_tx_s = '0' else
|
'Z';
|
'Z';
|
|
|
|
-----------------------------------------------------------------------------
|
|
-- Output mapping
|
|
-----------------------------------------------------------------------------
|
|
but_a_o <= rx_data_s(pos_a_c);
|
|
but_b_o <= rx_data_s(pos_b_c);
|
|
but_x_o <= rx_data_s(pos_x_c);
|
|
but_y_o <= rx_data_s(pos_y_c);
|
|
but_z_o <= rx_data_s(pos_z_c);
|
|
but_start_o <= rx_data_s(pos_start_c);
|
|
but_tl_o <= rx_data_s(pos_tl_c);
|
|
but_tr_o <= rx_data_s(pos_tr_c);
|
|
but_left_o <= rx_data_s(pos_left_c);
|
|
but_right_o <= rx_data_s(pos_right_c);
|
|
but_up_o <= rx_data_s(pos_up_c);
|
|
but_down_o <= rx_data_s(pos_down_c);
|
|
ana_joy_x_o <= rx_data_s(joy_x_high_c downto joy_x_low_c);
|
|
ana_joy_y_o <= rx_data_s(joy_y_high_c downto joy_y_low_c);
|
|
ana_c_x_o <= rx_data_s(c_x_high_c downto c_x_low_c);
|
|
ana_c_y_o <= rx_data_s(c_y_high_c downto c_y_low_c);
|
|
ana_l_o <= rx_data_s(l_high_c downto l_low_c);
|
|
ana_r_o <= rx_data_s(r_high_c downto r_low_c);
|
|
|
end struct;
|
end struct;
|
|
|
|
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- File History:
|
-- File History:
|
--
|
--
|
-- $Log: not supported by cvs2svn $
|
-- $Log: not supported by cvs2svn $
|
|
-- Revision 1.2 2004/10/08 20:51:59 arniml
|
|
-- turn rx and tx size into bytes instead of bits
|
|
--
|
-- Revision 1.1 2004/10/07 21:23:10 arniml
|
-- Revision 1.1 2004/10/07 21:23:10 arniml
|
-- initial check-in
|
-- initial check-in
|
--
|
--
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
|
|
No newline at end of file
|
No newline at end of file
|