I'm using Quartus II 13.0sp1, DE1 Board for testing, and Cyclone II FPGA EP2C20F484C7N. I need to write program in VHDL that sends command to device. I have already created entity and architecture which I successfully used to receive keys from keyboard. Now I need entity that send command to mouse, since mouse expects me to send it commands to start streaming mode.
My biggest problem is that I don't know how to DECLARE and USE ps2_clk and ps2_dat pins to send command to mouse and to receive data from mouse (using same pins to both-way communication). Just after I send 11 bits to mouse, I need to receive one bit using same pin (ps2_dat), and after that receiver ACK byte from mouse using that same pin. Also before I send command I need to pulldown clock line low, for period of 100 microseconds, and after that I need to release clock line so that mouse can generate clock.
I hava no idea how to implements this. Or maybe I misunderstood protocol?