FeralAI/GP2040

Feature Request - Multiple xinput on a single board (2 or 4 players)

leecyrille opened this issue · 3 comments

Is it possible to provide 2 input devices from a single board? This would be a great option for arcade cabinets.

我已经实现了,运行在STM32F103 MCU

我已经实现了,运行在STM32F103 MCU
image

Very cool!
Can I take a look at how you managed it?
image

我可以给你双Xinput的USB配置描述符:
这组配置描述符使用端点1和端点2可以单芯片实现两个Xinput手柄。

const u8 Xbox360_Joystick_ConfigDescriptor[89] =
{

0x09, 0x02 ,0x59 ,0x00 ,0x02 ,0x01 ,0x00 ,0xC0 ,0x32 ,
	
0x09 ,0x04 ,0x00 ,0x00 ,0x02 ,0xFF ,0x5D ,0x01 ,0x00 ,
0x11 ,0x21 ,0x00 ,0x01 ,0x01 ,0x25 ,0x81/*IN1*/ ,0x14 ,0x00 ,0x00 ,0x00 ,0x00 ,0x13 ,0x01/*OUT1*/ ,0x08 ,0x00 ,0x00 ,
0x07 ,0x05 ,0x81 ,0x03 ,0x20 ,0x00 ,0x01 ,
0x07 ,0x05 ,0x01 ,0x03 ,0x20 ,0x00 ,0x08 ,

0x09 ,0x04 ,0x01 ,0x00 ,0x02 ,0xFF ,0x5D ,0x01 ,0x00 ,
0x11 ,0x21 ,0x00 ,0x01 ,0x01 ,0x25 ,0x82/*IN2*/ ,0x14 ,0x00 ,0x00 ,0x00 ,0x00 ,0x13 ,0x02/*OUT2*/ ,0x08 ,0x00 ,0x00 ,
0x07 ,0x05 ,0x82 ,0x03 ,0x20 ,0x00 ,0x01 ,
0x07 ,0x05 ,0x02 ,0x03 ,0x20 ,0x00 ,0x08 ,
	
};