1 unstable release

0.1.0 Apr 8, 2021

#1167 in Hardware support

MIT/Apache

31KB
591 lines

VCS Classic HID

Latest Version dependency status

A specialized library for access to the Atari VCS Classic Controller.

This crate uses hidapi for finding connected VCS classic controllers and opening HID access to them. With this crate, an assortment of facilities are provided for reading the current state of the device and, more importantly, send force feedback and LED manipulation messages.

Building

To build just this package:

cargo build --release -p vcs-classic-hid 

Using

To light up all LEDs in the controller's ring to the maximum:

let mut device = vcs_classic_hid::open()?;
device.send(vcs_classic_hid::LedReport::filled(0xFF))?;

Apply some force feedback three times:

let mut device = vcs_classic_hid::open()?;
device.send(vcs_classic_hid::FfReport::new_with_params(
    0xA0, 30, 30, 3
))?;

Please see the crate documentation for more details.

Cargo features:

  • linux-hidraw (Linux only): use HIDRAW to access the controller, recommended
  • linux-libusb (Linux only): access the controller via libusb

License and Warning Note

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

This work is not affiliated with Atari.

As the software and firmware of the Atari VCS system is practically still in beta, it is unclear whether there are, or will be, any side effects from the prolonged use of operations to the classic controller, be it via this library or others. Although vcs-classic-hid was developed with the best effort from the original author to make it safe to use, it is unfeasible to make a complete assurance that it is and will always be, completely safe for the device, regardless of which capabilities from the library are used.

vcs-classic-hid is to be used at the user's own risk. As defined by the aforementioned license, authors and contributors to vcs-classic-hid and/or associated programs cannot be held liable for any damage which may occur from direct or indirect use of this software.

Dependencies

~405–800KB
~14K SLoC