jctrl.vh 942 Bytes
// jctrl.vh v1 Frank Berndt
// si joy channel controller definitions;

// controller commands;

`define	JCTRL_STATUS	8'd0		// query status/type;
`define	JCTRL_QUERY	8'd1		// query buttons and stick;
`define	JCTRL_READ	8'd2		// read 32 bytes;
`define	JCTRL_WRITE	8'd3		// write 32 bytes;
`define	JCTRL_RESET	8'd255		// controller reset;

// controller responses;

`define	JRSP_OK		8'h00		// no error;
`define	JRSP_MASK	8'hf8		// all error bits;
`define	JRSP_NORSP	8'h80		// no response;
`define	JRSP_REQERR	8'h40		// request error;
`define	JRSP_FRAMERR	8'h20		// frame error;
`define	JRSP_COLLERR	8'h10		// collision error;
`define	JRSP_RESET	8'h08		// controller reset;

// dv flags;

`define	JCTRL_OFF	4'b0000		// controller is disabled;
`define	JCTRL_ON	4'b0001		// controller is enabled;
`define	JCTRL_COLLIDE	4'b0011		// force collision;
`define	JCTRL_FRAMERR	4'b0101		// force frame error;
`define	JCTRL_MASTER	4'b1001		// master mode;