/**\r
- * \file api_drv_joystick\r
+ * \file api_drv_joystick.h\r
* \brief Joystick Driver Interface Definitions\r
* \author John Hodge (thePowersGang)\r
* \r
\r
/**\r
* ioctl(..., tJoystickNumValue *)\r
- * \brief Set maximum value for sJoystick_Axis.CurState\r
+ * \brief Set maximum value for sJoystick_Axis.CursorPos\r
* \note If \a Value is equal to -1 (all bits set), the value is not changed\r
*/\r
JOY_IOCTL_GETSETAXISLIMIT,\r
\r
/**\r
* ioctl(..., tJoystickNumValue *)\r
- * \brief Set the value of sJoystick_Axis.CurState\r
+ * \brief Set the value of sJoystick_Axis.CursorPos\r
* \note If \a Value is equal to -1 (all bits set), the value is not changed\r
*/\r
JOY_IOCTL_GETSETAXISPOSITION,\r
JOY_IOCTL_GETSETBUTTONFLAGS,\r
};\r
\r
+/**\r
+ * \brief Symbolic names for Joystick IOCtls\r
+ */\r
#define DRV_JOY_IOCTLNAMES "set_callback", "set_callback_arg", "getset_axis_limit", "getset_axis_position", \\r
"getset_axis_flags", "getset_button_flags"\r
\r
\r
/**\r
* \struct sJoystick_FileHeader\r
+ * \brief Format of the joystick VFS node's first bytes\r
*/\r
struct sJoystick_FileHeader\r
{\r
Uint16 NAxies; //!< Number of Axies\r
Uint16 NButtons; //!< Number of buttons\r
-} PACKED;\r
+};\r
\r
/**\r
* \brief Axis Definition in file data\r
Sint16 MaxValue; //!< Maximum value for \a CurValue\r
Sint16 CurValue; //!< Current value (joystick position)\r
Uint16 CursorPos; //!< Current state (cursor position)\r
-} PACKED;\r
+};\r
\r
+/**\r
+ * \brief Macro to define a structure for a joystick's node\r
+ * \param _naxies Number of axies\r
+ * \param _nbuttons Number of buttons\r
+ * \note This just defines the structure, it's up to the driver to set the\r
+ * sJoystick_FileHeader.NAxies and sJoystick_FileHeader.NButtons fields.\r
+ */\r
#define JOY_INFOSTRUCT(_naxies, _nbuttons) struct { \\r
Uint16 NAxies, NButtons;\\r
tJoystick_Axis Axies[_naxies];\\r