Line 35... |
Line 35... |
---- ----
|
---- ----
|
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
|
|
-- CVS Log
|
-- CVS Log
|
--
|
--
|
-- $Id: i2c_master_bit_ctrl.vhd,v 1.7 2003-02-05 00:06:02 rherveille Exp $
|
-- $Id: i2c_master_bit_ctrl.vhd,v 1.8 2003-08-09 07:01:13 rherveille Exp $
|
--
|
--
|
-- $Date: 2003-02-05 00:06:02 $
|
-- $Date: 2003-08-09 07:01:13 $
|
-- $Revision: 1.7 $
|
-- $Revision: 1.8 $
|
-- $Author: rherveille $
|
-- $Author: rherveille $
|
-- $Locker: $
|
-- $Locker: $
|
-- $State: Exp $
|
-- $State: Exp $
|
--
|
--
|
-- Change History:
|
-- Change History:
|
-- $Log: not supported by cvs2svn $
|
-- $Log: not supported by cvs2svn $
|
|
-- Revision 1.7 2003/02/05 00:06:02 rherveille
|
|
-- Fixed a bug where the core would trigger an erroneous 'arbitration lost' interrupt after being reset, when the reset pulse width < 3 clk cycles.
|
|
--
|
-- Revision 1.6 2003/02/01 02:03:06 rherveille
|
-- Revision 1.6 2003/02/01 02:03:06 rherveille
|
-- Fixed a few 'arbitration lost' bugs. VHDL version only.
|
-- Fixed a few 'arbitration lost' bugs. VHDL version only.
|
--
|
--
|
-- Revision 1.5 2002/12/26 16:05:47 rherveille
|
-- Revision 1.5 2002/12/26 16:05:47 rherveille
|
-- Core is now a Multimaster I2C controller.
|
-- Core is now a Multimaster I2C controller.
|
Line 203... |
Line 206... |
-- generate bus status controller
|
-- generate bus status controller
|
bus_status_ctrl: block
|
bus_status_ctrl: block
|
signal dSCL, dSDA : std_logic; -- delayes sSCL and sSDA
|
signal dSCL, dSDA : std_logic; -- delayes sSCL and sSDA
|
signal sta_condition : std_logic; -- start detected
|
signal sta_condition : std_logic; -- start detected
|
signal sto_condition : std_logic; -- stop detected
|
signal sto_condition : std_logic; -- stop detected
|
signal cmd_stop, dcmd_stop : std_logic; -- STOP command
|
signal cmd_stop : std_logic; -- STOP command
|
signal ibusy : std_logic; -- internal busy signal
|
signal ibusy : std_logic; -- internal busy signal
|
begin
|
begin
|
-- synchronize SCL and SDA inputs
|
-- synchronize SCL and SDA inputs
|
synch_scl_sda: process(clk, nReset)
|
synch_scl_sda: process(clk, nReset)
|
begin
|
begin
|
Line 271... |
Line 274... |
-- generate arbitration lost signal
|
-- generate arbitration lost signal
|
gen_al: process(clk, nReset)
|
gen_al: process(clk, nReset)
|
begin
|
begin
|
if (nReset = '0') then
|
if (nReset = '0') then
|
cmd_stop <= '0';
|
cmd_stop <= '0';
|
dcmd_stop <= '0';
|
|
ial <= '0';
|
ial <= '0';
|
elsif (clk'event and clk = '1') then
|
elsif (clk'event and clk = '1') then
|
if (rst = '1') then
|
if (rst = '1') then
|
cmd_stop <= '0';
|
cmd_stop <= '0';
|
dcmd_stop <= '0';
|
|
ial <= '0';
|
ial <= '0';
|
else
|
else
|
|
if (clk_en = '1') then
|
if (cmd = I2C_CMD_STOP) then
|
if (cmd = I2C_CMD_STOP) then
|
cmd_stop <= '1';
|
cmd_stop <= '1';
|
else
|
else
|
cmd_stop <= '0';
|
cmd_stop <= '0';
|
end if;
|
end if;
|
dcmd_stop <= cmd_stop;
|
|
|
|
ial <= (sda_chk and not sSDA and isda_oen) or (sto_condition and not dcmd_stop);
|
ial <= (sda_chk and not sSDA and isda_oen) or (sto_condition and not cmd_stop);
|
end if;
|
end if;
|
end if;
|
end if;
|
end process gen_al;
|
end process gen_al;
|
al <= ial;
|
al <= ial;
|
|
|