1
0
mirror of https://github.com/gdsports/USBHost_t36 synced 2024-11-17 14:45:01 -05:00
Commit Graph

46 Commits

Author SHA1 Message Date
Kurt Eckhardt
a1986c3d30 Add 2nd VID:PID for XBox One
As per forum post by linarism, added 2nd XBox controller PID
2017-12-11 06:26:36 -08:00
Kurt Eckhardt
c5edb1c25f Add Xbox One controller support
While the other Joystick objects currently supported by the USB Host
code are driven by HID data, the Xbox does not contain HID data and
instead works at the top level.

To handle this I made the Joystick object use multiple InHeritence like:
class JoystickController : public USBDriver, public USBHIDInput

This allowed me to have the object work either way.  This did add some
complexity in that some of the methods like  is the object connected
(The bool operator) had to be overwritten as both of the bases classes
had it.  In addition needed to update the other query functions to be
able to grab the data from mydevice or device depending on which type of
controller was connected.

Since this looked like a valid way, I then merged the Keyboard Extras
code that Keyboard and made it also do a similar multiple inheritance.
In this case however I restricted the HID top level report handle code
to only accept it if on the same object that claimed the keyboard.

The mouse test app was updated as well
2017-11-20 09:19:25 -08:00
Kurt Eckhardt
8aa67ff939 RAWHID Support
Needed HID Parser to support Bidirectional Transfers

The HidParser code was setup such that the claim for a report, the caller could say I want to claim the whole thinig and allowed callback functions for processing of in buffer and out buffer.

Allow RawHID to contribute Transfer_t

Since RawHID may need more resources than most, maybe it should contribute the additional structures

The constructor for a RAWHID object allows you to specify the top usage
that it wishes to connect to.  I used this for example to be able to
connect to a Teensy with the RAWHID associated with emulating the
Serial object.

If a HID Input class says that it wants to claim the whole interface, I
reuse the buffer associated with holding the HID descriptor and use it
for output buffers.
2017-11-20 08:54:56 -08:00
Kurt Eckhardt
4eee8627d2 Serial cleanup - flush, timeout
As per the forum posts, worked on combining the claim code for extracting which endpoints are RX and TX and create the pipes and the like.

Also worked on live cases.  Reading and writing to AX servos... Found some issues Probably more to find.

I left in some debug code to help find cases of deleting a pipe may hang.  Also macros in serial.cpp to set or toggle IO pins (when in debug mode). This helps find where things are happing using Logic Analyzer as a way to find the approriate USB packets.
2017-11-10 16:37:12 -08:00
Kurt Eckhardt
d3e21b04c0 FIX - Keyboard LEDS
The main issue was I used a setup structure on the stack which turned into garbage.  Earlier I thought the data was copied, but it was not...

Found that fixing this resolved the earlier issue where I needed to defer the update.  So removed the defered code, plus use member variable for the one byte output instead of static variable.
2017-11-07 07:08:36 -08:00
Kurt Eckhardt
ec4a7ac24c Support for Silicon labs: CP210x
Did a quick add of support for the Slicon Labs CP210x drivers.  Did similar like messages as FTDI, based on their documents on line:
https://www.silabs.com/documents/public/application-notes/AN571.pdf
2017-11-05 16:25:59 -08:00
Kurt Eckhardt
12be685ab1 Test fixes for different parity and like
I did a quick test using the Serial test app, where I can type in lines like:
#38400,7E1
And it reopens the serial port at the specified baud and format.  Note the formats the test app looks for is 7E1, 7O1, 8N1, 8N2.

Tested on an FTDI, PL2303 and CH341.  I also tested going to Teensy 3.2 CDCACM.  But as far as I know the teensy could not care less about Baud/Format.

Unless of course there is a way to query the value and use it to set a Hardware Serial port to it.
2017-11-05 10:53:54 -08:00
Kurt Eckhardt
e2eba5c00d This commit has a few different parts. It is still a WIP
This commit adds support for at least some of the Serial boards with the
CH341 chipset, tested using a board from sparkfun as well as one from
Amazon.com

