Commit graph

125 commits

Author SHA1 Message Date
Cristian Maglie
2e44a4d961 USBD: Added critical sections to EP OUT handler 2016-08-24 01:04:58 +02:00
Cristian Maglie
a9127228d6 USB: Slightly refactored EP OUT handler
Now the release() function only performs the action that is called for,
i.e. release the endpoint and let it receive data. All the buffers handling
has been inlined in the callers, this also slightly improves performance
because it allows to remove some redundant checks.
2016-08-24 01:04:58 +02:00
Cristian Maglie
87bf6e1bf1 Fixed some comments 2016-08-24 01:04:58 +02:00
Cristian Maglie
3ba1a35296 Moved EPHandler in USBDevice headers
The reference to the upper USBDevice class is passed on
the EPHandler constructor.
2016-08-24 01:04:58 +02:00
Cristian Maglie
7d37753904 USB-CDC: OUT EP is now handled with a custom EPHandler 2016-08-24 01:04:58 +02:00
Cristian Maglie
9f24bbe9a8 USB: Added an OUT EP handler with double buffering. 2016-08-24 01:04:58 +02:00
Cristian Maglie
b2ddb2267d USB: Added interface to possibly setup dynamic USB EP Handler 2016-08-24 01:04:58 +02:00
Cristian Maglie
34bf5421f8 USB: set return type of USBDevice::recv(ep) to int
this is the proper type to encapsulate a byte when data is available
or -1 when there is no data.
2016-08-24 01:04:58 +02:00
Cristian Maglie
40d9554ed3 USB-CDC: Avoid need to send ZLP by sending up to (EPX_SIZE-1) bytes at a time 2016-08-24 01:04:58 +02:00
Cristian Maglie
07263f8bf3 USB-CDC: reset EP OUT count upon reception 2016-08-24 01:04:58 +02:00
Cristian Maglie
19ae0eb4d4 USB-CDC: access to rx buffer is now ISR-protected 2016-08-24 01:04:58 +02:00
Cristian Maglie
9f678cb416 USB-CDC: Refactored EP OUT handling 2016-08-24 01:04:58 +02:00
Sandeep Mistry
e4f7bf513d Add private availableForStore method, and use in Serial_::accept 2016-08-24 01:04:58 +02:00
Sandeep Mistry
cea1d20f27 Enable transfer complete in USBDeviceClass::recv once bank is empty 2016-08-24 01:04:58 +02:00
Cristian Maglie
0d644d73e9 Removed unused code 2016-07-20 12:27:00 +02:00
Arturo Guadalupi
5b2c475376 Merge pull request #148 from sandeepmistry/SerialUSB.availableForWrite
Add Serial_::availableForWrite()
2016-07-07 18:12:49 +02:00
Sandeep Mistry
97e9c26fd7 Add Serial_::availableForWrite 2016-06-06 10:00:21 -04:00
Sandeep Mistry
8d0c167462 Change return value of Serial_::write to be the # of bytes written
Previous 0 was always returned.
2016-05-27 11:22:49 -04:00
Sandeep Mistry
8ef9bb3d7b Make return value of USBDeviceClass::send the bytes sent 2016-05-27 11:21:34 -04:00
Cristian Maglie
2e9e453586 Merge branch 'usb-tx-rx-led' of https://github.com/sandeepmistry/ArduinoCore-samd 2016-04-19 16:18:36 +02:00
Sandeep Mistry
cee4a8d8e6 Descriptor type (0x03) should be second byte for string descriptor 2016-03-30 14:00:57 -04:00
Sandeep Mistry
ba1ad40168 Add cast for string passed into strlen 2016-03-30 14:00:57 -04:00
Cristian Maglie
ea894b1efe Fixed USB sendStringDescriptor 2016-03-30 14:00:56 -04:00
Sandeep Mistry
ba02d346d2 Add USB transfer RX/TX LED blinking
Only enabled if PIN_LED_TXL or PIN_LED_RXL is defined
2016-03-04 15:16:31 -05:00
Sandeep Mistry
610a937ed1 Only re-enable IRQ if PRIMASK was 0 before disabling IRQ 2016-02-18 20:18:00 +01:00
Sandeep Mistry
c9a0009196 Merge branch 'MIDIdescriptorsFix' of https://github.com/arduino/ArduinoCore-samd 2016-01-26 12:07:45 -05:00
Sandeep Mistry
3ea315a0e3 Port some AVR Serial_ (SerialUSB) API's over 2016-01-15 09:13:34 -05:00
Luke McConnell
069b760174 Resolve compiler warning in USBCore
Resolve compiler warning from performing arithmetic on void pointers
2016-01-03 15:25:20 +00:00
agdl
17734c50d4 Fixed MIDI descriptors
To be compliant with the one sent by the AVR core
2015-12-17 12:26:31 +01:00
Martino Facchin
86fa94fdc7 PUSB: add iSerial USB field 2015-10-21 16:48:13 +02:00
Martino Facchin
02945cc78e [PluggableUSB] port to stable API 2015-10-12 15:28:07 +02:00
Martino Facchin
87bbaaa43d fix PUSB_getInterface return value 2015-09-16 14:56:21 +02:00
Martino Facchin
81475510fa fix pluggableUSB OUT packets 2015-09-16 12:59:53 +02:00
Martino Facchin
6d2f3db02a adapt USB core to PluggableUSB 2015-09-16 12:59:53 +02:00
Cristian Maglie
81cbda3aa6 Fixed bug in USBCore::send... (yikes!) 2015-09-10 18:47:08 +02:00
Cristian Maglie
ac16594d2a Disabled SRAM shortcut when in USBCore::send
The shortcut has some issues:

