/* driver/hid/usb/hid/joystk.h
 *
 * (c) 2002 Simtec Electronics
 *
 * Ben Dooks
 *
 * USB HID Joystick driver
 *
 * $Id: joystk.h,v 1.5 2003/08/08 11:17:17 ben Exp $
 *
 * This Library file is part of the Simtec Electronics USB stack development
 *   suite.
 * Specific licence is granted to use this file by third parties for the
 *   development of USB device drivers.
 *
*/


#ifndef __USB_HID_JOYSTK_H
#define __USB_HID_JOYSTK_H "$Id: joystk.h,v 1.5 2003/08/08 11:17:17 ben Exp $"

/* struct hid_joy_core
 *
 * internal structure for the joystick core, not defined here
*/

struct hid_joy_core;

/* struct hid_joy_drv
 *
 * internal structure for the specific joystick driver, not defined here 
*/

struct hid_joy_drv;

/* struct hid_joy_state_s 
 *
 * hid joystick state for use 
*/

struct hid_state_joystick {
  struct hid_joy_drv  *drv;    /* internal joystick information */
  struct hid_joy_core *core;   /* core information for this */

  int            x;            /* joystick x position */
  int            y;            /* joystick y position */
  int            buttons;      /* joystick buttons state (0..31) */
};

#define HID_MSG_JOYSTICK_BASE  (HID_MSG_BASE + 0x1000)

/* messages -
 *
 * add: sent from joystick driver to core to add joystick
 * rem: sent from joystick driver to core to remove joystick
 * del: sent from core to joystick drivers when closing down
 *
*/

#define usbmsg_class_joystick_add ((usbmsg_class_t) (HID_MSG_JOYSTICK_BASE+0))
#define usbmsg_class_joystick_rem ((usbmsg_class_t) (HID_MSG_JOYSTICK_BASE+1))
#define usbmsg_class_joystick_del ((usbmsg_class_t) (HID_MSG_JOYSTICK_BASE+2))

#define usbmsg_class_joystick_stop ((usbmsg_class_t) (HID_MSG_JOYSTICK_BASE+3))
#define usbmsg_class_joystick_start ((usbmsg_class_t) (HID_MSG_JOYSTICK_BASE+4))

/* struct usbmsg_hid_joy_add_s
 *
 * sent from joystick driver to joystick core to add a joystick.
 *
 * if message is claimed, then the result is either 1 for ok, or >1 for error
*/

struct usbmsg_hid_joy_add_s {
  struct hid_dev        *hid;       /* hid-dev that is in use */
  struct hid_joy_drv    *drv;       /* driver's private information */
};

/* struct usbmsg_hid_joy_rem_s
 *
 * sent to remove an hid joystick from the core, note this will not
 * drop it from the hid core.
 */

struct usbmsg_hid_joy_rem_s {
  struct hid_dev        *hid;      /* hid-dev to remove */
};

/* the usbmsg_hid_joy_del_s is actually the same as the 
 * usbmsg_hid_joy_rem_s, so is not defined seperately */

#define usbmsg_hid_joy_del_s usbmsg_hid_joy_rem_s



#endif /* __USB_HID_JOYSTK_H */
