Commit Graph

15101 Commits (usb_keyboard)

Author SHA1 Message Date
Russ Butler 9ff5b3e481 Fix USB tests
Change the direction used in set interface to match the USB
specification. This allows USB tests to pass on OSX.
2018-03-27 16:00:13 +02:00
Russ Butler aa5b53358a Update USBHID and USBKeyboard
Update and the USB classes USBHID and USBKeyboard from the unsupported
folder.
2018-03-27 14:35:59 +02:00
Russ Butler 9a4eefc1e9 Skip USB reset tests on OSX
OSX machines don't allow you to reset USB devices. Skip this test on
OSX so testing can still be used.
2018-03-27 14:32:01 +02:00
Maciej Bocianski cb82cb4948 Fix for USB set_clear_feature_test for OSX 2018-03-27 14:32:01 +02:00
Russ Butler 402b528fbc Update USBTester product name
Change the name reported by USBTester from CDC DEVICE to
MBED TEST DEVICE.
2018-03-27 14:32:01 +02:00
Russ Butler 0667cf15b3 Add pyusb to requirements
Add pyusb to requirements so the greentea USB tests work.
2018-03-27 14:32:01 +02:00
Russ Butler 2b819b3e96 Add USBPhy template
Add a template for implementing a USBPhy.
2018-03-27 14:32:00 +02:00
Russ Butler e8934e405a Move USBPhy and related files to USB directory
Move the USBPhy header files into usb/device/USBPhy. Also move hal
and target USB files since mbed 2 does not compile when these files
are present without the USBPhy headers.

Directory restructure summary:
platform/USBPhy*
    to usb/device/USBPhy/USBPhy*