- sometimes it fails when sending an odd number of bytes (may be
  due to memory alignment?)
- the data pointer should point to "stable" data (and this is not
  guaranteed by caller, it may be some sort of temporary buffer)
- the SRAM is not guaranteed to start at 0x20000000

All the above problems must be properly fixed before reenabling
this part
2015-09-10 16:08:32 +02:00
Cristian Maglie
45d787ddb6 Removed some unused warning in USB-Core 2015-09-09 15:43:25 +02:00
Cristian Maglie
a6fa8329aa Fixed a lot of warnings in USBHost 2015-09-09 15:43:25 +02:00
Cristian Maglie
e748f0985f Moved USB ISR handler in startup.c 2015-09-09 15:42:58 +02:00
Jean-Christophe BUDA
fe4d51f851 Update for host and Device USB 2015-09-09 15:42:06 +02:00
Jean-Christophe BUDA
6608091768 HID class fixes 2015-09-09 15:42:05 +02:00
Martino Facchin
ff8bc8996a use different EP for CDC IN and OUT 2015-09-09 15:42:05 +02:00
Jean-Christophe BUDA
ffd05f251a Fix to USBDevice blocking-send 2015-09-09 15:42:05 +02:00
Martino Facchin
9d0d5d6158 fix back-to-back SerialUSB test 2015-09-09 15:42:05 +02:00
Martino Facchin
90d2f8032a USB: fix CDC endpoints
* fix in_endpoint buffer size (was too big)
* use the same EP for CDC_ENDPOINT_OUT and CDC_ENDPOINT_IN (different buffers)
* fix CDC_ENDPOINT_IN ep type
2015-09-09 15:42:05 +02:00
Cristian Maglie
3ddf463e89 USBDevice: added 'full' flag to USB buffer
This way all the 64 bytes available can be filled up
2015-09-09 15:42:05 +02:00
Cristian Maglie
44174a0ae6 USB device refactoring (WIP) 2015-09-09 15:42:05 +02:00
Cristian Maglie
8ebc4be2b2 Using memset instead of for-loop in UDD_Init 2015-07-17 15:50:12 +02:00
Cristian Maglie
a546da22f9 Fixed min/max definition and other macros as well
It seems that

   #include <stdint.h>

is able to undef "min" and "max" previously defined. With this
commit we make sure that they are defined as last.

