-- Temperature and UID reader\r
--------------------------------------------------------------------------- \r
\r
-TEMP_SENSOR_AND_UID: entity temp_sensor_and_UID\r
+TEMP_SENSOR_AND_UID: entity Amps2_TempSensor_UID\r
port map(\r
clk => clk_i,\r
temperature => temperature_i,\r
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
-entity interface is
+entity Amps2_Interface is
generic(
clk_frequency : integer := 133_000_000;
i2c_frequency : integer := 13_300
scl : inout std_logic
);
-end interface;
+end Amps2_Interface;
-architecture Behavioral of interface is
+architecture Behavioral of Amps2_Interface is
--The address of the TCS34725. This device has only one possible address,
--so we won't genericize it.
if controller_accepted_data = '1' then
state <= wait_for_read;
end if;
- \r when wait_for_read =>
+ when wait_for_read =>
ena<='0';
current_byte_number <=0;
temperature(11 downto 4)<=temp_data_MSB;
temperature(3 downto 0)<=temp_data_LSB(7 downto 4);
- end Behavioral;
\ No newline at end of file
+ end Behavioral;
library lattice;
use lattice.components.all;
-entity temp_sensor_and_UID is
+entity Amps2_TempSensor_UID is
port(
clk : in std_logic;
temperature: out std_logic_vector(11 downto 0);
sda : inout std_logic;
scl : inout std_logic
);
-end temp_sensor_and_UID;
+end Amps2_TempSensor_UID;
-architecture Behavioral of temp_sensor_and_UID is
+architecture Behavioral of Amps2_TempSensor_UID is
--signal clk : std_logic;
signal reset : std_logic;
signal count : std_logic_vector (26 downto 0);
begin
--- temperature <= "1111" & x"AB";
+-- temperature <= "1111" & x"AB";
- SENSOR_INTERFACE: entity interface
+ SENSOR_INTERFACE: entity Amps2_Interface
generic map(
clk_frequency => 133_000_000,
i2c_frequency => 13_300
port map(
clk => clk,
reset => reset,
- temperature => temperature,
+ temperature => temperature,
sda => sda,
scl => scl
);