Skip to content

Repository files navigation

X52Pro

A macOS framework for controlling the Saitek/Logitech X52 Pro HOTAS (Hands On Throttle And Stick) flight controller.

Features

  • Control MFD (Multi-Function Display) text on all three lines
  • Set LED colors for all programmable LEDs (A, B, D, E, T1-T3, POV, Clutch)
  • Adjust MFD and LED brightness
  • Set clock time and timezone for all three clock displays
  • Enable shift indicator and LED blinking effects
  • Swift-friendly API with native Swift wrapper

Requirements

  • macOS 10.13+
  • Xcode 14+
  • Saitek/Logitech X52 Pro flight controller

Building

  1. Clone the repository with submodules:

    git clone --recursive https://github.com/yourusername/x52pro.git
  2. Open x52pro.xcworkspace in Xcode

  3. Build the X52Pro framework target

Usage

Swift

import X52Pro

// Connect to device
guard let device = X52Pro() else {
    print("X52 Pro not connected")
    return
}

// Set MFD text
device.setMFDText(line1: "Hello", line2: "World", line3: "!")
device.synchronize()

// Set LED colors
device.setLED(.a, color: .green)
device.setAllLEDs(color: .amber)
device.synchronize()

// Set brightness
device.setMFDBrightness(0.5)
device.setLEDBrightness(0.75)
device.synchronize()

// Set clock to current time
device.setClock()
device.synchronize()

Objective-C

#import <X52Pro/X52ProDevice.h>

X52ProDevice *device = [X52ProDevice connectedDevice];
if (device) {
    [device setLine1:@"Hello"];
    [device setLine2:@"World"];
    [device setLedA:kLedColorGreen];
    [device synchronize];
}

API Reference

LED Colors

Color Description
.off LED off
.red Red
.amber Amber/Orange
.green Green

Color LEDs

Multi-color LEDs that support off/red/amber/green: a, b, d, e, t1, t2, t3, pov, clutch

Single-Color LEDs

Fire and Throttle LEDs only support on/off states.

Command Line Tools

The project also builds command-line tools for testing:

  • x52cli - Command-line interface for controlling the device
  • x52test - Interactive test program

Project Structure

x52pro/
├── x52pro.xcworkspace     # Xcode workspace
├── x52pro/                # Main Xcode project
│   └── X52Pro/            # Framework source
│       ├── X52Pro.swift   # Swift wrapper
│       ├── X52ProDevice.h # Objective-C interface
│       └── X52ProDevice.m # Objective-C implementation
├── X52ProExample/         # Example SwiftUI app
├── libusb/                # libusb submodule
└── x52pro-linux/          # x52pro-linux submodule

Dependencies

This project uses the following libraries as git submodules:

Troubleshooting

App Sandbox

If your app uses App Sandbox, USB device access will be blocked. You must either:

  • Disable App Sandbox in your entitlements
  • Or run without sandboxing for USB access

Device Not Found

Ensure the X52 Pro is connected via USB and recognized by macOS. Check System Information > USB to verify the device is detected.

License

This project is licensed under the GNU General Public License v2.0 - see the LICENSE file for details.

Acknowledgments

About

A macOS framework for controlling the Saitek/Logitech X52 Pro HOTAS (Hands On Throttle And Stick) flight controller.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages