总共定义了4个寄存器,位宽32位,也就是 偏移地址*4
以下是PS写数据
when 0 => I2S_RESET_REG <= wr_data;
						
when 1 => I2S_CONTROL_REG <= wr_data;
						
when 2 => I2S_CLK_CONTROL_REG <= wr_data;
						
when 6 => PERIOD_LEN_REG <= wr_data;
1:I2S_RESET_REG --地址0*4
i2s_reset		<= I2S_RESET_REG(0);
	--保留未用
tx_fifo_reset		<= I2S_RESET_REG(1);
--》高有效	
rx_fifo_reset		<= I2S_RESET_REG(2);--》高有效复位
2:I2S_CONTROL_REG --地址1*4
tx_enable		<= I2S_CONTROL_REG(0) = ‘1‘;
	
rx_enable		<= I2S_CONTROL_REG(1) = ‘1‘;
3:I2S_CLK_CONTROL_REG ---地址2*4
bclk_div_rate		<= to_integer(unsigned(I2S_CLK_CONTROL_REG(7 downto 0)));
	
lrclk_div_rate		<= to_integer(unsigned(I2S_CLK_CONTROL_REG(23 downto 16)));
4:PERIOD_LEN_REG  ----地址6*4
period_len		<= to_integer(unsigned(PERIOD_LEN_REG(15 downto 0)));
收fifo的大小
以下是PS读数据
when 1 => rd_data <=  I2S_CONTROL_REG and x"00000003";
			
when 2 => rd_data <=  I2S_CLK_CONTROL_REG and x"00ff00ff";
			
when 6 => rd_data <= PERIOD_LEN_REG and x"0000ffff";
			
when 10 => rd_data <= rx_sample & std_logic_vector(to_unsigned(cnt, 8));---》地址10*4
when 10 --》高24位为采样接收的数据  -》低8位为分频计数器的值
原文:https://www.cnblogs.com/yssrf-possible/p/8963693.html