--- /dev/null
+/**\r
+ * \file tpl_drv_joystick\r
+ * \brief Joystick Driver Interface Definitions\r
+ * \author John Hodge (thePowersGang)\r
+ * \r
+ * \section dirs VFS Layout\r
+ * Joystick drivers define a single VFS node, that acts as a fixed size file.\r
+ * Reads from this file return the current state, writes are ignored.\r
+ *\r
+ * \section File Structure\r
+ * The device file must begin with a valid sJoystick_FileHeader structure.\r
+ * The file header is followed by \a NAxies instances of sJoystick_Axis, one\r
+ * for each axis.\r
+ * This is followed by \a NButtons boolean values (represented using \a Uint8),\r
+ * each representing the state of a single button (where 0 is unpressed,\r
+ * 0xFF is fully depressed - intermediate values are valid in the case of\r
+ * variable-pressure buttons)\r
+ */\r
+#ifndef _TPL_JOYSTICK_H\r
+#define _TPL_JOYSTICK_H\r
+\r
+#include <tpl_drv_common.h>\r
+\r
+/**\r
+ * \enum eTplJoystick_IOCtl\r
+ * \brief Common Joystick IOCtl Calls\r
+ * \extends eTplDrv_IOCtl\r
+ */\r
+enum eTplJoystick_IOCtl {\r
+ /**\r
+ * ioctl(..., struct{int Ident;tKeybardCallback *Callback})\r
+ * \brief Sets the callback\r
+ * \note Can be called from kernel mode only\r
+ *\r
+ * Sets the callback that is called when a event occurs (button or axis\r
+ * change). This function pointer must be in kernel mode (although,\r
+ * kernel->user or kernel->ring3driver abstraction functions can be used)\r
+ */\r
+ JOY_IOCTL_SETCALLBACK = 4,\r
+\r
+ /**\r
+ * ioctl(..., struct{int AxisNum;int Value})\r
+ * \brief Set maximum value for sJoystick_Axis.CurState\r
+ */\r
+ JOY_IOCTL_SETAXISLIMIT,\r
+ \r
+ /**\r
+ * ioctl(..., struct{int AxisNum;int Value})\r
+ * \brief Set axis flags\r
+ */\r
+ JOY_IOCTL_SETAXISFLAGS,\r
+\r
+ /**\r
+ * ioctl(..., struct{int ButtonNum;int Value})\r
+ * \brief Set Button Flags\r
+ */\r
+ JOY_IOCTL_SETBUTTONFLAGS,\r
+};\r
+\r
+/**\r
+ * \brief Callback type for JOY_IOCTL_SETCALLBACK\r
+ * \param Ident Ident value passed to JOY_IOCTL_SETCALLBACK\r
+ * \r
+ */\r
+typedef void (*tJoystickCallback)(int Ident, int bIsAxis, int Num, int Delta);\r
+\r
+/**\r
+ * \struct sJoystick_FileHeader\r
+ */\r
+struct sJoystick_FileHeader\r
+{\r
+ Uint16 NAxies;\r
+ Uint16 NButtons;\r
+};\r
+\r
+struct sJoystick_Axis\r
+{\r
+ Sint16 MinValue;\r
+ Sint16 MaxValue;\r
+ Sint16 CurValue;\r
+ Uint16 CurState;\r
+};\r
+\r
+#endif\r