chuniio-yubideck/README.md

65 lines
1.9 KiB
Markdown
Raw Normal View History

2023-12-23 20:39:58 +00:00
# chuniio-yubideck
ChuniIO driver for YubiDeck FW 3.0.
**UNTESTED!!!** Here be dragons.
Thanks to:
- [hlcm0](https://github.com/hlcm0/yubideck-io-firmware/blob/main/code/pico_yubideck_emu/report.h) and [4yn](https://github.com/4yn/slidershim/blob/main/src-slider_io/src/device/hid.rs#L257)
for YubiDeck protocol information
## Configuration
segatools.ini
```ini
[chuniio]
;; For Chunithm NEW or newer
path32=chuniio_yubideck_chusan.dll
path64=chuniio_yubideck_amdaemon.dll
;; For CHUNITHM PARADISE and older
path=chuniio_yubideck.dll
[io3]
test=0x31
service=0x32
coin=0x33
```
## USB Protocol
USB device: `1973:2001`, interface 0
- Endpoint IN Interrupt (0x81)
- Data length: 45 bytes
- `data[0]`: bits 0-5: beam 1-6 (1 = blocked)
- `data[1]`: bits 0-2 for the 3 buttons (1 = pressed)
- `data[2..34]`: pressure of touch sensor 1-32 (counting from top left)
- `data[34]`: Card type
- 0: No card
- 1: MIFARE Classic
- 2: FeliCa
- `data[35..45]`: Card IDm/Access Code
- Endpoint OUT Interrupt (0x02)
- Data length: 61 bytes
- `data[0]`: Packet type
- Packet type 1:
- `data[1..61]`: Slider LED for the first 20 sensors, RGB
- Packet type 2:
- `data[1..34]`: Slider LED for the last 11 sensors, RGB
- `data[34..37]`: Left air LED, RGB
- `data[37..40]`: Right air LED, RGB
- `data[40..43]`: Card reader LED, RGB
- `data[43..61]`: Empty padding
## Build instructions
```shell
# For CHUNITHM NEW
cargo build --features chusan --target i686-pc-windows-msvc --release
cargo build --features chusan --target x86_64-pc-windows-msvc --release
cp target/i686-pc-windows-msvc/release/chuniio_yubideck.dll chuniio_yubideck_chusan.dll
cp target/x86_64-pc-windows-msvc/release/chuniio_yubideck.dll chuniio_yubideck_amdaemon.dll
# For CHUNITHM
cargo build --target i686-pc-windows-msvc --release
cp target/i686-pc-windows-msvc/release/chuniio_yubideck.dll .
```