when WAIT5 => -- Continue Delay
w_ack <= '0';
w_ack_v <= '1';
next_wstate <= WAIT6;
when WAIT6 => -- Release Delay
w_ack <= '1';
w_ack_v <= '1';
next_wstate <= WAIT0;
end case;
end process wait_state;
-- *************************************************
-- Codec Reset
-- *************************************************
cdc_rst: process(clk, addr, cs_bar, reset)
variable cdc_cnt: std_logic_vector(4 downto 0);
begin
if (reset = '1') then -- If reset
cdc_cnt := (others => '0'); -- reset counter
codec_rst_bar <= '0'; -- pass reset to codec
elsif (rising_edge(clk)) then -- otherwise (key on rising edge)
if (cdc_cnt = "00000") then -- if counter hasn't started
if ((addr = "0100") AND (cs_bar = '0')) then -- check if reset
cdc_cnt := c 1; -- Start counter
codec_rst_bar <= '0'; -- Reset codec
else -- if not reset
codec_rst_bar <= '1'; -- hold reset high
end if;
else -- if counter has started
cdc_cnt := c 1; -- increment counter
codec_rst_bar <= '0'; -- Reset codec
end if;
end if;
end process cdc_rst;
end;
To use the CODEC controls, reference the buffer.asm and .ldf files provided with the demos. These files
provide access to the necessary variables by overlapping the locations of the variables.
74
www.BDTIC.com/ADI