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.
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.
Added support for a another Serial type CH341.
Wip - But I do have it working so far at least with a loop back test (RX shorted to TX)
Also 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.
Will test more. I have several more cheap USB to serial adapter arriving tomorrow.
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.
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.
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...
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
I updated the keyboard extras to detect if the report ID is 0xff00 and if so ignore it in the Mouse extras process code. This helped not handling a lot of extra messages generated by MS keyboard.
Also updated Test app to show names of some of these special 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.
There is an issue with the extra items added to the report after the main known items.
Problem was HID report descriptor does something like:
Usage Page; Desktop (01)
Usage: 01 (Pointer)
Count xxx
Problem is the Usage values below 0x20 appear to have some other standard meaning. Which you can see in
http://www.usb.org/developers/hidpage/Hut1_12v2.pdf
So current fix is to ignore Usage values passed in < 0x20...
Appears to fix PS3 Right joystick