libx52 0.3.3
Saitek X52/X52Pro drivers for Linux/Unix
Loading...
Searching...
No Matches
Data Structures | Typedefs | Enumerations | Functions
libx52io.h File Reference

Functions, structures and enumerations for the Saitek X52 IO driver library. More...

Go to the source code of this file.

Data Structures

struct  libx52io_report
 X52 HID Report. More...
 

Typedefs

typedef struct libx52io_context libx52io_context
 Device context structure used by libx52io.
 

Enumerations

enum  libx52io_error_code {
  LIBX52IO_SUCCESS , LIBX52IO_ERROR_INIT_FAILURE , LIBX52IO_ERROR_NO_DEVICE , LIBX52IO_ERROR_INVALID ,
  LIBX52IO_ERROR_CONN , LIBX52IO_ERROR_IO , LIBX52IO_ERROR_TIMEOUT
}
 libx52 IO error codes More...
 
enum  libx52io_axis {
  LIBX52IO_AXIS_X , LIBX52IO_AXIS_Y , LIBX52IO_AXIS_RZ , LIBX52IO_AXIS_Z ,
  LIBX52IO_AXIS_RX , LIBX52IO_AXIS_RY , LIBX52IO_AXIS_SLIDER , LIBX52IO_AXIS_THUMBX ,
  LIBX52IO_AXIS_THUMBY , LIBX52IO_AXIS_HATX , LIBX52IO_AXIS_HATY , LIBX52IO_AXIS_MAX
}
 X52 Axis definitions. More...
 
enum  libx52io_button {
  LIBX52IO_BTN_TRIGGER , LIBX52IO_BTN_TRIGGER_2 , LIBX52IO_BTN_FIRE , LIBX52IO_BTN_PINKY ,
  LIBX52IO_BTN_A , LIBX52IO_BTN_B , LIBX52IO_BTN_C , LIBX52IO_BTN_D ,
  LIBX52IO_BTN_E , LIBX52IO_BTN_T1_UP , LIBX52IO_BTN_T1_DN , LIBX52IO_BTN_T2_UP ,
  LIBX52IO_BTN_T2_DN , LIBX52IO_BTN_T3_UP , LIBX52IO_BTN_T3_DN , LIBX52IO_BTN_POV_1_N ,
  LIBX52IO_BTN_POV_1_E , LIBX52IO_BTN_POV_1_S , LIBX52IO_BTN_POV_1_W , LIBX52IO_BTN_POV_2_N ,
  LIBX52IO_BTN_POV_2_E , LIBX52IO_BTN_POV_2_S , LIBX52IO_BTN_POV_2_W , LIBX52IO_BTN_CLUTCH ,
  LIBX52IO_BTN_MOUSE_PRIMARY , LIBX52IO_BTN_MOUSE_SECONDARY , LIBX52IO_BTN_MOUSE_SCROLL_UP , LIBX52IO_BTN_MOUSE_SCROLL_DN ,
  LIBX52IO_BTN_FUNCTION , LIBX52IO_BTN_START_STOP , LIBX52IO_BTN_RESET , LIBX52IO_BTN_PG_UP ,
  LIBX52IO_BTN_PG_DN , LIBX52IO_BTN_UP , LIBX52IO_BTN_DN , LIBX52IO_BTN_SELECT ,
  LIBX52IO_BTN_MODE_1 , LIBX52IO_BTN_MODE_2 , LIBX52IO_BTN_MODE_3 , LIBX52IO_BUTTON_MAX
}
 X52 Button definitions. More...
 

Functions

LIBX52IO_API int libx52io_init (libx52io_context **ctx)
 Initialize the IO library.
 
LIBX52IO_API void libx52io_exit (libx52io_context *ctx)
 Exit the library and free up any resources used.
 
LIBX52IO_API int libx52io_open (libx52io_context *ctx)
 Open a connection to a supported joystick.
 
LIBX52IO_API int libx52io_close (libx52io_context *ctx)
 Close an existing connection to a supported joystick.
 
LIBX52IO_API int libx52io_read_timeout (libx52io_context *ctx, libx52io_report *report, int timeout)
 Read and parse a HID report.
 
LIBX52IO_API int libx52io_read (libx52io_context *ctx, libx52io_report *report)
 Read and parse a HID report.
 
LIBX52IO_API int libx52io_get_axis_range (libx52io_context *ctx, libx52io_axis axis, int32_t *min, int32_t *max)
 Retrieve the range of an axis.
 
LIBX52IO_API const char * libx52io_strerror (libx52io_error_code code)
 Get the string representation of an error code.
 
LIBX52IO_API const char * libx52io_axis_to_str (libx52io_axis axis)
 Get the string representation of an axis.
 
LIBX52IO_API const char * libx52io_button_to_str (libx52io_button button)
 Get the string representation of a button.
 
LIBX52IO_API int libx52io_axis_from_str (const char *str, libx52io_axis *axis)
 Parse the string representation of an axis.
 
LIBX52IO_API int libx52io_button_from_str (const char *str, libx52io_button *button)
 Parse the string representation of a button.
 
LIBX52IO_API int libx52io_axis_from_str_nocase (const char *str, libx52io_axis *axis)
 Parse an axis name with ASCII case-insensitive matching.
 
LIBX52IO_API int libx52io_button_from_str_nocase (const char *str, libx52io_button *button)
 Parse a button name with ASCII case-insensitive matching.
 
LIBX52IO_API uint16_t libx52io_get_vendor_id (libx52io_context *ctx)
 Get the vendor ID of the connected X52 device.
 
LIBX52IO_API uint16_t libx52io_get_product_id (libx52io_context *ctx)
 Get the product ID of the connected X52 device.
 
LIBX52IO_API uint16_t libx52io_get_device_version (libx52io_context *ctx)
 Get the device version of the connected X52 device.
 
LIBX52IO_API const char * libx52io_get_manufacturer_string (libx52io_context *ctx)
 Get the manufacturer string of the connected X52 device.
 
LIBX52IO_API const char * libx52io_get_product_string (libx52io_context *ctx)
 Get the product string of the connected X52 device.
 
LIBX52IO_API const char * libx52io_get_serial_number_string (libx52io_context *ctx)
 Get the serial number of the connected X52 device.
 

Detailed Description

Functions, structures and enumerations for the Saitek X52 IO driver library.

This file contains the type, enum and function prototypes for the Saitek X52 IO driver library. These functions allow an application to connect to a supported X52/X52Pro joystick and read the state of the buttons and axes.

Author
Nirenjan Krishnan (niren.nosp@m.jan@.nosp@m.niren.nosp@m.jan..nosp@m.org)