summaryrefslogtreecommitdiff
path: root/chip/stm32/usb_hid.c
Commit message (Collapse)AuthorAgeFilesLines
* USB: Add memcpy_from_usbram and update existing memcpyAnton Staaf2015-01-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously there was just a memcpy_usbram that copied to USB packet memory, and no routine to copy out. This adds the "from" version and renames and improves to "to" version. The improvement is that the new "to" version correctly handles unaligned beginning and endings of the region to be copied. These need to be read/modify/write accesses since the USB packet ram has to be manipulated in 16-bit chunks. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Verify that discovery-stm32f072 still enumerates and communicates correctly over USB. Change-Id: I94353e66ad0248d4e674abb29f9a88e979767655 Reviewed-on: https://chromium-review.googlesource.com/238764 Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Vic Yang <victoryang@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org> Trybot-Ready: Anton Staaf <robotboy@chromium.org>
* USB: Interface callbacks now return an error codeAnton Staaf2014-12-021-3/+4
| | | | | | | | | | | | | | | | | | | | A non-zero error code returned by the callback causes EP0 to STALL. This is the common mechanism used in USB to indicate an error while processing a control request. This simplifies the implementation of interface callbacks. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Change-Id: I89ceb4892f9f810fcaf6e975e6982fc5b2ae447b Reviewed-on: https://chromium-review.googlesource.com/232368 Reviewed-by: Anton Staaf <robotboy@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* usb: add USB HID driverVincent Palatin2014-06-191-0/+162
Add a USB HID endpoint providing a keyboard interface. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=build for the Reston keyboard and press keys on the matrix. Change-Id: I3f4cc55acdd33286f0638dabaa9050c37698404f Reviewed-on: https://chromium-review.googlesource.com/204166 Reviewed-by: Vic Yang <victoryang@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>