From f43dc25b5ef701b226af9ee9ad1af352c43ee6e9 Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Wed, 12 Apr 2023 09:26:23 +0200 Subject: [PATCH] add support for TMP112 temperature sensor and its 13bit data format --- special/trb_net_i2cwire.vhd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/special/trb_net_i2cwire.vhd b/special/trb_net_i2cwire.vhd index 7bf8da6..268ac4c 100644 --- a/special/trb_net_i2cwire.vhd +++ b/special/trb_net_i2cwire.vhd @@ -299,7 +299,11 @@ begin temp_int <= (others => '0'); elsif( (CURRENT_STATE = RD_TMP) and (valid_int = '1') ) then -- elsif( (temp_we = '1') ) then - temp_int <= i2c_dr_int(15 downto 4); + if i2c_dr_int(0) = '0' then --support for 13bit format of TMP112 + temp_int <= i2c_dr_int(15 downto 4); + else + temp_int <= i2c_dr_int(14 downto 3); + end if; end if; end if; end process THE_TEMP_REG_PROC; -- 2.43.0