Fix #10
2015-06-24 10:02:01 +02:00
Cristian Maglie
f3dc649efe Fixed warnings 2015-06-15 15:49:43 +02:00
Cristian Maglie
97f1cf6af5 Hide non-API pinPeripheral method 2015-06-15 14:16:15 +02:00
Cristian Maglie
50bc7867db USB VID/PID is now correctly taken from C macros 2015-06-12 17:43:39 +02:00
Cristian Maglie
810117ccaa Bootloader: fixed VID/PID 2015-06-10 10:57:00 +02:00
Cristian Maglie
889332c3df Revert " Fixed incorrect CDC-USB buffer handling"
This reverts commit bc7115b104428f9bea4fdfa1b6af245085f6f542.
2015-03-13 13:23:36 +01:00
Cristian Maglie
d181360425 Fixed incorrect CDC-USB buffer handling 2015-03-06 15:11:56 +01:00
Cristian Maglie
52237c845b CDC-ACM bugfix 2015-02-13 17:17:06 +01:00
Thibaut VIARD
44eec2f863 removing linker warning about PROGBITS 2014-10-14 16:15:06 +02:00
Cristian Maglie
5f849abcc8 Fixed some warnings 2014-10-08 11:08:30 +02:00
Jean-Christophe BUDA
891b984919 change define naming, USB pins
Signed-off-by: Jean-Christophe BUDA <jean-christophe.buda@atmel.com>
2014-09-11 18:00:53 +02:00
Jean-Christophe BUDA
6d36cba451 usb host and device update merge branch 'jc-3' into zero
Conflicts:
	hardware/arduino/samd/cores/arduino/USB/USBCore.cpp
	hardware/arduino/samd/cores/validation/validation_usb_device/build_as6/test.cppproj
2014-09-09 16:23:17 +02:00
Jean-Christophe BUDA
a868785f42 change define for PSTATUS SET / CLR and TCRP 2014-08-26 11:49:15 +02:00
Cristian Maglie
a5083011f9 Fixed USB-PID for zero 2014-08-18 15:33:39 +02:00
Cristian Maglie
6333d0c4da Merge pull request #49 from arduino/1200bps-touch
Implemented Auto-Reset on 1200bps-touch (Native Port) to restart bootloader
2014-08-16 11:52:48 +02:00
Cristian Maglie
ffdef05619 Correct implementation of USBD_RecvControl 2014-08-16 08:55:56 +02:00
Cristian Maglie
b11b8e8bf3 Fix on USB-CDC 1200bps-touch reset condition
Some serial libraries opens the serial port BEFORE setting the baudrate.
This patch allows finer control on the reset condition, since it's
checked on open/close (DTR) AND on serial port parameter change.
2014-08-16 08:49:59 +02:00
Jean-Christophe BUDA
0dd2fdef2b usb host correct out messages 2014-08-12 15:29:37 +02:00
Jean-Christophe BUDA
c5d519c01e move libraries/USBHost to hardware/arduino/sam/libraries/USBHost and for samd 2014-08-07 11:10:40 +02:00
Jean-Christophe BUDA
ecec13aa51 Merge branch 'zero' of https://github.com/arduino/ArduinoZero into zero
Conflicts:
	hardware/arduino/samd/cores/arduino/USB/samd21_host.c
	hardware/arduino/samd/cores/validation/validation_usb_host/test_usb_host.cpp
2014-08-01 17:23:31 +02:00
Jean-Christophe BUDA
5a20d0a5bf [USBHost] Arduino Zero. Add USB Host. 2014-08-01 12:11:49 +02:00
Thibaut VIARD
ae42fd1167 Adding license in files, update platform.txt 2014-07-25 17:11:29 +02:00
Jean-Christophe BUDA
cdfd4c27bc modify usb initialization, add it in main.cpp
o Please enter the commit message for your changes. Lines starting
2014-07-01 13:13:52 +02:00
Jean-Christophe BUDA
ecfe0c3e3d correct include missing in -I 2014-06-25 18:21:46 +02:00
Jean-Christophe BUDA
5873b030b0 USB device stack HID CDC validated 2014-06-20 17:28:31 +02:00
Thibaut VIARD
a48627b3e5 Bringing USB files in name of JcB 2014-05-12 20:09:09 +02:00
Thibaut VIARD
973ccc47d8 Adding first files, not Zero specific 2014-04-15 14:46:03 +02:00