USBSerial_BigBuffer - T4.x (multi devices)
This delta originated to do the work similar to what was done
for the MIDI code base and support two versions of the object.
All of the code was renamed to a new base class USBSerialBase
which has everything, except the main buffer.
Two sub-classes were made that the only difference is the size of the
buffer to hold all of the USB RX and TX information.
This started off to try to support an FT2232H device which transers
512 bytes at a time instead of what most of our devices were transfering
which is 64 bytes.
While doing this, I found that we have a similar issue with the T4.x
boards which now transfer 512 bytes as well and our Serial object would
not handle it.
So there are two sublasses:
```
USBSerial - for those up to 64 byte transfers
USBSerial_BigBuffer - for up to 512 bytes
```
Note: by default the biguffer version will only handle those
devices > 64 bytes, but you can pass in an optional parameter of the
minimum size, so doing something like:
```
USBSerial_BigBuffer userial(myusb, 1);
```
Will handle all up to 512.
Also the FTDI2232H supports two USB to Serial objects, and our code
was setup that in most cases including when we put in VID:PID pair in
our table, the code would claim would claim
the object at device level so only one USB Serial adapter.
So changed table to support saying for this VID:PID claim at
interface level. It now works, but not sure for the device I have as
it is a USB to Serial and JTAG and not sure how to test 2nd one.
But while doing this created a test sketch for Multiple Host USB Serial
objects and the two are claimed by this.
I also created a new version of the Teensy USBToSerial example sketch
that if you configure USB type to Dual Serial or Triple Serial will output
SerialUSB1 to Serial2 and SerialUSB2 to Serial3, which works, and then
tried T4 configured for Dual plugged
into T4.1 with above sketch and could talk to both USB Serial adapters.
The Claim code was rearranged a lot, so hopefully did not break
anything.
But tested with
T4 as mentioned, both Single and Dual Serial
T3.2 with Single Serial, plus: Serial, Joystick, Keyboard...
FTDI - USB to Serial adapter (Sparkfun)
CP2104 - Adafruit
PL2303 - some clones ...
So hopefully most things are still working
преди 4 години USBSerial_BigBuffer - T4.x (multi devices)
This delta originated to do the work similar to what was done
for the MIDI code base and support two versions of the object.
All of the code was renamed to a new base class USBSerialBase
which has everything, except the main buffer.
Two sub-classes were made that the only difference is the size of the
buffer to hold all of the USB RX and TX information.
This started off to try to support an FT2232H device which transers
512 bytes at a time instead of what most of our devices were transfering
which is 64 bytes.
While doing this, I found that we have a similar issue with the T4.x
boards which now transfer 512 bytes as well and our Serial object would
not handle it.
So there are two sublasses:
```
USBSerial - for those up to 64 byte transfers
USBSerial_BigBuffer - for up to 512 bytes
```
Note: by default the biguffer version will only handle those
devices > 64 bytes, but you can pass in an optional parameter of the
minimum size, so doing something like:
```
USBSerial_BigBuffer userial(myusb, 1);
```
Will handle all up to 512.
Also the FTDI2232H supports two USB to Serial objects, and our code
was setup that in most cases including when we put in VID:PID pair in
our table, the code would claim would claim
the object at device level so only one USB Serial adapter.
So changed table to support saying for this VID:PID claim at
interface level. It now works, but not sure for the device I have as
it is a USB to Serial and JTAG and not sure how to test 2nd one.
But while doing this created a test sketch for Multiple Host USB Serial
objects and the two are claimed by this.
I also created a new version of the Teensy USBToSerial example sketch
that if you configure USB type to Dual Serial or Triple Serial will output
SerialUSB1 to Serial2 and SerialUSB2 to Serial3, which works, and then
tried T4 configured for Dual plugged
into T4.1 with above sketch and could talk to both USB Serial adapters.
The Claim code was rearranged a lot, so hopefully did not break
anything.
But tested with
T4 as mentioned, both Single and Dual Serial
T3.2 with Single Serial, plus: Serial, Joystick, Keyboard...
FTDI - USB to Serial adapter (Sparkfun)
CP2104 - Adafruit
PL2303 - some clones ...
So hopefully most things are still working
преди 4 години Now only optionally force keyboard into boot protocol mode
The first gigabyte fix, was to always force the keyboard into boot protocol mode, which appeared to work well for all of the keyboards I tried.
Unforationally it caused issues with some wireless keyboard/mouse combo packages, including some logitech and some microsoft keyboards.
This version instead, I created a list (currently only one vendor id), of vendor id:product id, that need to be forced into boot mode. Knowing that if there is one keyboard vendor with this N key rollover feature, there are probably others. So while this list can be expanded, this requires users to update library. So added a method forceBootProtocol method to keyboard class that allows the user to try it out without needing to update the library sources.
The mouse test program has example of either setting it before the keyboard is initiated, as well as another way that when a connection is found it asks for the vendor id, and if it is the one of my gigabyte keyboard, it calls the function then.
While doing this I found some of the query functions like idVendor on the keyboard class would not compile as the keyboard object has multiple inheritence and both base classes have this. So like the joystick objects I added these to the top level function and these functions will direct the calls to the approrpriate places.
преди 6 години |
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- # Objects
- USBHost KEYWORD1
- USBHub KEYWORD1
- USBHIDParser KEYWORD1
- KeyboardController KEYWORD1
- MouseController KEYWORD1
- DigitizerController KEYWORD1
- MIDIDevice KEYWORD1
- MIDIDevice_BigBuffer KEYWORD1
- USBSerial KEYWORD1
- USBSerial_BigBuffer KEYWORD1
- USBSerialEmu KEYWORD1
- USBSerialBase KEYWORD1
- AntPlus KEYWORD1
- JoystickController KEYWORD1
- RawHIDController KEYWORD1
- BluetoothController KEYWORD1
- # Common Functions
- Task KEYWORD2
- idVendor KEYWORD2
- idProduct KEYWORD2
- manufacturer KEYWORD2
- product KEYWORD2
- serialNumber KEYWORD2
-
- # KeyboardController
- getKey KEYWORD2
- getModifiers KEYWORD2
- getOemKey KEYWORD2
- attachPress KEYWORD2
- attachRelease KEYWORD2
- attachExtrasPress KEYWORD2
- attachExtrasRelease KEYWORD2
- LEDS KEYWORD2
- updateLEDS KEYWORD2
- numLock KEYWORD2
- capsLock KEYWORD2
- scrollLock KEYWORD2
- forceBootProtocol KEYWORD2
-
- # MIDIDevice
- getType KEYWORD2
- getChannel KEYWORD2
- getData1 KEYWORD2
- getData2 KEYWORD2
- setHandleNoteOff KEYWORD2
- setHandleNoteOn KEYWORD2
- setHandleVelocityChange KEYWORD2
- setHandleControlChange KEYWORD2
- setHandleProgramChange KEYWORD2
- setHandleAfterTouch KEYWORD2
- setHandlePitchChange KEYWORD2
- setHandleSysEx KEYWORD2
- setHandleRealTimeSystem KEYWORD2
- setHandleTimeCodeQuarterFrame KEYWORD2
- sendNoteOff KEYWORD2
- sendNoteOn KEYWORD2
- sendPolyPressure KEYWORD2
- sendControlChange KEYWORD2
- sendProgramChange KEYWORD2
- sendAfterTouch KEYWORD2
- sendPitchBend KEYWORD2
- sendSysEx KEYWORD2
- sendRealTime KEYWORD2
- sendTimeCodeQuarterFrame KEYWORD2
- sendTimeCodeQuarterFrame KEYWORD2
- SYSEX_MAX_LEN LITERAL1 KEYWORD2
-
- # AntPlus
- onStatusChange KEYWORD2
- onDeviceID KEYWORD2
- onHeartRateMonitor KEYWORD2
- onSpeedCadence KEYWORD2
- onSpeed KEYWORD2
- onCadence KEYWORD2
- setWheelCircumference KEYWORD2
-
- # MouseController
- mouseDataClear KEYWORD2
- getButtons KEYWORD2
- getMouseX KEYWORD2
- getMouseY KEYWORD2
- getWheel KEYWORD2
- getWheelH KEYWORD2
-
- # JoystickController
- joystickDataClear KEYWORD2
- getAxis KEYWORD2
- axisMask KEYWORD2
- axisChangedMask KEYWORD2
- axisChangeNotifyMask KEYWORD2
- userAxisMask KEYWORD2
- setRumbleOn KEYWORD2
- setLEDs KEYWORD2
- joystickType KEYWORD2
- PS3 LITERAL1
- PS3_MOTION LITERAL1
- PS4 LITERAL1
- XBOXONE LITERAL1
- XBOX360 LITERAL1
- SWITCH LITERAL1
- # USBSerial
- USBHOST_SERIAL_7E1 LITERAL1
- USBHOST_SERIAL_7O1 LITERAL1
- USBHOST_SERIAL_8N1 LITERAL1
- USBHOST_SERIAL_8N2 LITERAL1
- USBHOST_SERIAL_8E1 LITERAL1
- USBHOST_SERIAL_8O1 LITERAL1
-
- # RAWHid
- usage KEYWORD2
- attachReceive KEYWORD2
- sendPacket KEYWORD2
|