5use IEEE.STD_LOGIC_1164.
ALL;
6use IEEE.NUMERIC_STD.
ALL;
13 SENSOR_ADDR : std_logic_vector(6 downto 0) := "1011100"
33 signal i2c_addr_reg : std_logic_vector(7 downto 0) := (others => '0');
37 signal i2c_wr_data : std_logic_vector(15 downto 0) := (others => '0');
102 mi_MMCM :
entity work.clk_wiz_0
151 if rising_edge(mclk) then
177 state <= ST_WR_FILL_FIFO;
184 when ST_WR_FILL_FIFO =>
188 state <= ST_WR_START;
212 state <= ST_RD_START;
233 state <= ST_RD_DRAIN;
main_state_t := ST_IDLE state
std_logic_vector( 15 downto 0) :=( others => '0') i2c_wr_data
std_logic_vector( 7 downto 0) :=( others => '0') i2c_addr_reg
(ST_IDLE,ST_WR_FILL_FIFO,ST_WR_START,ST_WR_WAIT,ST_RD_START,ST_RD_WAIT,ST_RD_DRAIN,ST_FINISH,ST_ERROR) main_state_t
std_logic := '0' i2c_rd_pop
std_logic := '0' i2c_start
std_logic := '0' i2c_wr_push
integer range 1 to FIFO_DEPTH:= 1 i2c_num_regs
std_logic_vector( 15 downto 0) i2c_rd_data
rd_buf_t :=( others =>( others => '0')) rd_buf
reg_data_array_t :=( 0=> x"823A", 1=> x"0010") WR_DATA
integer range 0 to NUM_REGS_RD:= 0 rd_cnt
( 0 to NUM_REGS_WR- 1) std_logic_vector( 15 downto 0) reg_data_array_t
( 0 to NUM_REGS_RD- 1) std_logic_vector( 15 downto 0) rd_buf_t
integer range 0 to FIFO_DEPTH:= 0 fill_cnt
CLK_FREQ_HZ integer := 50_000_000
SENSOR_ADDR std_logic_vector( 6 downto 0) := "1011100"
I2C_FREQ_HZ integer := 400_000
out rd_fifo_empty std_logic
in addr_reg std_logic_vector( 7 downto 0)
CLK_FREQ_HZ integer := 50_000_000
I2C_FREQ_HZ integer := 400_000
out wr_fifo_empty std_logic
in wr_fifo_data std_logic_vector( 15 downto 0)
in addr_dev std_logic_vector( 6 downto 0)
in wr_fifo_push std_logic
out rd_fifo_full std_logic
out wr_fifo_full std_logic
out rd_fifo_data std_logic_vector( 15 downto 0)
in num_regs integer range 1 to FIFO_DEPTH