Commit Graph

25 Commits

Author SHA1 Message Date
Eric Wieser f368d61c8d Add Print::availableForWrite
If available() is in the base Stream class, then availableForWrite() should be in the base Print class
2017-05-16 14:52:47 +02:00
NicoHood d596f45771 Added Long USB RecvControl call for >64 bytes 2015-12-19 01:53:24 +01:00
Nico 3f854e723d Fix CDC Serial buffer size determination 2015-09-20 11:08:49 +02:00
Cristian Maglie 83a2836bbb Merge branch 'cdc-settings' of https://github.com/matthijskooijman/Arduino 2015-08-14 13:37:00 +02:00
NicoHood 21c111d42f Precised USB Endpoint definitions 2015-08-12 17:48:17 +02:00
NicoHood aa5a91f1a3 Added 16 byte endpoint support 2015-08-12 17:48:17 +02:00
Peter Van Hoyweghen 33f2757d4e Add Serial_::availableForWrite().
This makes the CDC "Serial" object on the Leonardo and similar boards
support this recently introduced method as well. The CDC code in the sam
core is not changed.
2015-07-31 14:06:20 +02:00
Matthijs Kooijman d93c15ca5c Add Serial_::readBreak() to process SEND_BREAK requests
This allows detecting when the USB host sends a break request and what
the value of the request was. See the comments in USBAPI.h for details.

This just modifies the avr core, not the sam core.
2015-07-31 14:06:19 +02:00
Matthijs Kooijman 172717cf6c Expose serial settings from CDC virtual serial port
This allows a sketch to find out the settings chosen by the USB host
(computer) and act accordingly.

Other than reading the DTR flag and checking if the baudrate is 1200,
the regular CDC code doesn't actually use any of these settings.

By exposing these settings to the sketch, it can for example copy them
to the hardware UART, turning the Leonardo into a proper USB-to-serial
device. This can be useful to let the computer directly talk to whatever
device is connected to the hardware serial port (like an XBee module).

The Teensy core already supported these methods. This code was
independently developed, but the method names were chosen to match the
Teensy code, for compatibility (except that `dtr()` and `rtr()` return
`bool`, while the Teensy version return a `uint8_t`).

This change is applied to both the avr and sam cores, which have a very
similar CDC implementation.
2015-07-31 13:40:43 +02:00
Martino Facchin 512e369e80 rename Setup typedef struct to USBSetup
was really too common
2015-07-16 13:13:52 +02:00
Martino Facchin 05f8a397a4 Add support for waking up a host via USB HID
this is a rework of commit fbcf94801b8bba7f1c8c79cc7ae402b6b9dbb2d3
2015-07-16 13:13:51 +02:00
Martino Facchin 8282c2734e Move EP defines to header 2015-07-16 13:12:13 +02:00
Martino Facchin 3750b26d29 Remove HID core library 2015-07-16 13:12:13 +02:00
Nico 19dd4984a3 RX and TX Serial buffer sizes can now be defined independently
Fixes #2597
2015-05-12 15:09:48 +02:00
Cristian Maglie b595e9f0d1 Added license to USBAPI.h
Close #1847
2014-09-12 12:27:39 +02:00
Cristian Maglie 2632f64a75 Merge branch 'master' into ide-1.5.x 2014-06-19 17:01:53 +02:00
Cristian Maglie 887a6faa7c Merge branch 'master' into HEAD 2014-06-13 10:29:12 +02:00
Cristian Maglie 8ffc54f4ca Merge branch 'usbcdc-improved' into ide-1.5.x 2014-05-26 13:38:07 +02:00
Matthijs Kooijman 7ef4f149a8 Centrally decide which hardware UARTS are available
Before, this decision was made in few different places, based on
sometimes different register defines.

Now, HardwareSerial.h decides wich UARTS are available, defines
USE_HWSERIALn macros and HardwareSerial.cpp simply checks these macros
(together with some #ifs to decide which registers to use for UART 0).
For consistency, USBAPI.h also defines a HAVE_CDCSERIAL macro when
applicable.

For supported targets, this should change any behaviour. For unsupported
targets, the error messages might subtly change because some checks are
moved or changed.

Additionally, this moves the USBAPI.h include form HardareSerial.h into
Arduino.h and raises an error when both CDC serial and UART0 are
available (previously this would silently use UART0 instead of CDC, but
there is not currently any Atmel chip available for which this would
occur).
2014-01-22 09:38:34 +01:00
Cristian Maglie 79664a0800 Merge branch 'master' into ide-1.5.x 2013-09-30 16:25:10 +02:00
Cristian Maglie 2e0432e664 Move buffers into USB CDC (look #947 and #1369 for reference) 2013-07-27 12:06:42 +02:00
Cristian Maglie 0cf0a99a46 Fixed compile problem for Leonardo after 0bd6a2d20fb9664255b20e0db11dd4586ebe9007 2013-07-26 12:50:17 +02:00
Cristian Maglie 599e7eee69 Merged upstream Arduino master branch 2012-06-26 00:51:35 +02:00
Cristian Maglie 828076175e Merge of arduino-1.0.1. Work in progress... 2012-05-23 09:22:52 +02:00
Cristian Maglie 822dcb0989 Created second level in hardware folder: hardware/PACKAGE/PLATFORM/...
Made some helper class for files filtering.
platforms.txt now contains only one platform at a time.
Some cleanup in Compiler and AvrDudeUploader classes.
2011-12-30 15:46:04 +01:00