Commit graph

126 commits

Author SHA1 Message Date
Phillip Pearson
aebf3cb686
Port some AVR Serial_ (SerialUSB) API's over (#285)
Co-authored-by: Sandeep Mistry <s.mistry@arduino.cc>
2021-03-06 11:56:47 -05:00
Henry Gabryjelski
8afd0523b1 Fix unintended fall-through
The compiler found this, not me.  Building with
all warnings enabled is recommended.
2020-01-16 16:15:34 -08:00
hathach
fc737be24e revert 6630fe7cc0 availableForWrite() return int 2019-12-31 11:44:26 +07:00
Lady Ada
6630fe7cc0 @hathach Arduino core now wants size_t returned 2019-12-10 22:41:12 -05:00
Kay Sievers
23fd362a72 USBCore: Read the SAMD51 serial number
Export the unique hardware serial number from the SAMD51 MCU
to the USB device descriptor.

Remove the concatenation of the USB class device string, it is
superfluous, and an USB interface property should not become a
part of the USB device property.

Tested on SAMD21 and SAMD51:

Before:
  SAMD21: 10BD8E4051504C3750202020FF0B1410MIDI
  SAMD51: MIDI

After:
  SAMD21: 10BD8E4051504C3750202020FF0B1410
  SAMD51: AAFC165853574E514D202020FF083C44
2019-06-23 22:02:35 +02:00
hathach
ab16f9899d add menu dropdown list for usb stack selection 2019-05-01 01:01:59 +07:00
hathach
9c07070580 get msc & hid example work with metro m0 express 2019-04-30 00:12:17 +07:00
ladyada
4d8adc9be4 Merge branch 'master' of https://github.com/arduino/ArduinoCore-samd into arduino-master 2019-03-08 14:03:54 -05:00
Sandeep Mistry
9d83af3e05 Fix USB warnings 2018-11-27 09:39:36 -05:00
ladyada
074fe0fa9b re-set to 100mA default for iOS support 2018-11-02 13:48:39 -04:00
gdsports
9ac80d9a3a Fix memory overwrite in USBHost
Fix issue #271.
2018-10-23 11:31:34 +02:00
Martino Facchin
3b38a41278 Inplement USBDevice.end() 2018-10-23 11:19:08 +02:00
Martino Facchin
d5557ec4b4 Clear _usbLineInfo structure on SerialUSB.end() 2018-10-23 11:19:08 +02:00
dean
bcc44cc6a1 DM: samd51 USB fix for rebase 2018-09-04 11:50:37 -04:00
dean
b7e942d924 DM: fix stuff from rebase 2018-08-30 15:40:15 -04:00
dean
87eae6f55c DM: add copyrights 2018-08-30 15:12:51 -04:00
dean
7f74c2126e update usb stuff 2018-08-30 15:08:16 -04:00
dean
2b0f87a73d DM: some usb host fixes (still not working) 2018-08-30 14:59:17 -04:00
dean
9eecac827b DM: updates for rev B 2018-08-30 14:59:16 -04:00
dean
c1827b289d DM: added support for samd51J20A 2018-08-30 14:46:42 -04:00
dean
4810822d26 DM: mostly fixed usb enumeration delay 2018-08-30 14:44:35 -04:00
dean
b5c2b6483b DM: clocked to 120MHZ, peripherals to 100, USB to 48 2018-08-30 14:44:35 -04:00
dean
358b11addd DM: added samd51 support 2018-08-30 14:32:21 -04:00
ladyada
b34deb4e81 align back to mainline (and put in missing Serial5) - not sure if USB serial LEDs were causing hangups on 1200baud bumps? :/ 2018-08-30 14:23:07 -04:00
ladyada
d19c8e35a9 cleaned up slight difference in USB union bitflags with a new USBDevice.h - compiles blink 2018-08-30 14:21:26 -04:00
ladyada
ae249718d4 add USB CDC RX & TX LEDs with 10ms minimum on time, tested 2018-08-30 14:18:05 -04:00
ladyada
012d86c1d3 make it so native USB is Serial 2018-08-30 14:12:25 -04:00
Martino Facchin
f4dfac890f Always call new DoubleBufferedEPOutHandler on reconnect
Avoid memory leak by deleting the buffers; DoubleBufferedEPOutHandler should be refactored (in beta branch) to allow separate "new" and "setup" procedures

