P2 USB Host driver (re-)development thread
So, as mentioned elsewhere, I'm looking to revamp the current USB driver landscape a bit, since it's a major pain point right now.
So far I'm trying to work off @macca 's hub-supporting P2ASM-only version.
Goals so far (in order of importance):
- Improve stability and device support
- Implement "EmuPad" interface for Keyboard/gamepad similar to what my emulator programs currently use (input data gets placed in user-provided location with button remapping already applied). Allow dynamic loading of mappings.
- Implement low-level interface for Spin applications (query device presence and raw report)
- Allow compile-time configuration to disable un-needed components
- Allow polling to be synchronized to external event (COGATN) for consistent input latency.
- Re-implement functionality lost in macca's version (Keyboard LEDs and mouse)
- Implement high-level interface for Spin applications
Current device support issues I am aware of:
- Hotplugging some devices seems to hang the driver until disconnect (flashing error LED). This even more so if the plugging is happening on a hub port. Maybe just power-cycle the bus in such cases.
- PS/2 adapter doesn't work through hub (LED flash) (UPDATE: Fixed!)
- Weird poll rate / NAK issue with NeoGeo mini controller (might magically disappear again) (UPDATE: yes seems to disappear without debugger loaded)
- 8bitdo SN30pro still doesn't correctly initialize (bus analyzer action required)