diff --git a/.nojekyll b/.nojekyll deleted file mode 100644 index e69de29..0000000 diff --git a/bc_s.png b/bc_s.png new file mode 100644 index 0000000..224b29a Binary files /dev/null and b/bc_s.png differ diff --git a/bdwn.png b/bdwn.png new file mode 100644 index 0000000..940a0b9 Binary files /dev/null and b/bdwn.png differ diff --git a/closed.png b/closed.png new file mode 100644 index 0000000..98cc2c9 Binary files /dev/null and b/closed.png differ diff --git a/deprecated.html b/deprecated.html new file mode 100644 index 0000000..b81cb4a --- /dev/null +++ b/deprecated.html @@ -0,0 +1,85 @@ + + +
+ + + + +
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
+Files | |
file | libx52util.h [code] |
Utility functions for the Saitek X52 MFD & LED driver library. | |
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
+Files | |
file | libx52.h [code] |
Functions, structures and enumerations for the Saitek X52 MFD & LED driver library. | |
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
▼ lib | |
▼ libx52 | |
libx52.h | Functions, structures and enumerations for the Saitek X52 MFD & LED driver library |
▼ libx52util | |
libx52util.h | Utility functions for the Saitek X52 MFD & LED driver library |
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
Control the clocks on the MFD. +More...
++Enumerations | |
enum | libx52_clock_id { LIBX52_CLOCK_1, +LIBX52_CLOCK_2, +LIBX52_CLOCK_3 + } |
List of supported clocks on the MFD. More... | |
enum | libx52_clock_format { LIBX52_CLOCK_FORMAT_12HR, +LIBX52_CLOCK_FORMAT_24HR + } |
Supported clock formats. More... | |
enum | libx52_date_format { LIBX52_DATE_FORMAT_DDMMYY, +LIBX52_DATE_FORMAT_MMDDYY, +LIBX52_DATE_FORMAT_YYMMDD + } |
Supported date formats. More... | |
+Functions | |
int | libx52_set_clock (libx52_device *x52, time_t time, int local) |
Set the clock. More... | |
int | libx52_set_clock_timezone (libx52_device *x52, libx52_clock_id clock, int offset) |
Set the timezone for the secondary and tertiary clocks. More... | |
int | libx52_set_clock_format (libx52_device *x52, libx52_clock_id clock, libx52_clock_format format) |
Set whether the clock is displayed in 12 hour or 24 hour format. More... | |
int | libx52_set_time (libx52_device *x52, uint8_t hour, uint8_t minute) |
Set the hour and minute on clock 1. More... | |
int | libx52_set_date (libx52_device *x52, uint8_t dd, uint8_t mm, uint8_t yy) |
Set the date. More... | |
int | libx52_set_date_format (libx52_device *x52, libx52_date_format format) |
Set the date format for the MFD date display. More... | |
Control the clocks on the MFD.
+enum libx52_clock_format | +
enum libx52_clock_id | +
enum libx52_date_format | +
int libx52_set_clock | +( | +libx52_device * | +x52, | +
+ | + | time_t | +time, | +
+ | + | int | +local | +
+ | ) | ++ |
Set the clock.
+This function sets the primary clock's date and time with the specified Unix time value. time
can be obtained from time(2)
. local
controls whether the primary clock displays local time or GMT.
If this function is called again within the same minute as calculated by localtime(3)
or gmtime(3)
, it will return LIBX52_ERROR_TRY_AGAIN, as it does not require any updates to be written to the joystick. However, if the call changes the timezone from local time to GMT or vice-versa, then the function will return 0, since it requires a write to the device to update the clock with the new timezone.
The secondary and tertiary clocks are driven off the primary clock and set using libx52_set_clock_timezone.
+[in] | x52 | Pointer to the device context |
[in] | time | Time value from time(3) |
[in] | local | 0 for GM time, non-zero for localtime |
x52
is not valid. int libx52_set_clock_format | +( | +libx52_device * | +x52, | +
+ | + | libx52_clock_id | +clock, | +
+ | + | libx52_clock_format | +format | +
+ | ) | ++ |
Set whether the clock is displayed in 12 hour or 24 hour format.
+The clocks on the X52 Pro MFD are all displayed as HH:MM, but can be set to display it in 12-hour (AM/PM) or 24-hour format. The default format if not specified is 12-hour.
+[in] | x52 | Pointer to the device context |
[in] | clock | libx52_clock_id |
[in] | format | libx52_clock_format |
x52
is not valid, or if either of clock
or format
are outside their respective ranges. int libx52_set_clock_timezone | +( | +libx52_device * | +x52, | +
+ | + | libx52_clock_id | +clock, | +
+ | + | int | +offset | +
+ | ) | ++ |
Set the timezone for the secondary and tertiary clocks.
+The X52 Pro has a total of 3 clock displays. The secondary and tertiary clocks are controlled as an offset from the primary clock in minutes. However, for convenience, the X52 library calculates this offset internally and only requires you to set the timezone as the number of minutes east of UTC. offset
is limited to ± 1440 minutes, and any offset outside this range will result in a return value of LIBX52_ERROR_OUT_OF_RANGE
[in] | x52 | Pointer to the device context |
[in] | clock | libx52_clock_id, cannot be LIBX52_CLOCK_1 |
[in] | offset | Offset in minutes from GMT (east is positive, west is negative) |
x52
is invalidclock
is LIBX52_CLOCK_1offset
is more than ± 24 hours. int libx52_set_date | +( | +libx52_device * | +x52, | +
+ | + | uint8_t | +dd, | +
+ | + | uint8_t | +mm, | +
+ | + | uint8_t | +yy | +
+ | ) | ++ |
Set the date.
+This is a raw API which can be used for manual control if the user so desires, however, it will not update the timezone or the time values.
+[in] | x52 | Pointer to the device context |
[in] | dd | Day to display |
[in] | mm | Month to display |
[in] | yy | Year to display |
x52
is not valid int libx52_set_date_format | +( | +libx52_device * | +x52, | +
+ | + | libx52_date_format | +format | +
+ | ) | ++ |
Set the date format for the MFD date display.
+If not set, the date format defaults to DD-MM-YY
+[in] | x52 | Pointer to the device context |
[in] | format | libx52_date_format |
x52
is not valid int libx52_set_time | +( | +libx52_device * | +x52, | +
+ | + | uint8_t | +hour, | +
+ | + | uint8_t | +minute | +
+ | ) | ++ |
Set the hour and minute on clock 1.
+This is a raw API which can be used for manual control if the user so desires, however, it will not update the timezone or the date values.
+[in] | x52 | Pointer to the device context |
[in] | hour | Hour to display |
[in] | minute | Minute to display |
x52
is not valid
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
Handle connections to the device. +More...
++Functions | |
int | libx52_connect (libx52_device *dev) |
Connect to the X52 device. More... | |
int | libx52_disconnect (libx52_device *dev) |
Disconnect from the X52 device. More... | |
bool | libx52_is_connected (libx52_device *dev) |
Check if joystick is connected. More... | |
Handle connections to the device.
+These functions allow the application to dynamically connect and disconnect from a supported device.
+int libx52_connect | +( | +libx52_device * | +dev | ) | ++ |
Connect to the X52 device.
+Attempt to connect to a supported X52/X52Pro joystick. If no supported joysticks are found, it will return LIBX52_ERROR_NO_DEVICE. If any errors are encountered during device enumeration, it will return an appropriate libx52_error_code.
+If this function is called after it has already connected to a joystick, then it will re-enumerate the bus and ensure that it is still connected.
+[in] | dev | Pointer to the device context |
int libx52_disconnect | +( | +libx52_device * | +dev | ) | ++ |
Disconnect from the X52 device.
+This function disconnects any active connections to supported joysticks. Applications must reconnect to the joystick using libx52_connect prior to calling libx52_update.
+[in] | dev | Pointer to the device context |
bool libx52_is_connected | +( | +libx52_device * | +dev | ) | ++ |
Check if joystick is connected.
+This function reports if it is possible to try to communicate with a supported joystick. The application can communicate with the joystick, only if the following conditions are met.
+This function, however, does not check if the joystick is physically connected. A call to libx52_update or libx52_vendor_command will return an error of LIBX52_ERROR_NO_DEVICE if the joystick has either been disconnected, or libx52_connect was never called.
+[in] | dev | Pointer to the device context |
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
These functions are used at application entry and exit. +More...
++Typedefs | |
typedef struct libx52_device | libx52_device |
Device context structure used by libx52. More... | |
+Functions | |
int | libx52_init (libx52_device **dev) |
Initialize the X52 library. More... | |
void | libx52_exit (libx52_device *dev) |
Exit the library and free up any resources used. More... | |
These functions are used at application entry and exit.
+typedef struct libx52_device libx52_device | +
Device context structure used by libx52.
+All libx52 API functions require the application to pass in a pointer to a valid device context structure. A pointer can be obtained by calling libx52_init
+ +void libx52_exit | +( | +libx52_device * | +dev | ) | ++ |
Exit the library and free up any resources used.
+This function releases any resources allocated by libx52_init and terminates the library. Using the freed device now is invalid and can cause errors.
+[in] | dev | Pointer to the device context |
int libx52_init | +( | +libx52_device ** | +dev | ) | ++ |
Initialize the X52 library.
+This function initializes the libx52 library, sets up any internal data structures to access the joystick, and returns a libx52_device pointer in the output parameter. All calls to libx52 use the returned pointer to control the device.
+[out] | dev | Pointer to a libx52_device *. This function will allocate a device context and return the pointer to the device context in this variable. |
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
Control the MFD text and LED states. +More...
++Enumerations | |
enum | libx52_led_id { + LIBX52_LED_FIRE = 0x01, +LIBX52_LED_A = 0x02, +LIBX52_LED_B = 0x04, +LIBX52_LED_D = 0x06, + + LIBX52_LED_E = 0x08, +LIBX52_LED_T1 = 0x0a, +LIBX52_LED_T2 = 0x0c, +LIBX52_LED_T3 = 0x0e, + + LIBX52_LED_POV = 0x10, +LIBX52_LED_CLUTCH = 0x12, +LIBX52_LED_THROTTLE = 0x14 + + } |
Supported LED identifiers. More... | |
enum | libx52_led_state { + LIBX52_LED_STATE_OFF, +LIBX52_LED_STATE_ON, +LIBX52_LED_STATE_RED, +LIBX52_LED_STATE_AMBER, + + LIBX52_LED_STATE_GREEN + + } |
Supported LED states. More... | |
+Functions | |
int | libx52_set_text (libx52_device *x52, uint8_t line, const char *text, uint8_t length) |
Set the text on an MFD line. More... | |
int | libx52_set_led_state (libx52_device *x52, libx52_led_id led, libx52_led_state state) |
Set the LED state. More... | |
int | libx52_set_brightness (libx52_device *x52, uint8_t mfd, uint16_t brightness) |
Set the MFD or LED brightness. More... | |
int | libx52_set_shift (libx52_device *x52, uint8_t state) |
Set the state of the shift indicator. More... | |
int | libx52_set_blink (libx52_device *x52, uint8_t state) |
Set the blinking state. More... | |
Control the MFD text and LED states.
+enum libx52_led_id | +
Supported LED identifiers.
+enum libx52_led_state | +
Supported LED states.
+Not all LEDs support all states
+int libx52_set_blink | +( | +libx52_device * | +x52, | +
+ | + | uint8_t | +state | +
+ | ) | ++ |
Set the blinking state.
+The X52 Pro has a "blink" state where it blinks the clutch and hat LEDs.
+[in] | x52 | Pointer to the device context |
[in] | state | 0 for off, 1 for on |
x52
is not valid int libx52_set_brightness | +( | +libx52_device * | +x52, | +
+ | + | uint8_t | +mfd, | +
+ | + | uint16_t | +brightness | +
+ | ) | ++ |
Set the MFD or LED brightness.
+The brightness of the MFD display and the button LEDs can be controlled individually. brightness
should be a value between 0 and 128. While the library does not fail on values higher than 128, the effect may not be what is intended.
[in] | x52 | Pointer to the device context |
[in] | mfd | 0 for LED brightness, 1 for MFD brightness |
[in] | brightness | Brightness level to set |
x52
is not valid int libx52_set_led_state | +( | +libx52_device * | +x52, | +
+ | + | libx52_led_id | +led, | +
+ | + | libx52_led_state | +state | +
+ | ) | ++ |
Set the LED state.
+The X52 pro has several LEDs that can be individually controlled. This function allows you to set the state of each LED in the internal data structures.
+Note that the LEDs referred to by LIBX52_LED_FIRE and LIBX52_LED_THROTTLE support only the states LIBX52_LED_STATE_OFF and LIBX52_LED_STATE_ON. The remaining LEDs support all the states with the exception of LIBX52_LED_STATE_ON.
+[in] | x52 | Pointer to the device context |
[in] | led | LED identifier (refer libx52_led_id) |
[in] | state | State of the LED (refer libx52_led_state) |
x52
parameter is not validled
and state
combination is not a supported one. The API also returns LIBX52_ERROR_NOT_SUPPORTED if the probed joystick is not an X52 Pro, but the non-Pro X52 variant. int libx52_set_shift | +( | +libx52_device * | +x52, | +
+ | + | uint8_t | +state | +
+ | ) | ++ |
Set the state of the shift indicator.
+The X52 Pro MFD has a single shift indicator that indicates when the "shift" button is pressed.
+[in] | x52 | Pointer to the device context |
[in] | state | 0 for off, 1 for on |
x52
is not valid int libx52_set_text | +( | +libx52_device * | +x52, | +
+ | + | uint8_t | +line, | +
+ | + | const char * | +text, | +
+ | + | uint8_t | +length | +
+ | ) | ++ |
Set the text on an MFD line.
+The Multifunction display (MFD) supports 3 lines of up to 16 characters. This function will set the text into the internal data structures.
+text
must be a pointer to an array of bytes, each byte represents a code point on the MFD's internal character map. length
is the length of this array.
line
must be 0, 1, or 2 and refers to the first, second or third line of the MFD respectively.
[in] | x52 | Pointer to the device context |
[in] | line | Line to be updated (0, 1 or 2) |
[in] | text | Pointer to the text string. The text must be mapped to the code page of the X52 display. |
[in] | length | Length of the text to display |
x52
is invalid, or line
is outside the accepted range.
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
Miscellaneous functionality. +More...
++Enumerations | |
enum | libx52_error_code { + LIBX52_SUCCESS = 0, +LIBX52_ERROR_INIT_FAILURE, +LIBX52_ERROR_OUT_OF_MEMORY, +LIBX52_ERROR_INVALID_PARAM, + + LIBX52_ERROR_NOT_SUPPORTED, +LIBX52_ERROR_TRY_AGAIN, +LIBX52_ERROR_OUT_OF_RANGE, +LIBX52_ERROR_USB_FAILURE, + + LIBX52_ERROR_IO, +LIBX52_ERROR_PERM, +LIBX52_ERROR_NO_DEVICE, +LIBX52_ERROR_NOT_FOUND, + + LIBX52_ERROR_BUSY, +LIBX52_ERROR_TIMEOUT, +LIBX52_ERROR_OVERFLOW, +LIBX52_ERROR_PIPE, + + LIBX52_ERROR_INTERRUPTED + + } |
LibX52 Error codes. More... | |
enum | libx52_feature { LIBX52_FEATURE_LED + } |
Feature support for libx52. More... | |
+Functions | |
int | libx52_update (libx52_device *x52) |
Update the X52. More... | |
int | libx52_vendor_command (libx52_device *x52, uint16_t index, uint16_t value) |
Write a raw vendor control packet. More... | |
int | libx52_check_feature (libx52_device *x52, libx52_feature feature) |
Check if the device supports the given feature. More... | |
const char * | libx52_strerror (libx52_error_code error) |
Return a string representation of the error code. More... | |
Miscellaneous functionality.
+enum libx52_error_code | +
LibX52 Error codes.
+Error codes returned by libx52
+enum libx52_feature | +
Feature support for libx52.
+Each flag is passed to libx52_check_feature to determine if the connected device has the given feature. This list of features is only limited to those which differ between the supported devices.
+Enumerator | |
---|---|
LIBX52_FEATURE_LED | Individual LED control + |
int libx52_check_feature | +( | +libx52_device * | +x52, | +
+ | + | libx52_feature | +feature | +
+ | ) | ++ |
Check if the device supports the given feature.
+This will check if the connected device supports the requested feature. It will return LIBX52_SUCCESS if it does support it, LIBX52_ERROR_NOT_SUPPORTED if it does not, and another libx52_error_code on errors.
+[in] | x52 | Pointer to the device context |
[in] | feature | Feature identifier (libx52_feature) |
const char* libx52_strerror | +( | +libx52_error_code | +error | ) | ++ |
Return a string representation of the error code.
+[in] | error | Error code returned by libx52 function |
int libx52_update | +( | +libx52_device * | +x52 | ) | ++ |
Update the X52.
+All the libx52_set functions only set the internal data structures, but do not actually write anything to the joystick. This function writes the saved data to the joystick and updates the internal data structures as necessary.
+[in] | x52 | Pointer to the device context |
int libx52_vendor_command | +( | +libx52_device * | +x52, | +
+ | + | uint16_t | +index, | +
+ | + | uint16_t | +value | +
+ | ) | ++ |
Write a raw vendor control packet.
+This function sends the control packet immediately to the hardware, without having to wait for a call to libx52_update.
+This can be used to debug issues seen on the hardware, however, it is NOT recommended for use by end users, as it can potentially damage the hardware.
+[in] | x52 | Pointer to the device context |
[in] | index | wIndex in the USB packet |
[in] | value | wValue in the USB packet |
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
These functions simplify some of the data handling for MFD & LED control. +More...
++Functions | |
int | libx52util_convert_utf8_string (const uint8_t *input, uint8_t *output, size_t *len) |
Convert UTF8 string to X52 character map. More... | |
These functions simplify some of the data handling for MFD & LED control.
+int libx52util_convert_utf8_string | +( | +const uint8_t * | +input, | +
+ | + | uint8_t * | +output, | +
+ | + | size_t * | +len | +
+ | ) | ++ |
Convert UTF8 string to X52 character map.
+This function takes in a UTF-8 string and converts it to the character map used by the X52Pro MFD. Unrecognized characters are silently dropped.
+[in] | input | Input string in UTF-8. Must be NUL-terminated |
[out] | output | Output buffer |
[in,out] | len | Length of output buffer |
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
libx52 is an open source library that allows you to communicate with a Saitek X52 or Saitek X52Pro joystick on Linux and Unix machines. Saitek only provides Windows drivers for their joysticks, necessitating the need for this project for users to be able to control the LEDs and MFD text on a Linux or Unix device.
+This documentation is intended for application developers who wish to use the features of this library to communicate with supported devices.
+See the Integration page for details on how to integrate libx52 with your application.
+libx52 supports setting the following parameters on the joystick
+See the documentation for the following files for a complete list of all functions.
+
+ x52pro-linux
+ 0.2.1
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
Functions, structures and enumerations for the Saitek X52 MFD & LED driver library. +More...
+ +Go to the source code of this file.
++Typedefs | |
typedef struct libx52_device | libx52_device |
Device context structure used by libx52. More... | |
+Functions | |
int | libx52_init (libx52_device **dev) |
Initialize the X52 library. More... | |
void | libx52_exit (libx52_device *dev) |
Exit the library and free up any resources used. More... | |
int | libx52_connect (libx52_device *dev) |
Connect to the X52 device. More... | |
int | libx52_disconnect (libx52_device *dev) |
Disconnect from the X52 device. More... | |
bool | libx52_is_connected (libx52_device *dev) |
Check if joystick is connected. More... | |
int | libx52_set_text (libx52_device *x52, uint8_t line, const char *text, uint8_t length) |
Set the text on an MFD line. More... | |
int | libx52_set_led_state (libx52_device *x52, libx52_led_id led, libx52_led_state state) |
Set the LED state. More... | |
int | libx52_set_clock (libx52_device *x52, time_t time, int local) |
Set the clock. More... | |
int | libx52_set_clock_timezone (libx52_device *x52, libx52_clock_id clock, int offset) |
Set the timezone for the secondary and tertiary clocks. More... | |
int | libx52_set_clock_format (libx52_device *x52, libx52_clock_id clock, libx52_clock_format format) |
Set whether the clock is displayed in 12 hour or 24 hour format. More... | |
int | libx52_set_time (libx52_device *x52, uint8_t hour, uint8_t minute) |
Set the hour and minute on clock 1. More... | |
int | libx52_set_date (libx52_device *x52, uint8_t dd, uint8_t mm, uint8_t yy) |
Set the date. More... | |
int | libx52_set_date_format (libx52_device *x52, libx52_date_format format) |
Set the date format for the MFD date display. More... | |
int | libx52_set_brightness (libx52_device *x52, uint8_t mfd, uint16_t brightness) |
Set the MFD or LED brightness. More... | |
int | libx52_set_shift (libx52_device *x52, uint8_t state) |
Set the state of the shift indicator. More... | |
int | libx52_set_blink (libx52_device *x52, uint8_t state) |
Set the blinking state. More... | |
int | libx52_update (libx52_device *x52) |
Update the X52. More... | |
int | libx52_vendor_command (libx52_device *x52, uint16_t index, uint16_t value) |
Write a raw vendor control packet. More... | |
int | libx52_check_feature (libx52_device *x52, libx52_feature feature) |
Check if the device supports the given feature. More... | |
const char * | libx52_strerror (libx52_error_code error) |
Return a string representation of the error code. More... | |
Functions, structures and enumerations for the Saitek X52 MFD & LED driver library.
+This file contains the type, enum and function prototypes for the Saitek X52 driver library. These functions allow an application to connect to a supported X52/X52Pro joystick and control the MFD and LEDs.
+ +