Shop OBEX P1 Docs P2 Docs Learn Events
P2 USB Host driver (re-)development thread - Page 4 — Parallax Forums

P2 USB Host driver (re-)development thread

1246715

Comments

  • @pik33 said:
    This is the mouse alone (endless debug reports)

    Okay, fails at SetIdle. I think there was an issue like that before (like, way before, when building the initial gamepad driver), maybe I'll just make it ignore errors on that one.

  • Yea, that was a thing, we don't even do SetIdle on gamepads currently.

    @pik33 try this one

  • pik33pik33 Posts: 2,383

    Reset without anything on usb, plugged in kbd+mouse. Kbd works

    ( Entering terminal mode.  Press Ctrl-] or Ctrl-Z to exit. )                    
    Cog0  INIT $0000_0000 $0000_0000 load                                           
    Cog0  INIT $0000_0404 $0000_0000 load                                           
    Cog1  INIT $0000_35CC $0000_6F94 load                                           
    Cog2  INIT $0000_473C $0000_0000 load                                           
    Cog2  hdev_port = 0, #hdev_id = $05E3_0610, $0000_0000, $0000_0000, $0000_0000, 
    $0000_0000, hdev_bcd = $3298                                                    
    Cog2  hconfig_base = $09, $02, $19, $00, $01, $01, $00, $E0, $32, $09, $04, $00,
     $00, $01, $09, $00, $00, $00, $07, $05, $81, $03, $01, $00, $FF                
    Cog2  hdev_intf_idx = 0, hdev_class = $09, hdev_subclass = $00, hdev_protocol = 
    $00                                                                             
    Cog2  hhub_ctrl_ep = $0060_08E1, hhub_ep_addr = $00D0_8800                      
    Cog2  hub_descr_p = $09, $29, $04, $E0, $00, $32, $64, $00, $FF                 
    Cog2  hdev_type = $0000_0009, (hdev_type + 1) = $0000_0000                      
    Cog2  hub_status_chg = %11100000_10110010_11000000_00010010                     
    Cog2  hdev_port = 1, hub_port_status = %00000000_00000001_00000011_00000001     
    Cog2  hdev_port = 1, #hdev_id = $05E3_0610, $04D9_0006, $0000_0000, $0000_0000, 
    $0000_0000, hdev_bcd = $0150                                                    
    Cog2  hconfig_base = $09, $02, $3B, $00, $02, $01, $00, $A0, $32, $09, $04, $00,
     $00, $01, $03, $01, $01, $00, $09, $21, $11, $01, $00, $01, $22, $41, $00, $07,
     $05, $81, $03, $08, $00, $0A, $09, $04, $01, $00, $01, $03, $00, $00, $00, $09,
     $21, $11, $01, $00, $01, $22, $3B, $00, $07, $05, $82, $03, $05, $00, $0A      
    Cog2  hdev_intf_idx = 0, hdev_class = $03, hdev_subclass = $01, hdev_protocol = 
    $01                                                                             
    Cog2  hkbd_ep_addr = $0040_8100, hdev_ep_addr = $0000_0000, (hdev_ep_addr + 1) =
     $0000_0000, (hdev_ep_addr + 2) = $0000_0000, (hdev_ep_addr + 3) = $0000_0000, (
    hdev_ep_addr + 4) = $0000_0000, kb_in_max_pkt = 8, kb_interval = 10             
    Cog2  hdev_intf_idx = 1, hdev_class = $03, hdev_subclass = $00, hdev_protocol = 
    $00                                                                             
    Cog2  hdev_type = $0000_0309, (hdev_type + 1) = $0000_0000                      
    Cog2  hdev_port = 1, hub_port_status = %00000000_00000000_00000000_10100011     
    Cog2  hdev_port = 4, hub_port_status = %00000000_00000001_00000001_00000001     
    Cog2  hdev_port = 4, #hdev_id = $05E3_0610, $04D9_0006, $0000_0000, $0000_0000, 
    $046D_C52F, hdev_bcd = $2200                                                    
    Cog2  hconfig_base = $09, $02, $3B, $00, $02, $01, $04, $A0, $31, $09, $04, $00,
     $00, $01, $03, $01, $02, $00, $09, $21, $11, $01, $00, $01, $22, $43, $00, $07,
     $05, $81, $03, $08, $00, $02, $09, $04, $01, $00, $01, $03, $00, $00, $00, $09,
     $21, $11, $01, $00, $01, $22, $4F, $00, $07, $05, $82, $03, $14, $00, $02      
    Cog2  hdev_intf_idx = 0, hdev_class = $03, hdev_subclass = $01, hdev_protocol = 
    $02                                                                             
    Cog2  hmouse_ep_addr = $0040_8400, hdev_ep_addr = $0000_0000, (hdev_ep_addr + 1)
     = $0000_0000, (hdev_ep_addr + 2) = $0000_0000, (hdev_ep_addr + 3) = $0000_0000,
     (hdev_ep_addr + 4) = $0000_0000, kb_in_max_pkt = 8, kb_interval = 10           
    Cog2  hdev_intf_idx = 1, hdev_class = $03, hdev_subclass = $00, hdev_protocol = 
    $00                                                                             
    Cog2  passed addr check                                                         
    Cog2  pb = $6C1F, pb = $05, $01, $09, $02, $A1, $01, $09, $01, $A1, $00, $05, $0
    9, $19, $01, $29, $10, $15, $00, $25, $01, $95, $10, $75, $01, $81, $02, $05, $0
    1, $16, $01, $80, $26, $FF, $7F, $75, $10, $95, $02, $09, $30, $09, $31, $81, $0
    6, $15, $81, $25, $7F, $75, $08, $95, $01, $09, $38, $81, $06, $05, $0C, $0A, $3
    8, $02, $95, $01, $81, $06, $C0, $C0                                            
    Cog2  passed SetProtocol                                                        
    Cog2  hdev_type = $0000_0309, (hdev_type + 1) = $0000_003C                      
    Cog2  hdev_port = 4, hub_port_status = %00000000_00000000_00000000_10100011     
    
  • Is that with the newer file I just posted?

  • pik33pik33 Posts: 2,383
    edited 2023-05-07 13:05

    I hoppe yes, but let's copy it again...

    Edit: it works now. It seems I copied the file with Flexprop still opened.

  • pik33pik33 Posts: 2,383

    The debug:

    ( Entering terminal mode.  Press Ctrl-] or Ctrl-Z to exit. )                    
    Cog0  INIT $0000_0000 $0000_0000 load                                           
    Cog0  INIT $0000_0404 $0000_0000 load                                           
    Cog1  INIT $0000_35CC $0000_6F94 load                                           
    Cog2  INIT $0000_473C $0000_0000 load                                           
    Cog2  hdev_port = 0, #hdev_id = $05E3_0610, $0000_0000, $0000_0000, $0000_0000, 
    $0000_0000, hdev_bcd = $3298                                                    
    Cog2  hconfig_base = $09, $02, $19, $00, $01, $01, $00, $E0, $32, $09, $04, $00,
     $00, $01, $09, $00, $00, $00, $07, $05, $81, $03, $01, $00, $FF                
    Cog2  hdev_intf_idx = 0, hdev_class = $09, hdev_subclass = $00, hdev_protocol = 
    $00                                                                             
    Cog2  hhub_ctrl_ep = $0060_08E1, hhub_ep_addr = $00D0_8800                      
    Cog2  hub_descr_p = $09, $29, $04, $E0, $00, $32, $64, $00, $FF                 
    Cog2  hdev_type = $0000_0009, (hdev_type + 1) = $0000_0000                      
    Cog2  hub_status_chg = %11100000_10110010_11000000_00010010                     
    Cog2  hdev_port = 1, hub_port_status = %00000000_00000001_00000011_00000001     
    Cog2  hdev_port = 1, #hdev_id = $05E3_0610, $04D9_0006, $0000_0000, $0000_0000, 
    $0000_0000, hdev_bcd = $0150                                                    
    Cog2  hconfig_base = $09, $02, $3B, $00, $02, $01, $00, $A0, $32, $09, $04, $00,
     $00, $01, $03, $01, $01, $00, $09, $21, $11, $01, $00, $01, $22, $41, $00, $07,
     $05, $81, $03, $08, $00, $0A, $09, $04, $01, $00, $01, $03, $00, $00, $00, $09,
     $21, $11, $01, $00, $01, $22, $3B, $00, $07, $05, $82, $03, $05, $00, $0A      
    Cog2  hdev_intf_idx = 0, hdev_class = $03, hdev_subclass = $01, hdev_protocol = 
    $01                                                                             
    Cog2  hkbd_ep_addr = $0040_8100, hdev_ep_addr = $0000_0000, (hdev_ep_addr + 1) =
     $0000_0000, (hdev_ep_addr + 2) = $0000_0000, (hdev_ep_addr + 3) = $0000_0000, (
    hdev_ep_addr + 4) = $0000_0000, kb_in_max_pkt = 8, kb_interval = 10             
    Cog2  hdev_intf_idx = 1, hdev_class = $03, hdev_subclass = $00, hdev_protocol = 
    $00                                                                             
    Cog2  hdev_type = $0000_0309, (hdev_type + 1) = $0000_0000                      
    Cog2  hdev_port = 1, hub_port_status = %00000000_00000000_00000000_10100011     
    Cog2  hdev_port = 4, hub_port_status = %00000000_00000001_00000001_00000001     
    Cog2  hdev_port = 4, #hdev_id = $05E3_0610, $04D9_0006, $0000_0000, $0000_0000, 
    $046D_C52F, hdev_bcd = $2200                                                    
    Cog2  hconfig_base = $09, $02, $3B, $00, $02, $01, $04, $A0, $31, $09, $04, $00,
     $00, $01, $03, $01, $02, $00, $09, $21, $11, $01, $00, $01, $22, $43, $00, $07,
     $05, $81, $03, $08, $00, $02, $09, $04, $01, $00, $01, $03, $00, $00, $00, $09,
     $21, $11, $01, $00, $01, $22, $4F, $00, $07, $05, $82, $03, $14, $00, $02      
    Cog2  hdev_intf_idx = 0, hdev_class = $03, hdev_subclass = $01, hdev_protocol = 
    $02                                                                             
    Cog2  hmouse_ep_addr = $0040_8400, hdev_ep_addr = $0000_0000, (hdev_ep_addr + 1)
     = $0000_0000, (hdev_ep_addr + 2) = $0000_0000, (hdev_ep_addr + 3) = $0000_0000,
     (hdev_ep_addr + 4) = $0000_0000, kb_in_max_pkt = 8, kb_interval = 10           
    Cog2  hdev_intf_idx = 1, hdev_class = $03, hdev_subclass = $00, hdev_protocol = 
    $00                                                                             
    Cog2  passed addr check                                                         
    Cog2  pb = $6C1F, pb = $05, $01, $09, $02, $A1, $01, $09, $01, $A1, $00, $05, $0
    9, $19, $01, $29, $10, $15, $00, $25, $01, $95, $10, $75, $01, $81, $02, $05, $0
    1, $16, $01, $80, $26, $FF, $7F, $75, $10, $95, $02, $09, $30, $09, $31, $81, $0
    6, $15, $81, $25, $7F, $75, $08, $95, $01, $09, $38, $81, $06, $05, $0C, $0A, $3
    8, $02, $95, $01, $81, $06, $C0, $C0                                            
    Cog2  passed SetProtocol                                                        
    Cog2  hdev_type = $0000_0309, (hdev_type + 1) = $0000_003C                      
    Cog2  hdev_port = 4, hub_port_status = %00000000_00000000_00000000_10100011     
    
  • pik33pik33 Posts: 2,383

    As it works now, I can replace my RPi contraption with the USB accessory board and add the driver to the Prop2play :) Much simpler solution.

  • Mind that there currently isn't a nice interface to the keyboard. Currently you can only check the momentary status of keys. Still need to implement a key queue. That, as mentioned, will be scancodes-only. Simple US layout to ASCII conversion can be implemented in high-level code with a few lines, so no big deal. More complex layouts with more layers, deadkeys, non-ASCII characters, etc should be implemented in high-level code.

    Also, the API particulars may still change, in general.

  • pik33pik33 Posts: 2,383

    A scancode queue is enough. We need press and release info in the queue - old style 8th bit? My Raspberry inteface uses MIDI style - key on, key off, modifier on, modifier off.

  • Wuerfel_21Wuerfel_21 Posts: 5,105
    edited 2023-05-07 14:08

    Okay, I've added a first version of the scancode queue. You need to set its size by constant override of KEYQUEUE_SIZE to enable it and then call get_key. Current format is as follows:

    • bit 0..7 is the scancode. The object defines a bunch of KEY_ constants that match these. Modifiers also generate their scancodes!
    • bit 8..15 is the current modifiers as in the USB report (left ctrl, left shift, left alt, left meta, right ctrl, right shift, right alt, right meta)
    • bit 16..30 are unused (should put caps/num/scroll lock state here when I add it)
    • bit 31 is press/release

    You get zero when the buffer is empty.

    I've also added this to the hidpad example.

  • There was a fairly simple Propeller1 object API for the older (PS/2) keyboards. Perhaps an API or wrapper layer could emulate that interface if it is still useful for Prop2's and if it maps cleanly to the USB keyboard variants. If it doesn't then designing another one makes sense.

  • pik33pik33 Posts: 2,383

    @Wuerfel_21 said:
    Okay, I've added a first version of the scancode queue. You need to set its size by constant override of KEYQUEUE_SIZE to enable it and then call get_key. Current format is as follows:

    • bit 0..7 is the scancode. The object defines a bunch of KEY_ constants that match these. Modifiers also generate their scancodes!
    • bit 8..15 is the current modifiers as in the USB report (left ctrl, left shift, left alt, left meta, right ctrl, right shift, right alt, right meta)
    • bit 16..30 are unused (should put caps/num/scroll lock state here when I add it)
    • bit 31 is press/release

    You get zero when the buffer is empty.

    I've also added this to the hidpad example.

    :)

  • @rogloh said:
    There was a fairly simple Propeller1 object API for the older (PS/2) keyboards. Perhaps an API or wrapper layer could emulate that interface if it is still useful for Prop2's and if it maps cleanly to the USB keyboard variants. If it doesn't then designing another one makes sense.

    You could probably make a wrapper to that extent, yea. The P1 PS/2 object does perform ASCII conversion (but weirdly where the special keys are mapped to strange characters) and uses different scancodes, etc etc. The biggest API difference is that it doesn't give you key break events. Might need to add a function to the USB driver that gets the next event without consuming it to make that fully wrappable.

  • I've just pushed a change to remove gamepad-related bloat when neither the HIDPad nor EmuPad interface is enabled. It's not mega thorough, but it saves ~1.9k RAM. Maybe not for long though, the mouse might need to share some of the HID-related code when I make it properly parse the reports.

  • pik33pik33 Posts: 2,383
    edited 2023-05-07 19:00

    I tried this cursed wireless gamepad. Of course it doesn't work. When connected standalone, it returns this:

    When connected via the hub, the result is too long for the forum post and the driver needs resetting.

    Edit: I tried this with debug disabled. The pad doesn't hang the driver in this mode. Hanging is caused by the pad+debug enabled at default 200 kbps. 2Mbps helped...

    The result is interesting: first, the pad data that seems to be correct appears on the screen. Then the pad field goes gray for a second and then it is white again, but displaying garbage and doesn't respond to any pad movement. The keyboard and mouse still work with the pad attached.

  • Wuerfel_21Wuerfel_21 Posts: 5,105
    edited 2023-05-07 18:58

    May just really be cursed, just like my 8bitdo pad.

    In other news, I've fixed a possible race condition with the keyboard state buffer (i.e. trying to check key while the driver is re-writing the report leading to false negative). I didn't actually observe this happening, but in theory it was possible. (and it still is possible if you access the keyboard buffer byte-wise. The correct way is to burst-read the entire thing at once)

  • pik33pik33 Posts: 2,383
    edited 2023-05-07 19:05

    This is the proper debug report from the pad.

    Edit: and yes, it works immediately after connecting.... One, two second, it react to movement and gives the proper numbers... until it decides to go gray and return in non working state

    Cog2  hub_status_chg = %00000000_01110011_01000001_00010000                     
    Cog2  hdev_port = 4, hub_port_status = %00000000_00000001_00000001_00000001     
    Cog2  hdev_port = 4, #hdev_id = $05E3_0610, $04D9_0006, $046D_C52F, $0000_0000, 
    $0079_0126, hdev_bcd = $1003                                                    
    Cog2  hconfig_base = $09, $02, $29, $00, $01, $01, $00, $80, $FA, $09, $04, $00,
     $00, $02, $03, $00, $00, $00, $09, $21, $11, $01, $00, $01, $22, $89, $00, $07,
     $05, $81, $03, $40, $00, $0A, $07, $05, $02, $03, $40, $00, $0A                
    Cog2  hdev_intf_idx = 0, hdev_class = $03, hdev_subclass = $00, hdev_protocol = 
    $00                                                                             
    Cog2  hdev_ep_addr = $0000_0000, (hdev_ep_addr + 1) = $0000_0000, (hdev_ep_addr 
    + 2) = $0000_0000, (hdev_ep_addr + 3) = $0000_0000, (hdev_ep_addr + 4) = $0040_8
    400, gp_interval = 10, hdev_out_addr = $0001_0400                               
    Cog2  pb = $6C07, pb = $05, $01, $09, $05, $A1, $01, $15, $00, $25, $01, $35, $0
    0, $45, $01, $75, $01, $95, $0D, $05, $09, $19, $01, $29, $0D, $81, $02, $95, $0
    3, $81, $01, $05, $01, $25, $07, $46, $3B, $01, $75, $04, $95, $01, $65, $14, $0
    9, $39, $81, $42, $65, $00, $95, $01, $81, $01, $26, $FF, $00, $46, $FF, $00, $0
    9, $30, $09, $31, $09, $32, $09, $35, $75, $08, $95, $04, $81, $02, $06, $00, $F
    F, $09, $20, $09, $21, $09, $22, $09, $23, $09, $24, $09, $25, $09, $26, $09, $2
    7, $09, $28, $09, $29, $09, $2A, $09, $2B, $95, $0C, $81, $02, $0A, $21, $26, $9
    5, $08, $B1, $02, $0A, $21, $26, $91, $02, $26, $FF, $03, $46, $FF, $03, $09, $2
    C, $09, $2D, $09, $2E, $09, $2F, $75, $10, $95, $04, $81, $02, $C0              
    Cog2  hdev_type = $0004_0309, (hdev_type + 1) = $0000_0006                      
    Cog2  hdev_port = 4, hub_port_status = %00000000_00000000_00000000_10100011     
    Cog2  hub_status_chg = %10000000_01110011_01000001_00010000                     
    Cog2  hdev_port = 4, hub_port_status = %00000000_00000001_00000001_00000000     
    Cog2  hdev_port = 4, hub_port_status = %00000000_00000000_00000001_00000000     
    Cog2  hub_status_chg = %00000000_01110011_01000001_00010000                     
    Cog2  hdev_port = 4, hub_port_status = %00000000_00000001_00000001_00000001     
    Cog2  hdev_port = 4, #hdev_id = $05E3_0610, $04D9_0006, $046D_C52F, $0000_0000, 
    $0079_181C, hdev_bcd = $1003                                                    
    Cog2  hconfig_base = $09, $02, $42, $00, $02, $01, $00, $80, $FA, $09, $04, $00,
     $00, $02, $03, $00, $00, $00, $09, $21, $11, $01, $00, $01, $22, $7B, $00, $07,
     $05, $81, $03, $40, $00, $0A, $07, $05, $02, $03, $40, $00, $0A, $09, $04, $01,
     $00, $01, $03, $00, $00, $00, $09, $21, $11, $01, $00, $01, $22, $65, $00, $07,
     $05, $83, $03, $40, $00, $0A                                                   
    Cog2  hdev_intf_idx = 0, hdev_class = $03, hdev_subclass = $00, hdev_protocol = 
    $00                                                                             
    Cog2  hdev_ep_addr = $0000_0000, (hdev_ep_addr + 1) = $0000_0000, (hdev_ep_addr 
    + 2) = $0000_0000, (hdev_ep_addr + 3) = $0000_0000, (hdev_ep_addr + 4) = $0040_8
    400, gp_interval = 10, hdev_out_addr = $0001_0400                               
    Cog2  hdev_intf_idx = 1, hdev_class = $03, hdev_subclass = $00, hdev_protocol = 
    $00                                                                             
    Cog2  hdev_ep_addr = $0000_0000, (hdev_ep_addr + 1) = $0000_0000, (hdev_ep_addr 
    + 2) = $0000_0000, (hdev_ep_addr + 3) = $0000_0000, (hdev_ep_addr + 4) = $0041_8
    400, gp_interval = 10, hdev_out_addr = $0000_0000                               
    Cog2  pb = $6C07, pb = $05, $01, $09, $05, $A1, $01, $15, $00, $25, $01, $35, $0
    0, $45, $01, $75, $01, $95, $0F, $05, $09, $19, $01, $29, $0F, $81, $02, $95, $0
    1, $81, $01, $05, $01, $25, $07, $46, $3B, $01, $75, $04, $95, $01, $65, $14, $0
    9, $39, $81, $42, $65, $00, $95, $01, $81, $01, $26, $FF, $00, $46, $FF, $00, $0
    9, $30, $09, $31, $09, $32, $09, $35, $75, $08, $95, $04, $81, $02, $05, $02, $1
    5, $00, $26, $FF, $00, $09, $C4, $09, $C5, $95, $02, $75, $08, $81, $02, $05, $0
    8, $09, $43, $15, $00, $26, $FF, $00, $35, $00, $46, $FF, $00, $75, $08, $95, $0
    1, $91, $82, $09, $44, $91, $82, $09, $45, $91, $82, $09, $46, $91, $82, $C0    
    Cog2  hdev_type = $0004_0309, (hdev_type + 1) = $0000_0006                      
    Cog2  hdev_port = 4, hub_port_status = %00000000_00000000_00000000_10100011   
    
  • Wuerfel_21Wuerfel_21 Posts: 5,105
    edited 2023-05-07 19:11

    Yea, it changes up its descriptors. That sounds like the same weird auto-detect routine that my 8bitdo pad does, though that one does never ever return valid data (but does respond to XInput rumble/LED control messages when it gets stuck in XInput mode). Wonder what message these are expecting from a PC that we're not sending?

    The second descriptor looks very normal, so either the data coming out is bad or something weird happens to the driver itself.

  • pik33pik33 Posts: 2,383
    edited 2023-05-07 19:19

    There is a sign of life. The driver reacts to the button called "analog": Y and Z values blink. Is there a way to simply dump the raw reports somewhere?

  • Wuerfel_21Wuerfel_21 Posts: 5,105
    edited 2023-05-07 19:28

    @pik33 said:
    There is a sign of life. The driver reacts to the button called "analog": Y and Z values blink. Is there a way to simply dump the raw reports somewhere?

    The "analog" button usually switches the stick and dpad to deal with old PC games that want to pull digital directions from the X/Y axis (why this couldn't be fixed in software, idk). If the values react to the analog switch but not the actual inputs, that means the controller itself must have gotten into a bad state where it doesn't properly read the inputs.

    Right now there is no way to read the raw reports, since they all share a buffer and get overwritten when the next device is polled. However, I have attached a hacked version that prints it to DEBUG. Might not work right due to timing issues.


    Maybe I should start a list of which game input devices which work and which don't, so people know what to buy / not buy. Well, half the ones I have are old and discontinued, but oh well.

    I think most controllers marketed specifically towards Nintendo Switch usage will work? My sample size is 1... Maybe I should buy the actual 1st party Pro Controller to test with, would be nice to have for the actual Nintendo, too.

  • pik33pik33 Posts: 2,383

    Before going bad:

    Cog2 hdev_port = 3 RAW REPORT: urx_buff_p = $00, $00, $0F, $80, $80, $80, $80,
    $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $02, $00, $02,
    $00, $02, $00, $02

    After going bad:

    Cog2 hdev_port = 3 RAW REPORT: urx_buff_p = $02, $00, $00, $00

    4 bytes only.

  • That's why it's sad I guess

  • I started filling out the aforementioned compatibility list: https://github.com/Wuerfel21/usbnew/wiki

  • pik33pik33 Posts: 2,383

    Works only 2 seconds after connecting, then stops working: Vakoss wireless gamepad model no GP-3925BK, VID=0x0079 PID=0x181C

  • jmgjmg Posts: 15,175

    @Wuerfel_21 said:
    Okay, I've added a first version of the scancode queue. You need to set its size by constant override of KEYQUEUE_SIZE to enable it and then call get_key. Current format is as follows:

    • bit 0..7 is the scancode. The object defines a bunch of KEY_ constants that match these. Modifiers also generate their scancodes!
    • bit 8..15 is the current modifiers as in the USB report (left ctrl, left shift, left alt, left meta, right ctrl, right shift, right alt, right meta)
    • bit 16..30 are unused (should put caps/num/scroll lock state here when I add it)
    • bit 31 is press/release

    You get zero when the buffer is empty.

    I've also added this to the hidpad example.

    This is impressive work.
    Maybe the thread title could be edited slightly to be ( as there is now P2 USB device work )

    P2 USB Host driver (re-)development thread

    Yes, It is in the P2 sub-forum, but adding P2 to the title helps google find things ?

  • jmgjmg Posts: 15,175

    @rogloh said:
    ... Hopefully by the end of it all we'll have a Keyboard,Mouse and 2 USB controllers working together from a 4 port hub. That would be ideal for me anyway.

    and one day later ...

    @rogloh said:
    @Wuerfel_21 Just tried your latest code, and I have **2 USB gamepads, a mouse and a keyboard all fitted to a 4 port USB hub and each reporting nicely **running hidpad_to_vga.spin2. Nice work :smiley:

    Impressive stack-up that is supported.

  • Wuerfel_21Wuerfel_21 Posts: 5,105
    edited 2023-05-07 22:47

    I think I went through all the game controller shaped e-waste that's lying around my basement now: https://github.com/Wuerfel21/usbnew/wiki

    If you want to acquire a usbnew (is that what I'm calling it?) compatible controller, do peruse the "works great" list.

    If anyone has any other reports, please send me:
    - Name / Model number
    - VID/PID (visible in the HIDpad test)
    - (if not broken) Which button number is which physical button (so I can write a PADMAP rule on the wiki)

  • I've also written up the PADMAP information on the wiki, alongside enlightening rationale behind using terms like "north face button", featuring mspaint fingies: https://github.com/Wuerfel21/usbnew/wiki/PADMAP.TXT-Format-and-the-reference-gamepad

    Is the simplified format description at the top enough?

  • Working game controllers I have tested with usbnew.

    • PS3 DualShock3 controller - already reported
      ID=054C0268
      All buttons, sticks & HAT reporting. Right analog Joystick Up and Down both reported in Z-AXIS?

    • Generic USB game controller (SNES style) works well, all buttons.
      ID=081FE401

    • Generic control board marketed as "Zero Delay Arcade USB encoder" or "ARC Controller" etc works well
      ID=00790006

Sign In or Register to comment.