-- KK03-30A Windshield Wiper 1				E235 11 1103

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
--|||||||||||||||||||||||||||||||||||||||||
entity Wiper is 
	port 
	(
	cw_sw: 	in		std_logic;	--Clockwise switch
	ccw_sw: 	in 	std_logic;	--Counterclockwise switch
	run_sw:	in		std_logic;	--Run switch
	
	cw_out: 	out 	std_logic;	--CW signal to motor driver
	ccw_out: out 	std_logic;	--CCW signal to motor driver
	run_out:	out	std_logic	--Enable signal to motor driver
	); 
end Wiper;

--|||||||||||||||||||||||||||||||||||||||||
architecture behavioral of Wiper is 

signal cwo 	:	std_logic := '0';
signal ccwo	:	std_logic := '0';

--=========================================
begin
	process (cw_sw, ccw_sw, run_sw) is
	begin
		--Turn run_out on if run_sw is on.
		if (run_sw = . . . ) then		
			run_out <= . . . ;
			
			--If cw_sw is on, run motor ccw.
			if (cw_sw = . . . ) then
				. . .
				. . .
			end if;
			
			--If ccw_sw is on, run motor cw.
			if (ccw_sw = . . . ) then
				. . .
				. . .
			end if;
		else
			--Turn run_out off if run_sw is off.
			. . .
		end if;
		
		--Send signals to output pins.
		cw_out <= cwo;
		ccw_out <= ccwo;
	end process;
end architecture behavioral;