Fixes #350
2018-08-24 12:24:49 +02:00
gdsports
95bcb7cf3a Fix CDC_ENABLED
Undefining CDC_ENABLED triggered a compiler error. With this fix, the
CDC ACM configuration can be disabled.
2018-02-20 16:49:11 -05:00
Martino Facchin
2bb54068a2 Don't reallocate USB buffers if already allocated
USB Configuration was meant to run only once, but if the board comes back from standby the host can reconfigure the device again.
Probably a cleaner patch could be free()-ing the buffers on standby() to release the memory but at least we don't leak anymore.

Fixes https://github.com/arduino/ArduinoCore-samd/issues/293
2018-01-25 11:20:41 -05:00
Sandeep Mistry
d58b840f63 Add missing USBCON wrapper 2018-01-08 10:41:14 -05:00
Andreas Watterott
7e37bb3b12
No fixed value for USB power current. 2017-11-09 19:50:41 +01:00
Sandeep Mistry
0ee62489c0 Replace utoa + toupper with custom loop 2017-08-23 19:21:01 +02:00
Sandeep Mistry
61b060c732 Slim serial number to hex string conversion 2017-08-23 19:21:01 +02:00
Sandeep Mistry
9370464ad0 Use SAMD21 serial number for USB serial number prefix 2017-08-23 19:21:01 +02:00
Sandeep Mistry
70b011b077 USB: Only swap incoming buffers for non-ZLP's 2017-05-02 10:01:03 -04:00
Martino Facchin
b9ac48c782 Implement low power functionality on USB subsystem
This enables remote wakeup on CDC driver, so we can safely call standby() and maintain the Serial prints on resume.
2017-04-04 10:50:22 +02:00
Cristian Maglie
428433f963 Merge branch 'bootloader-cmsis-fix' 2016-12-20 16:59:12 +01:00
Sandeep Mistry
80f629c379 Correct epBank1EnableTransferComplete 2016-12-19 16:30:52 -05:00
Martino Facchin
86ae860677 Enlarge USB serialNumber buffer 2016-12-15 18:34:05 +01:00
Sandeep Mistry
38683e36b6 Changes required for new CMSIS package upgrade
Fixes some compile errors and warnings
2016-12-02 10:48:52 -05:00
Cristian Maglie
b06501baee Fix regression: SerialUSB.available() do not return correct values
Fix #172
2016-10-10 12:43:14 +02:00
Sandeep Mistry
b2462a5a1a Remove line state check in Serial_::write
It’s no longer needed with the timeout mechanism in USBCore.
2016-08-31 11:21:40 -04:00
Sandeep Mistry
8f7873cea5 Add comment on inspiration 2016-08-31 11:21:40 -04:00
Sandeep Mistry
8afe969ed2 Make transmit timeout per endpoint 2016-08-31 11:21:40 -04:00
Sandeep Mistry
b627e00b17 Add USB send timeout
Timeout is checked on the next send attempt. Initial timeout is set to
70ms, after a time out occurs and the previous transfer is still not
complete a send will report as failed. If a send times out, a ZLP will
be in the send queue to check for future timeouts.
2016-08-31 11:21:40 -04:00
Cristian Maglie
5dd2adc41d USBD: Rewritten RX/TX LED conditions in a slighlty more clear way 2016-08-29 17:06:56 +02:00
Cristian Maglie
0605c11e76 USBD: RX LED now blinks again (fixed regression) 2016-08-29 17:05:16 +02:00
Cristian Maglie
4691ef4ba0 USB: Added optimized Stream::readBytes for EP OUT handler
This bypass the generic (but inefficient) implementation of Stream::readBytes
and uses an optimized version of readBytes than can do efficient multi-byte reads.
2016-08-24 12:50:37 +02:00
Cristian Maglie
3127d1dc51 USB-CDC: Increased buffer size to 256 bytes
This change improves read performance when massive data is sent
via USB by exploiting the hardware capability to handle multi-packet
transfers autonomously.
2016-08-24 12:50:25 +02:00