-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathone_wire_io.vhd
51 lines (44 loc) · 2.32 KB
/
one_wire_io.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
----------------------------------------------------------------------------
-- --
-- OneWireMaster --
-- A synthesizable 1-wire master peripheral --
-- Copyright 1999-2007 Dallas Semiconductor Corporation --
-- --
----------------------------------------------------------------------------
-- --
-- Purpose: Provides timing and control of Dallas 1-wire bus --
-- through a memory-mapped peripheral --
-- File: one_wire_io.vhd --
-- Date: January 17, 2007 --
-- Version: v1.100 --
-- Authors: Eric Hereford, --
-- Dallas Semiconductor Corporation --
-- --
-- Note: This source code is available for use without license. --
-- Dallas Semiconductor is not responsible for the --
-- functionality or utility of this product. --
-- --
-- REV: Initial port based on v2.100 Verilog - EAH --
----------------------------------------------------------------------------
library IEEE;
use IEEE.std_logic_1164.all;
entity one_wire_io is
port(
CLK : IN std_logic;
DQ_CONTROL : IN std_logic;
MR : IN std_logic;
DQ_IN : OUT std_logic;
DQ : INOUT std_logic);
end one_wire_io;
architecture rtl_one_wire_io of one_wire_io is
begin
DQ <= 'Z' when DQ_CONTROL='1' else '0';
process(MR, CLK)
begin
if (MR='1') then
DQ_IN <= '1';
elsif falling_edge(CLK) then
DQ_IN <= DQ;
end if;
end process;
end architecture rtl_one_wire_io;