The application has to start another transfer. When the target interrupt Endpoint returns NAK, this host stack successfully completes the transfer with zero length data. The application state machine (DemoState) on the main.c is modified, so that it repeats IN transactions one after another, on the EP1.īYTE receiveBuf // I'm reading from the IN endpoint successfully but I'm constantly reading back zero bytes of data. You may leave this definition as is, while you are playing just on the interrupt IN endpoint. The packets come to the interrupt IN 1 endpoint,Īs the default, this example reads/writes IN/OUT endpoint of endpoint 1.
You have to confirm the packet format, first, by monitoring the returned packets while you are fiddling the buttons / joysticks / hat switch on the controller.
Both devices have the same extra "HID class" descriptor.īut it doesn’t always mean this model would put the same packet format as MS one. The outline of configuration set is almost similar. Now that the example enumerates your gamepad.Ĭ) Modification of the example - packet monitorĪs you said, this device is similar to MS Xbox game controller (old one: VID/PID = 045E/0202) in these features, DevID.vid = 0x04D8 // Microchip Custom DemoĭevID.vid = 0x046D // Logitech F310 Gamepad Try to get the device address, if we don't have one.
> interface class triad =, // Logitech F310 Gamepad The same descriptors as yours were read out from this model, VID/PID = 0x046D/0xC21D : Logitech F310 Gamepad
#Generic driver for usb gamepad full version#
Here is a full version of above split comments. OK, now that the taboo word (UART2_P_u_t_C_h_a_r) was specified. I now understand that I have to request the HID Report but calling the Microchip Host Stack function: uint8_t USBHostIssueDeviceRequest(uint8_t deviceAddress, uint8_t bmRequestType, uint8_tīRequest, uint16_t wValue, uint16_t wIndex, uint16_t wLength, uint8_t * data, uint8_tĭataDirection, uint8_t clientDriverID) I just have to work out the correct parameters for the call. My understanding is that the device works as a HID type device even if it doesn't set all the values in the descriptors to advertise itself as a HID device. I'm only getting to grips with USB and possibly I'm working with the wrong device but it's what I have and what I want to get working.
#Generic driver for usb gamepad windows#
"USB Complete: The Developer's Guide" by Jan Axelson has been great, but deals with working on Windows Drivers. I'm reading as much as I can get my hands on. Sorry about that, I kinda felt I was hitting fresh problems, but yet it's all to do with the game controller.