The code was rearranged some of the Claim code and added a VID:DID to Serial Type table that I use to map, such that I know some of these devices have multiple valid setups.

Support Begin/End/Begin - Change baud

Added code to support switching baud rates, or more particular be able to call end() and then call begin(...) with same or different baud rate.

Hopefully some support for also releasing DTR when the end is called.

WIP - Start support for the begin(baud, format)

Adding some support to the code to handle some of the different possible format capabilities.

In particualar trying to handle the parity, number of bits and number of stop bits.

hacked up test app, such that if you type in command line like:
"#9600, 7e1"

It will extract the 9600 as the new baud and try to use format 7e1.  I only hard coded a few of these in the test app (8n1, 7e1, 7e2, 8n2)...

Again work in progress.  Took me awhile tofigure out how to do this for ch341 boards as I did not see any documents or code that handled this.  So had to deduce it from differences in USB packets.
2017-11-04 17:54:00 -07:00
Kurt Eckhardt
704d511c81 PL2303 support
This commit should start to allow some Prolific PL2303 devices to work.
Tis device has a rather more complex initialization process than some
of the other devices.

I have tested this some with one device that I used to use to program
some older RS232 based boards plus talk to an SSC-32 device.
Test case is I am able to talk to SSC-32 and if I type in ver<cr>
It does properly return the version number.

The data I am seeing is pretty close to what
was documented in: https://gist.github.com/tommie/89011c5ac06553d5cdb8
as well as what the Linux driver outputs.

I also incorperated Frank's configuration options.
2017-10-31 11:06:12 -07:00
Kurt Eckhardt
6e1f0c379c CDCACM - Serial support
Have some support in place for the CDCACM serial class code.

It appears to be working for talking to a
Teensy that is programmed USB=Serial
or USB=Serial+...

Also test with an USB2AX board which is a Servo controller for Dynamixel servos (AX-12), that is an Atmega32u2 board programmed using LUFA as the USB library.
2017-10-27 09:35:46 -07:00
PaulStoffregen
bd5f7d9486 reorganize header file 2017-10-21 11:52:26 -07:00
PaulStoffregen
f890ec1955 AntPlus fixes
https://forum.pjrc.com/threads/43110-Ant-libarary-and-USB-driver-for-Teensy-3-5-6?p=157155&viewfull=1#post157155
2017-10-21 08:45:09 -07:00
PaulStoffregen
5c6d3c9e32 Arduino style API for AntPlus payload parsers 2017-10-21 03:34:40 -07:00
PaulStoffregen
dc1030f379 Move AntPlus parsing state from static to object scope 2017-10-21 01:59:44 -07:00
PaulStoffregen
1613316f7c Arduino style callbacks from channel status & device ID 2017-10-20 07:50:38 -07:00
PaulStoffregen
94b2decbca AntPlus polling and example (still incomplete) 2017-10-20 06:45:27 -07:00
Kurt Eckhardt
4e2ea2d96e String buffers - Devices contribute buffers
instead of having each HUB have 7 buffers, which can eat up space.  We have each main object contribute currently one string buffer, which than when we initialize a Device_t we try to allocate one for it, likewise we release it when the Device is released.

Hopefully less memory needed.

Also updated such that the HIDInput classes can not retrieve these strings.

Changed test program to now also have list of HIDInput objects and when I detect a new one, I again print out info on it...
2017-10-19 14:57:52 -07:00
PaulStoffregen
57ca257e9b AntPlus from Michael McElligott (work in progress...) 2017-10-16 06:06:51 -07:00
PaulStoffregen
f1bb020282 Fix print() & println() conflict with Arduino Print class 2017-10-15 13:11:46 -07:00
Paul Stoffregen
b82efa836e Merge pull request #6 from KurtE/Keyboard-Power_and_other_special_keys
Keyboard power and other special keys
2017-10-15 06:54:42 -07:00
PaulStoffregen
9840e82db8 FTDI transmit, improve performance for fast output 2017-10-15 06:00:53 -07:00
PaulStoffregen
5575f9fcae FTDI transmit, add partial packet output 2017-10-15 04:28:07 -07:00
PaulStoffregen
b58d4c7191 FTDI transmit, full packets only 2017-10-15 02:39:36 -07:00
Kurt Eckhardt
40cb6322ac WIP - Add Strings to device structure
Added the ability to query the
Manufactur, product name and serial number strings from a device.

