use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.util.all;
+use work.qcounter.all;
entity rpi_mc_simple_dc is
port (
gpio23: out std_logic; -- SD1CMD
gpio24: out std_logic; -- SD1DAT0
gpio10: in std_logic; -- SPI0MOSI
- gpio9: in std_logic; -- SPI0MISO
+ gpio9: out std_logic; -- SPI0MISO
gpio25: out std_logic; -- SD1DAT1
gpio11: in std_logic; -- SPI0SCLK
gpio8: in std_logic; -- SPI0CE0
signal pwm_in, pwm_dir_in: std_logic;
signal spi_clk: std_logic;
- signal dat_reg : STD_LOGIC_VECTOR (7 downto 0); --registr pro SPI
+ signal dat_reg : STD_LOGIC_VECTOR (7 downto 0):=(others=>'0'); --registr pro SPI
-- attribute syn_noprune of gpio2 : signal is true;
-- attribute syn_preserve of gpio2 : signal is true;
dip_sw(1) and dip_sw(2) and dip_sw(3) and
irc_a and irc_b and
-- gpio17 and gpio18 and gpio27 and gpio22 and
- gpio8 and gpio9 and gpio11 and gpio7 and gpio10 and
+ gpio8 and gpio11 and gpio7 and gpio10 and
ext_scs1 and ext_scs2 and ext_miso and ext_mosi and ext_sclk and ext_scs0;
rs485_txd <= '1';
-- of SCK, MSB first
dat_reg(7 downto 0) <= dat_reg(6 downto 0) & gpio10;
- gpio4 <= dat_reg(7);
- gpio17 <= dat_reg(6);
- gpio18 <= dat_reg(5);
- gpio27 <= dat_reg(4);
- gpio22 <= dat_reg(3);
- gpio23 <= dat_reg(2);
- gpio24 <= dat_reg(1);
- gpio25 <= dat_reg(0);
+ end if;
+ elsif (falling_edge(spi_clk)) then
+ if (gpio7 = '0') then
+ gpio9 <= dat_reg(7); --zapisujeme nejdriv MSB
end if;
end if;
end process;