1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-11 22:24:13 +01:00
Arduino/hardware/arduino/sam/cores/arduino
Matthijs Kooijman 96f7b966bc 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
..
avr Added missing license on samd's pgmspace.h 2015-05-19 20:01:50 +02:00
USB Expose serial settings from CDC virtual serial port 2015-07-31 13:40:43 +02:00
abi.cpp Correct implementation of gcc specific internal functions 2014-09-06 12:42:25 +02:00
Arduino.h Add Due watchdog functions; modified according to feedback supplied 2015-05-08 14:16:12 +02:00
binary.h Added license for Arduino.h, binary.h and main.cpp 2014-02-10 12:55:16 +01:00
Client.h Added license for Client, IPAddressm and Server 2014-02-10 12:55:16 +01:00
cortex_handlers.c Fixed weak-symbol issue with system interrupt handlers. 2012-11-19 23:37:19 +01:00
HardwareSerial.h Temboo library is now vanilla 2014-02-18 22:32:24 +01:00
hooks.c Fixed weak-symbol issue with system interrupt handlers. 2012-11-19 23:37:19 +01:00
iar_calls_sam3.c [sam] renamed 'sam' core folder into 'arduino' 2012-05-20 23:45:56 +02:00
IPAddress.cpp Use a union in IPAddress for uint8_t[] <-> uint32_t conversion 2014-02-19 16:09:29 +01:00
IPAddress.h Use a union in IPAddress for uint8_t[] <-> uint32_t conversion 2014-02-19 16:09:29 +01:00
itoa.c [sam] renamed 'sam' core folder into 'arduino' 2012-05-20 23:45:56 +02:00
itoa.h [sam] renamed 'sam' core folder into 'arduino' 2012-05-20 23:45:56 +02:00
main.cpp Add Due watchdog functions; modified according to feedback supplied 2015-05-08 14:16:12 +02:00
new.cpp Added new/delete stubs for Arduino Due 2014-09-06 10:26:59 +02:00
Print.cpp Updated printLn on SAM core 2015-05-23 01:56:06 +10:00
Print.h Add Print::write(const char *, size_t) 2013-12-24 13:22:42 +01:00
Printable.h Added include in Printable.h for 'size_t' support. 2012-08-24 10:55:33 +02:00
Reset.cpp [sam] Removed workaround in banzai() subroutine after 8120558af5 2014-02-18 22:32:55 +01:00
Reset.h Refactored auto-reset methods. 2012-09-11 23:24:00 +02:00
RingBuffer.cpp Change RingBuffer to have buffer size of 128 and also set its members volatile since they are all accessed and modified in interrupt handlers. 2014-12-23 22:36:35 -05:00
RingBuffer.h Change RingBuffer to have buffer size of 128 and also set its members volatile since they are all accessed and modified in interrupt handlers. 2014-12-23 22:36:35 -05:00
Server.h Add #include "Print.h" in Server.h 2014-09-26 22:59:02 +03:00
Stream.cpp Updated Stream.cpp in SAM core to the latest version 2015-04-21 18:11:05 +02:00
Stream.h Stream: set findMulti function as protected 2015-03-24 17:13:14 +01:00
syscalls_sam3.c Suppress "unused parameter" warnings 2014-02-19 16:09:30 +01:00
syscalls.h [sam] renamed 'sam' core folder into 'arduino' 2012-05-20 23:45:56 +02:00
Tone.cpp.disabled Merged upstream arduino branch 2012-10-18 15:50:09 +02:00
Tone.h [sam] renamed 'sam' core folder into 'arduino' 2012-05-20 23:45:56 +02:00
UARTClass.cpp sam: Fixed initialization of UART/USART mode register 2015-01-14 00:08:59 +01:00
UARTClass.h sam: Fixed initialization of UART/USART mode register 2015-01-14 00:08:59 +01:00
Udp.h Arduino-core 1.0.1 merging (work in progress..) 2012-06-02 00:09:42 +02:00
USARTClass.cpp sam: Fixed initialization of UART/USART mode register 2015-01-14 00:08:59 +01:00
USARTClass.h sam: Fixed initialization of UART/USART mode register 2015-01-14 00:08:59 +01:00
watchdog.cpp Due watchdog: change flags to effectively reset board 2015-05-08 14:16:12 +02:00
watchdog.h Add Due watchdog functions; modified according to feedback supplied 2015-05-08 14:16:12 +02:00
WCharacter.h [sam] renamed 'sam' core folder into 'arduino' 2012-05-20 23:45:56 +02:00
WInterrupts.c [sam] attachInterrupt() now works also on pins that belongs to PORTD 2013-02-02 17:14:30 +01:00
WInterrupts.h {attach,detach}Interrupt() on Due selects directly pin number instead of interrupt number. 2012-11-02 19:48:04 +01:00
wiring_analog.c Remove const specifier from channelToTC array in analogWrite on SAM 2014-02-19 16:09:31 +01:00
wiring_analog.h Extended analogRead/Write API to support difference ADC/DAC resolutions. 2012-08-04 11:27:46 +02:00
wiring_constants.h Arduino custom type boolean is now mapped to bool type 2015-01-07 14:56:19 +01:00
wiring_digital.c Fixed pull-up. 2012-10-09 16:43:38 +02:00
wiring_digital.h [sam] renamed 'sam' core folder into 'arduino' 2012-05-20 23:45:56 +02:00
wiring_private.h [sam] renamed 'sam' core folder into 'arduino' 2012-05-20 23:45:56 +02:00
wiring_pulse_asm.S pulseIn: add ASM implementation for Due 2015-05-29 15:01:38 +02:00
wiring_pulse.cpp Fixed unused variables warnings and indentation 2015-05-29 20:02:50 +02:00
wiring_pulse.h pulseIn: add alternative implementation based on micros() 2015-05-29 15:01:38 +02:00
wiring_shift.c Arduino-core 1.0.1 merging (work in progress..) 2012-06-02 00:09:42 +02:00
wiring_shift.h [sam] renamed 'sam' core folder into 'arduino' 2012-05-20 23:45:56 +02:00
wiring.c [sam] Fixed wrap-around bug in delay() (Mark Tillotson) 2013-12-14 00:33:57 +01:00
wiring.h Fixed attribution rights for SAM delayMicroseconds function 2014-09-16 12:31:16 +02:00
WMath.cpp [sam] renamed 'sam' core folder into 'arduino' 2012-05-20 23:45:56 +02:00
WMath.h [sam] renamed 'sam' core folder into 'arduino' 2012-05-20 23:45:56 +02:00
WString.cpp Check for __cplusplus >= 201103L as well as __GXX_EXPERIMENTAL_CXX0X__ 2015-07-16 13:06:10 +02:00
WString.h Check for __cplusplus >= 201103L as well as __GXX_EXPERIMENTAL_CXX0X__ 2015-07-16 13:06:10 +02:00