WIP - Eats up lots of memory, next up experiment move from Device_t object to maybe top level objects.  Probably fewer than them as each hub allocates something like 7 Device objects
2017-10-14 14:27:09 -07:00
PaulStoffregen
3a43ebf73b FTDI serial receive working, still no transmit 2017-10-14 05:12:52 -07:00
PaulStoffregen
2b8ca63069 FTDI serial config & receive (still work in progress) 2017-10-13 05:56:18 -07:00
PaulStoffregen
ac06c74291 Begin FTDI serial driver 2017-10-12 20:06:59 -07:00
Kurt Eckhardt
dbe5292471 Keyboard HID extras plus map extra keys
This delta, adds an extra keyboard object to handle those keys that are not part of the main keyboard class.  In particular there are separate HID reports for some of the keys, such as Power keys, and multimedia keys.

These reports might be on separate Interface or in cases where the mouse and keyboard are on the same device, the extra reports may be on the Mouse Interface.

So far I have not tried to combine with Keyboard object as might require multiple inheritance which I would like to avoid.

Also I extended the special key mapping table to map several other keys like F1-12, Arrow, Home/end... To special values where the 0x80 bit is set.  I used the same values as used for the Arduino Keyboard library.  I did not use their defines as they used defines like KEY_F1, which already exists in core, but in core it is the scan code from the keyboard and not the end user value.
2017-10-12 10:27:41 -07:00
PaulStoffregen
0e35681c48 Add idVendor() & idProduct() to HID parser class 2017-10-09 14:21:30 -07:00
PaulStoffregen
adc8a3239f Query device status, idVendor and idProduct 2017-10-08 13:12:35 -07:00
PaulStoffregen
d3b6abe878 Keyboard LEDs and data parsing (Kurt & Frank) 2017-10-08 12:56:39 -07:00
Kurt Eckhardt
d792ffd2e8 PS4 support
Had to increase size of HID report to 512.
Allow HAT to work 10039

Mouse Example prints out Z, Rz, Ry, Rx and Hat values
2017-09-12 06:57:19 -07:00
PaulStoffregen
6e34e81fcf Add Joystic driver 2017-09-11 18:32:16 -07:00
PaulStoffregen
769f3120ee Remove old mouse code 2017-09-11 17:54:43 -07:00
PaulStoffregen
f58ed079a6 Mouse using HID parser 2017-09-10 03:48:10 -07:00
PaulStoffregen
1259027ebc Disallow claim of USBDriver with non-NULL device, even if on available_drivers list 2017-09-10 01:53:50 -07:00
PaulStoffregen
d9ad2cc78f Generic HID parser, initial commit 2017-09-09 11:17:50 -07:00
PaulStoffregen
75ac4d21e6 Add Mouse driver from wwatson
https://forum.pjrc.com/threads/45740-USB-Host-Mouse-Driver
2017-08-24 13:41:39 -07:00
PaulStoffregen
e345c0360d Add error recovery for async schedule errors & halted pipes 2017-07-02 02:15:43 -07:00
PaulStoffregen
6bacbaf537 Convert to Arduino library format 2017-03-07 07:40:06 -08:00
PaulStoffregen
f3d503259c Add public API for Keyboard driver 2017-03-07 07:22:57 -08:00
PaulStoffregen
650ff7eeec Add public API for MIDI driver 2017-03-07 05:42:29 -08:00
PaulStoffregen
3355eab2a2 Add documentation (in source code comments) 2017-03-06 06:03:07 -08:00
PaulStoffregen
5935deb8ce Device driver constructors compatible with UHS library 2017-03-06 04:36:48 -08:00
PaulStoffregen
a805d7552e Add Task function 2017-03-06 04:15:23 -08:00
PaulStoffregen
ea75a1c673 Rename header file to USBHost_t36.h 2017-03-05 21:33:29 -08:00