libx52
0.3.2
Saitek X52/X52Pro drivers for Linux/Unix
|
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.