hal/*
    to usb/device/hal/*
targets/TARGET_Freescale/usb/*
    to usb/device/targets/TARGET_Freescale/*
targets/TARGET_NXP/TARGET_LPC176X/usb/*
    to usb/device/targets/TARGET_NXP/*
2018-03-27 14:32:00 +02:00
Maciej Bocianski 74274173af USB generic tests 2018-03-27 14:32:00 +02:00
Russ Butler 19590b9f8a Improve LPC1768 USB stability
Make the following changes to improve stability:
-When disconnecting set address to disabled to prevent nacks
-Clear EP_SLOW one and only once for every interrupt where it is set_address
-Disable and clear control endpoint interrupts when disconnecting
2018-03-27 14:32:00 +02:00
Russ Butler 664d2c32c5 Disable endpoints when disconnecting on Kinetis
Even thought the USB phy is disabled during disconnect, endpoints
still nack packets sent. This patch disables all endpoints so after
disconnect no USB traffic will be sent. This allows brief disconnects
of ~200us (or more) to be reliably detected by the host PC.
2018-03-27 14:32:00 +02:00
Russ Butler bbb22d54f4 Limit USB control transfer size
Limit the size of control reads to the max packet size of endpoint
zero. This fixes the handling of large transfers.
2018-03-27 14:32:00 +02:00
Russ Butler 3e70565822 Correct Kinetis 256 byte ctrl transfers
Correctly handle control transfers which are a multiple of 256 bytes
by checking for a non-zero value in the upper byte of size.
2018-03-27 14:32:00 +02:00
Russ Butler 518c4070a5 Fix Kinetis endpoint initialization
Fully setup endpoint before enabling it in endpoint_add. This prevents
undefined behavior due to previous configuration.
2018-03-27 14:32:00 +02:00
Russ Butler 226df08f65 Remove the USB directory from mbed 2 travis
Don't include the USB directory when testing mbed 2 on travis.
2018-03-27 14:32:00 +02:00
Russ Butler 96f418f9e8 Update USBCDC and USBSerial
Update the USBCDC and USBSerial classes to the new API. This patch also
updates the blocking behavior to unblock at the appropriate times and
to let the processor sleep when blocking rather than busy waiting.
2018-03-27 14:32:00 +02:00
Russ Butler 22be67fefa Add USB utility classes
Add an allocation free linked list implementation. Additionally add
the class AsyncOp which provides blocking and wakeup funcionality
to simplify making asynchronous operations block.
2018-03-27 14:32:00 +02:00
Russ Butler e497cbd91e Update USBPhy doxygen
Update USBPhy doxygen to pull in handbook copyedits. Also update the
docs to reflect the enhanced USBPhy API.
2018-03-27 14:32:00 +02:00
Russ Butler f254d6a122 Update the Kinetis USB driver to the new API
Update this driver to match the new zero-copy API.
2018-03-27 14:32:00 +02:00
Russ Butler 48ef725854 Update the LPC17XX driver to the new API
Update this driver to match the new zero-copy API.
2018-03-27 14:32:00 +02:00
Russ Butler ebba8c5bfb Update USBTester for the new USB API
Update the class USBTester so it works with the new zero-copy
USBDevice API.
2018-03-27 14:31:59 +02:00
Russ Butler 7f3de3e23e Add abort API to USBDevice
Add the function endpoint_abort and ensure ongoing transfer are
aborted when an endpoint is removed.
2018-03-27 14:31:59 +02:00
Russ Butler 601bc24010 Update USBDevice to reflect the updated USBPhy
Update USBDevice so the USB buffers are user supplied.
2018-03-27 14:31:59 +02:00
Russ Butler 377909d2b2 Update USBPhy to allow zero copy transfers
Update the USBPhy to allow for zero copy USB transfers on devices
which support it. This also aligns more closely with the CMSIS USB
driver model.
2018-03-27 14:31:59 +02:00
Russ Butler 14f34360c7 Call disconnect when uninitializing USB
Disconnect USB when uninitializing USB so it is in a well defined
state.
2018-03-27 14:31:59 +02:00
Russ Butler 4259f148ee Explicitly return when endpoint 0 is stalled
Stalling endpoint 0 indicates the end of a control transfer.
Return immediately when this occurs rather than continuing processing.

In particular, this patch prevents status from erroneously being
sent when _request_setup returns false inside _complete_request.
2018-03-27 14:31:59 +02:00
Russ Butler 94f056b2cb Allow transfer to start when configuring USB
Allow reads and writes to be started when entering the configured
state.
2018-03-27 14:31:59 +02:00
Russ Butler a1eb310bcc Move USBDevice processing out of user callbacks
Perform processing triggered by user callbacks when USB is being
unlocked rather than synchronously. This prevents recursive callbacks
which reduces stack usage. This also prevents state change inside
the user callback which makes the code easier to reason about.
2018-03-27 14:31:59 +02:00
Russ Butler 1b0a91a5ef Update stall state on set and clear feature
Call USBDevice::endpoint_stall/unstall in the request to set/clear
halt so the endpoint state is properly updated in the array
_endpoint_info.
2018-03-27 14:31:59 +02:00
Russ Butler f1e46b8545 Fix USB init problems
Initialize the _transfer structure so the behavior is the same
regardless of prior memory contents. This fixes a hang during
USB testing when CI flags are used.
2018-03-27 14:31:59 +02:00
Russ Butler 05aafac28b Update USBTester for simplified read handling
Remove read_start and replace read_finish with read to match the new
USBDevice API.
2018-03-27 14:31:59 +02:00
Russ Butler 311e8b7d0d Change USBDevice read handling
Remove the USBDevice function read_start and automatically start all
reads internally in USBDevice. This patch also renames the function
read_finish to read.
2018-03-27 14:31:59 +02:00
Russ Butler 4aba910249 Add and assert USB callback completion
Assert that when a callback is completed it is the active callback.
2018-03-27 14:31:59 +02:00
Russ Butler 7a55c94c0f Update Kinetis USB to match the USBPhy API
Copy the Kinetis USB driver files from
mbed-os\features\unsupported\USBDevice\targets\TARGET_Freescale
and update them to match the new USBPhy API.
2018-03-27 14:31:59 +02:00
Russ Butler f91805d3ab Add Kinetis USB files 2018-03-27 14:31:59 +02:00
Russ Butler 8287e3ab28 Remove mbed 2 USB tests from Travis
Remove the mbed 2 USB tests since USB support will be part of mbed 5.
2018-03-27 14:31:58 +02:00
Russ Butler cccbcdee0d Add USBPhy for the LPC17xx
Move the LPC17xx USB driver files from
mbed-os\features\unsupported\USBDevice\targets\TARGET_NXP
and update them to match the new USBPhy API.
2018-03-27 14:31:58 +02:00
Russ Butler 17bc923eb6 Add USBDevice test code
Add a USB test and the class USBTester.cpp to go along with it.
2018-03-27 14:31:58 +02:00
Russ Butler 1440603b1f Update USBDevice and configure to use a USBPhy
Update the USBDevice class API so it matches mbed-os's naming
conventions, has a more robust API and uses USBPhy as its backend.
2018-03-27 14:31:58 +02:00
Russ Butler b6a2141645 Update USB licenses and format code
Update USB licenses from MIT to Apache 2 and run astyle on the code.
2018-03-27 14:31:58 +02:00
Russ Butler a64f663a43 Copy USBDevice from unsupported
Copy the USBDevice code out of unsupported and into a top level USB
folder in preparation for development.

squash
2018-03-27 14:31:58 +02:00
Russ Butler 9c4611faae Add USBPhy, USB HAL and Utility class
Add the USBPhy and USBPhyEvents abstract classes, the HAL header using
this class and the EndpointResolver utility class.
2018-03-27 14:31:58 +02:00
Cruz Monrreal 062164eaad
Merge pull request #6452 from ARMmbed/revert-6086-gatt-client-unit-tests
Revert "BLE: Gatt client unit tests"
2018-03-26 14:33:52 -05:00
Cruz Monrreal 26737580ce
Merge pull request #6313 from SeppoTakalo/doxygen
Add missing Doxygen descriptions for Nanostack
2018-03-26 14:28:51 -05:00
Cruz Monrreal 57b48f6e05
Merge pull request #6416 from kjbracey-arm/lwip_netconntype_fix
lwIP: fix some IPv6 errors, eg TCP keepalive
2018-03-26 14:27:09 -05:00
Cruz Monrreal e9b234b876
Merge pull request #6424 from OpenNuvoton/m487_v3
Nuvoton: Support M487 v3.0 pin map
2018-03-26 14:26:32 -05:00
Cruz Monrreal c291b4ad32
Merge pull request #6428 from theotherjimmy/many-source-export
Avoid incorrect config errors on export with many --source
2018-03-26 14:25:53 -05:00
Cruz Monrreal 50773b1b75
Merge pull request #6440 from theotherjimmy/remove-supertarget
Remove supertarget
2018-03-26 14:21:53 -05:00
Anna Bridge d97d55a0c7
Merge pull request #6450 from 0xc0170/fix_#6449
Realtek: serial - line ending fix
2018-03-26 16:27:29 +01:00
Martin Kojtal afeb3066c3
Revert "BLE: Gatt client unit tests" 2018-03-26 11:51:29 +01:00