REGIO_IDRAM_ADDR_IN : in std_logic_vector(2 downto 0) := "000";
REGIO_IDRAM_WR_IN : in std_logic := '0';
REGIO_ONEWIRE_INOUT : inout std_logic; --temperature sensor
+ I2C_SCL : inout std_logic;
+ I2C_SDA : inout std_logic;
REGIO_ONEWIRE_MONITOR_IN : in std_logic := '0';
REGIO_ONEWIRE_MONITOR_OUT : out std_logic;
REGIO_VAR_ENDPOINT_ID : in std_logic_vector(15 downto 0) := (others => '0');
STAT => buf_stat_onewire
);
end generate;
+ gen_i2c : if REGIO_USE_1WIRE_INTERFACE = c_I2C generate
+ REGIO_ONEWIRE_MONITOR_OUT <= '0';
+ REGIO_ONEWIRE_INOUT <= '0';
+ i2c_interface : trb_net_i2cwire
+ generic map(
+ USE_TEMPERATURE_READOUT => c_YES,
+ CLK_PERIOD => 10
+ )
+ port map(
+ CLK => CLK,
+ RESET => RESET,
+ READOUT_ENABLE_IN => '1',
+ --connection to I2C interface
+ SCL_INOUT => I2C_SCL,
+ SDA_INOUT => I2C_SDA,
+ --connection to id ram, according to memory map in TrbNetRegIO
+ DATA_OUT => ONEWIRE_DATA,
+ ADDR_OUT => ONEWIRE_ADDR,
+ WRITE_OUT => ONEWIRE_WRITE,
+ TEMP_OUT => temperature,
+ ID_OUT => UNIQUE_ID_OUT,
+ STAT => buf_stat_onewire
+ );
+ end generate;
end generate;
end generate;
gentermbuf: if USE_CHANNEL(i) = c_NO generate
BROADCAST_BITMASK : std_logic_vector(7 downto 0) := x"FF";
REGIO_INIT_ENDPOINT_ID : std_logic_vector(15 downto 0) := x"0001";
REGIO_USE_VAR_ENDPOINT_ID : integer range c_NO to c_YES := c_NO;
+ REGIO_USE_1WIRE_INTERFACE : integer range 0 to 3 := c_YES;
TIMING_TRIGGER_RAW : integer range 0 to 1 := c_YES;
--Configure data handler
DATA_INTERFACE_NUMBER : integer range 1 to 16 := 1;
BUS_MASTER_ACTIVE : in std_logic := '0';
--Onewire
ONEWIRE_INOUT : inout std_logic;
+ I2C_SCL : inout std_logic;
+ I2C_SDA : inout std_logic;
--Config endpoint id, if not statically assigned
REGIO_VAR_ENDPOINT_ID : in std_logic_vector (15 downto 0) := (others => '0');
TIMERS_OUT : out TIMERS;
REGIO_COMPILE_TIME => (others => '0'),
REGIO_INCLUDED_FEATURES => INCLUDED_FEATURES,
REGIO_HARDWARE_VERSION => HARDWARE_INFO,
- REGIO_USE_1WIRE_INTERFACE => c_YES,
+ REGIO_USE_1WIRE_INTERFACE => REGIO_USE_1WIRE_INTERFACE,
REGIO_USE_VAR_ENDPOINT_ID => REGIO_USE_VAR_ENDPOINT_ID,
TIMING_TRIGGER_RAW => TIMING_TRIGGER_RAW,
CLOCK_FREQUENCY => CLOCK_FREQUENCY
REGIO_ONEWIRE_INOUT => ONEWIRE_INOUT,
REGIO_ONEWIRE_MONITOR_IN => '0',
REGIO_ONEWIRE_MONITOR_OUT => open,
+ I2C_SCL => I2C_SCL,
+ I2C_SDA => I2C_SDA,
REGIO_VAR_ENDPOINT_ID => REGIO_VAR_ENDPOINT_ID,
MY_ADDRESS_OUT => TIMERS_OUT.network_address,
REGIO_IDRAM_ADDR_IN : in std_logic_vector(2 downto 0) := "000";\r
REGIO_IDRAM_WR_IN : in std_logic := '0';\r
REGIO_ONEWIRE_INOUT : inout std_logic; --temperature sensor\r
+ I2C_SCL : inout std_logic;\r
+ I2C_SDA : inout std_logic; \r
REGIO_ONEWIRE_MONITOR_IN : in std_logic := '0';\r
REGIO_ONEWIRE_MONITOR_OUT : out std_logic;\r
REGIO_VAR_ENDPOINT_ID : in std_logic_vector(15 downto 0) := (others => '0');\r
BUS_UNKNOWN_ADDR_IN : in std_logic := '0';\r
--Onewire\r
ONEWIRE_INOUT : inout std_logic; --temperature sensor\r
+ I2C_SCL : inout std_logic;\r
+ I2C_SDA : inout std_logic; \r
ONEWIRE_MONITOR_IN : in std_logic := '0';\r
ONEWIRE_MONITOR_OUT : out std_logic;\r
--Config endpoint id, if not statically assigned\r
\r
\r
\r
-\r
+ component trb_net_i2cwire is\r
+ generic(\r
+ USE_TEMPERATURE_READOUT : integer range 0 to 1 := 1;\r
+ CLK_PERIOD : integer := 10 --clk period in ns\r
+ );\r
+ port(\r
+ CLK : in std_logic;\r
+ RESET : in std_logic;\r
+ READOUT_ENABLE_IN : in std_logic := '1';\r
+ --connection to I2C interface\r
+ SCL_INOUT : inout std_logic;\r
+ SDA_INOUT : inout std_logic;\r
+ --connection to id ram, according to memory map in TrbNetRegIO\r
+ DATA_OUT : out std_logic_vector(15 downto 0);\r
+ ADDR_OUT : out std_logic_vector(2 downto 0);\r
+ WRITE_OUT : out std_logic;\r
+ TEMP_OUT : out std_logic_vector(11 downto 0);\r
+ ID_OUT : out std_logic_vector(63 downto 0);\r
+ STAT : out std_logic_vector(31 downto 0)\r
+ );\r
+ end component;\r
\r
\r
\r
constant c_YES : integer := 1;
constant c_NO : integer := 0;
constant c_MONITOR : integer := 2;
-
+ constant c_I2C : integer := 3;
--standard values
constant std_SBUF_VERSION : integer := c_SBUF_FULL;