亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? i2c_master_top.vhd

?? 來自opencore網站的I2C總線模塊
?? VHD
字號:
-------------------------------------------------------------------------                                                             --------  WISHBONE revB2 compl. I2C Master Core; top level           --------                                                             --------                                                             --------  Author: Richard Herveille                                  --------          richard@asics.ws                                   --------          www.asics.ws                                       --------                                                             --------  Downloaded from: http://www.opencores.org/projects/i2c/    --------                                                             -----------------------------------------------------------------------------                                                             -------- Copyright (C) 2000 Richard Herveille                        --------                    richard@asics.ws                         --------                                                             -------- This source file may be used and distributed without        -------- restriction provided that this copyright statement is not   -------- removed from the file and that any derivative work contains -------- the original copyright notice and the associated disclaimer.--------                                                             --------     THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY     -------- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   -------- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS   -------- FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR      -------- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,         -------- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    -------- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE   -------- GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR        -------- BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF  -------- LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT  -------- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  -------- OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         -------- POSSIBILITY OF SUCH DAMAGE.                                 --------                                                             ---------------------------------------------------------------------------  CVS Log----  $Id: i2c_master_top.vhd,v 1.7 2004/03/14 10:17:03 rherveille Exp $----  $Date: 2004/03/14 10:17:03 $--  $Revision: 1.7 $--  $Author: rherveille $--  $Locker:  $--  $State: Exp $---- Change History:--               $Log: i2c_master_top.vhd,v $--               Revision 1.7  2004/03/14 10:17:03  rherveille--               Fixed simulation issue when writing to CR register----               Revision 1.6  2003/08/09 07:01:13  rherveille--               Fixed a bug in the Arbitration Lost generation caused by delay on the (external) sda line.--               Fixed a potential bug in the byte controller's host-acknowledge generation.----               Revision 1.5  2003/02/01 02:03:06  rherveille--               Fixed a few 'arbitration lost' bugs. VHDL version only.----               Revision 1.4  2002/12/26 16:05:47  rherveille--               Core is now a Multimaster I2C controller.----               Revision 1.3  2002/11/30 22:24:37  rherveille--               Cleaned up code----               Revision 1.2  2001/11/10 10:52:44  rherveille--               Changed PRER reset value from 0x0000 to 0xffff, conform specs.--library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;entity i2c_master_top is	generic(		ARST_LVL : std_logic := '0'                   -- asynchronous reset level	);	port (		-- wishbone signals		wb_clk_i  : in  std_logic;                    -- master clock input		wb_rst_i  : in  std_logic := '0';             -- synchronous active high reset		arst_i    : in  std_logic := not ARST_LVL;    -- asynchronous reset		wb_adr_i  : in  unsigned(2 downto 0);         -- lower address bits		wb_dat_i  : in  std_logic_vector(7 downto 0); -- Databus input		wb_dat_o  : out std_logic_vector(7 downto 0); -- Databus output		wb_we_i   : in  std_logic;	              -- Write enable input		wb_stb_i  : in  std_logic;                    -- Strobe signals / core select signal		wb_cyc_i  : in  std_logic;	              -- Valid bus cycle input		wb_ack_o  : out std_logic;                    -- Bus cycle acknowledge output		wb_inta_o : out std_logic;                    -- interrupt request output signal		-- i2c lines		scl_pad_i     : in  std_logic;                -- i2c clock line input		scl_pad_o     : out std_logic;                -- i2c clock line output		scl_padoen_o  : out std_logic;                -- i2c clock line output enable, active low		sda_pad_i     : in  std_logic;                -- i2c data line input		sda_pad_o     : out std_logic;                -- i2c data line output		sda_padoen_o  : out std_logic                 -- i2c data line output enable, active low	);end entity i2c_master_top;architecture structural of i2c_master_top is	component i2c_master_byte_ctrl is	port (		clk    : in std_logic;		rst    : in std_logic; -- synchronous active high reset (WISHBONE compatible)		nReset : in std_logic;	-- asynchornous active low reset (FPGA compatible)		ena    : in std_logic; -- core enable signal		clk_cnt : in unsigned(15 downto 0);	-- 4x SCL		-- input signals		start,		stop,		read,		write,		ack_in : std_logic;		din    : in std_logic_vector(7 downto 0);		-- output signals		cmd_ack  : out std_logic;		ack_out  : out std_logic;		i2c_busy : out std_logic;		i2c_al   : out std_logic;		dout     : out std_logic_vector(7 downto 0);		-- i2c lines		scl_i   : in std_logic;  -- i2c clock line input		scl_o   : out std_logic; -- i2c clock line output		scl_oen : out std_logic; -- i2c clock line output enable, active low		sda_i   : in std_logic;  -- i2c data line input		sda_o   : out std_logic; -- i2c data line output		sda_oen : out std_logic  -- i2c data line output enable, active low	);	end component i2c_master_byte_ctrl;	-- registers	signal prer : unsigned(15 downto 0);             -- clock prescale register	signal ctr  : std_logic_vector(7 downto 0);      -- control register	signal txr  : std_logic_vector(7 downto 0);      -- transmit register	signal rxr  : std_logic_vector(7 downto 0);      -- receive register	signal cr   : std_logic_vector(7 downto 0);      -- command register	signal sr   : std_logic_vector(7 downto 0);      -- status register	-- internal reset signal	signal rst_i : std_logic;	-- wishbone write access	signal wb_wacc : std_logic;	-- internal acknowledge signal	signal iack_o : std_logic;	-- done signal: command completed, clear command register	signal done : std_logic;	-- command register signals	signal sta, sto, rd, wr, ack, iack : std_logic;	signal core_en : std_logic;                      -- core enable signal	signal ien     : std_logic;                      -- interrupt enable signal	-- status register signals	signal irxack, rxack : std_logic;                -- received aknowledge from slave	signal tip           : std_logic;                -- transfer in progress	signal irq_flag      : std_logic;                -- interrupt pending flag	signal i2c_busy      : std_logic;                -- i2c bus busy (start signal detected)	signal i2c_al, al    : std_logic;                -- arbitration lostbegin	-- generate internal reset signal	rst_i <= arst_i xor ARST_LVL;	-- generate acknowledge output signal	gen_ack_o : process(wb_clk_i)	begin	    if (wb_clk_i'event and wb_clk_i = '1') then	      iack_o <= wb_cyc_i and wb_stb_i and not iack_o;         -- because timing is always honored	    end if;	end process gen_ack_o;	wb_ack_o <= iack_o;			-- generate wishbone write access signal	wb_wacc <= wb_cyc_i and wb_stb_i and wb_we_i;	-- assign wb_dat_o	assign_dato : process(wb_clk_i)	begin	    if (wb_clk_i'event and wb_clk_i = '1') then	      case wb_adr_i is	        when "000"  => wb_dat_o <= std_logic_vector(prer( 7 downto 0));	        when "001"  => wb_dat_o <= std_logic_vector(prer(15 downto 8));	        when "010"  => wb_dat_o <= ctr;	        when "011"  => wb_dat_o <= rxr; -- write is transmit register TxR	        when "100"  => wb_dat_o <= sr;  -- write is command register CR	        -- Debugging registers:	        -- These registers are not documented.	        -- Functionality could change in future releases	        when "101"  => wb_dat_o <= txr;	        when "110"  => wb_dat_o <= cr;	        when "111"  => wb_dat_o <= (others => '0');	        when others => wb_dat_o <= (others => 'X');	-- for simulation only	      end case;	    end if;	end process assign_dato;	-- generate registers (CR, SR see below)	gen_regs: process(rst_i, wb_clk_i)	begin	    if (rst_i = '0') then	      prer <= (others => '1');	      ctr  <= (others => '0');	      txr  <= (others => '0');	    elsif (wb_clk_i'event and wb_clk_i = '1') then	      if (wb_rst_i = '1') then	        prer <= (others => '1');	        ctr  <= (others => '0');	        txr  <= (others => '0');	      elsif (wb_wacc = '1') then	        case wb_adr_i is	           when "000" => prer( 7 downto 0) <= unsigned(wb_dat_i);	           when "001" => prer(15 downto 8) <= unsigned(wb_dat_i);	           when "010" => ctr               <= wb_dat_i;	           when "011" => txr               <= wb_dat_i;	           when "100" => null; --write to CR, avoid executing the others clause	           -- illegal cases, for simulation only	           when others =>	              report ("Illegal write address, setting all registers to unknown.");	              prer <= (others => 'X');	              ctr  <= (others => 'X');	              txr  <= (others => 'X');	        end case;	      end if;	    end if;	end process gen_regs;	-- generate command register	gen_cr: process(rst_i, wb_clk_i)	begin	    if (rst_i = '0') then	        cr <= (others => '0');	    elsif (wb_clk_i'event and wb_clk_i = '1') then	        if (wb_rst_i = '1') then	            cr <= (others => '0');	        elsif (wb_wacc = '1') then	            if ( (core_en = '1') and (wb_adr_i = 4) ) then	                -- only take new commands when i2c core enabled	                -- pending commands are finished	                cr <= wb_dat_i;	            end if;	        else	            if (done = '1' or i2c_al = '1') then	                cr(7 downto 4) <= (others => '0'); -- clear command bits when command done or arbitration lost	            end if;	            cr(2 downto 1) <= (others => '0');   -- reserved bits, always '0'	            cr(0) <= '0';                        -- clear IRQ_ACK bit	        end if;	    end if;	end process gen_cr;	-- decode command register	sta  <= cr(7);	sto  <= cr(6);	rd   <= cr(5);	wr   <= cr(4);	ack  <= cr(3);	iack <= cr(0);	-- decode control register	core_en <= ctr(7);	ien     <= ctr(6);	-- hookup byte controller block	byte_ctrl: i2c_master_byte_ctrl port map (		clk      => wb_clk_i,		rst      => wb_rst_i,		nReset   => rst_i,		ena      => core_en,		clk_cnt  => prer,		start    => sta,		stop     => sto,		read     => rd,		write    => wr,		ack_in   => ack,		i2c_busy => i2c_busy,		i2c_al   => i2c_al,		din      => txr,		cmd_ack  => done,		ack_out  => irxack,		dout     => rxr,		scl_i    => scl_pad_i,		scl_o    => scl_pad_o,		scl_oen  => scl_padoen_o,		sda_i    => sda_pad_i,		sda_o    => sda_pad_o,		sda_oen  => sda_padoen_o	);	-- status register block + interrupt request signal	st_irq_block : block	begin	    -- generate status register bits	    gen_sr_bits: process (wb_clk_i, rst_i)	    begin	        if (rst_i = '0') then	          al       <= '0';	          rxack    <= '0';	          tip      <= '0';	          irq_flag <= '0';	        elsif (wb_clk_i'event and wb_clk_i = '1') then	          if (wb_rst_i = '1') then	            al       <= '0';	            rxack    <= '0';	            tip      <= '0';	            irq_flag <= '0';	          else	            al       <= i2c_al or (al and not sta);	            rxack    <= irxack;	            tip      <= (rd or wr);	            -- interrupt request flag is always generated	            irq_flag <= (done or i2c_al or irq_flag) and not iack;	          end if;	        end if;	    end process gen_sr_bits;	    -- generate interrupt request signals	    gen_irq: process (wb_clk_i, rst_i)	    begin	        if (rst_i = '0') then	          wb_inta_o <= '0';	        elsif (wb_clk_i'event and wb_clk_i = '1') then	          if (wb_rst_i = '1') then	            wb_inta_o <= '0';	          else	            -- interrupt signal is only generated when IEN (interrupt enable bit) is set	            wb_inta_o <= irq_flag and ien;	          end if;	        end if;	    end process gen_irq;	    -- assign status register bits	    sr(7)          <= rxack;	    sr(6)          <= i2c_busy;	    sr(5)          <= al;	    sr(4 downto 2) <= (others => '0'); -- reserved	    sr(1)          <= tip;	    sr(0)          <= irq_flag;	end block;end architecture structural;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩视频在线观看一区二区三区| 日韩1区2区日韩1区2区| 久久97超碰国产精品超碰| 精品国产乱码久久久久久久久 | 亚洲成人av一区二区| 91精品免费观看| 成人中文字幕电影| 亚洲国产精品人人做人人爽| 欧美电视剧免费全集观看| av不卡一区二区三区| 日本欧美在线观看| 麻豆一区二区三| 亚洲最色的网站| 久久久久久久久岛国免费| 欧美自拍丝袜亚洲| 国产不卡在线一区| 久久国产剧场电影| 一区二区三区**美女毛片| 亚洲欧美日韩人成在线播放| 精品国产123| 国产日韩亚洲欧美综合| 正在播放一区二区| 精品粉嫩aⅴ一区二区三区四区| 久久日韩粉嫩一区二区三区| 欧美激情中文不卡| 精品国内片67194| 国产拍揄自揄精品视频麻豆| 亚洲人吸女人奶水| 午夜成人免费电影| 亚洲国产日产av| 蜜桃一区二区三区在线观看| 国产91精品欧美| 欧美视频在线观看一区二区| 日本久久精品电影| 色综合久久久久综合体| 成人精品亚洲人成在线| 精品视频资源站| 国产三级三级三级精品8ⅰ区| 成人免费视频在线观看| 2023国产精华国产精品| 日韩美女一区二区三区| 中文字幕一区二区视频| 日本强好片久久久久久aaa| 不卡av电影在线播放| www.欧美日韩| 欧美一级二级三级蜜桃| 日韩精品一区二区在线观看| 成人免费在线观看入口| 国产美女av一区二区三区| 激情综合色播五月| 日韩激情av在线| 免费观看一级特黄欧美大片| 97久久精品人人做人人爽50路| 欧美区视频在线观看| 欧美日韩一区在线观看| 亚洲欧洲日韩av| 国产精品综合网| 成人av动漫网站| 日本午夜精品视频在线观看| av在线不卡免费看| 国产人久久人人人人爽| 韩国一区二区三区| 欧美一区二区三区人| 久久日韩精品一区二区五区| 婷婷中文字幕综合| 欧美日韩在线播放三区四区| 中文字幕亚洲区| 成人91在线观看| 国产精品免费看片| 亚洲第一搞黄网站| 91官网在线观看| 一区二区三区在线免费视频| 成人高清在线视频| 国产精品免费视频观看| 成人激情电影免费在线观看| 久久综合九色综合97婷婷女人 | 麻豆成人久久精品二区三区红| 欧美日韩一区在线观看| 性欧美大战久久久久久久久| 欧美日韩大陆在线| 午夜电影一区二区| 欧美一级片在线看| 精品亚洲国产成人av制服丝袜| 欧美成人免费网站| 一区二区三区在线视频观看| 色94色欧美sute亚洲线路一ni| 国产精品伦理在线| 亚洲一区二区三区中文字幕在线| 毛片基地黄久久久久久天堂| 欧美第一区第二区| 成人国产一区二区三区精品| 亚洲欧美日韩久久精品| 欧美日韩成人高清| 五月综合激情网| 日韩精品一区在线观看| 国产福利一区二区三区| 欧美一区二区三区视频在线观看| 美女www一区二区| 久久精品人人做人人综合 | 国产黄色成人av| 久久无码av三级| av一区二区三区在线| 亚洲午夜激情网站| 精品国产精品网麻豆系列| 成人动漫精品一区二区| 亚洲妇女屁股眼交7| 精品久久人人做人人爽| 9久草视频在线视频精品| 亚洲成人av电影| 337p粉嫩大胆噜噜噜噜噜91av| 成人听书哪个软件好| 亚洲午夜久久久久久久久电影网| 日韩精品专区在线| 91视频国产资源| 国产精品激情偷乱一区二区∴| 日本不卡免费在线视频| 国产黄色成人av| 婷婷一区二区三区| 国产农村妇女毛片精品久久麻豆 | 国产+成+人+亚洲欧洲自线| 一区二区三区影院| 久久色中文字幕| 欧美精品乱人伦久久久久久| 亚洲第一av色| 最新日韩在线视频| 精品久久99ma| 欧美精品色综合| 99精品欧美一区二区蜜桃免费| 蜜臀av一区二区在线观看| 亚洲欧美日韩国产另类专区| 久久久国产精华| 精品日韩99亚洲| 777xxx欧美| 欧美日本一区二区| 色悠久久久久综合欧美99| 国产aⅴ精品一区二区三区色成熟| 日日夜夜精品视频天天综合网| 最新国产精品久久精品| 91最新地址在线播放| 精品一区二区免费在线观看| 亚洲第一成人在线| 亚洲成人1区2区| 亚洲综合男人的天堂| 自拍偷在线精品自拍偷无码专区| 国产亚洲污的网站| 久久色.com| 2024国产精品视频| 久久婷婷久久一区二区三区| 日韩午夜小视频| 日韩一区二区三区视频| 8v天堂国产在线一区二区| 欧美日韩国产美女| 欧美色图12p| 欧美欧美欧美欧美| 欧美精品乱码久久久久久| 欧美日韩一区 二区 三区 久久精品| 91蜜桃免费观看视频| 91色乱码一区二区三区| 欧美在线短视频| 欧美色电影在线| 日韩亚洲欧美一区| 精品国产成人系列| 久久人人爽爽爽人久久久| 久久综合国产精品| 国产精品久久久久久亚洲伦| 日韩理论片网站| 亚洲国产日产av| 免费观看在线色综合| 国产精品一卡二卡| 99久久综合国产精品| 色8久久人人97超碰香蕉987| 欧美色欧美亚洲另类二区| 日韩欧美第一区| 中文字幕av一区 二区| 日韩理论片在线| 日本伊人午夜精品| 国产精品中文有码| 色偷偷一区二区三区| 欧美高清www午色夜在线视频| 精品国产乱码久久久久久久久| 国产日韩欧美综合在线| 亚洲综合图片区| 久久99久久精品| 91在线精品一区二区三区| 欧洲生活片亚洲生活在线观看| 91精品国模一区二区三区| 久久精品一区二区三区四区| 日韩理论电影院| 国产在线精品一区二区 | 五月婷婷激情综合| 国产精品99久久久久久久vr| 91丝袜美女网| 精品国产污网站| 亚洲综合成人网| 国产成人亚洲综合a∨婷婷图片| 欧美亚洲一区二区在线| 久久精品一区二区三区四区| 丝袜美腿成人在线| 91在线云播放| 欧美国产国产综合|