From 11bb2f21720c2af4b29732ca128963869e5c512c Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Fri, 17 Apr 2009 00:20:00 +0000 Subject: Renamed Serial_Stream driver to SerialStream to remain consistent with the rest of the library's naming scheme for files. --- Demos/Device/RNDISEthernet/ProtocolDecoders.h | 2 +- Demos/Device/RNDISEthernet/RNDISEthernet.h | 11 ++- Demos/Device/RNDISEthernet/makefile | 2 +- Demos/Host/CDCHost/CDCHost.h | 2 +- Demos/Host/CDCHost/makefile | 2 +- Demos/Host/GenericHIDHost/GenericHIDHost.h | 2 +- Demos/Host/GenericHIDHost/makefile | 2 +- Demos/Host/KeyboardHost/KeyboardHost.h | 2 +- Demos/Host/KeyboardHost/makefile | 2 +- .../KeyboardHostWithParser.h | 2 +- Demos/Host/KeyboardHostWithParser/makefile | 2 +- Demos/Host/MassStorageHost/MassStorageHost.h | 2 +- Demos/Host/MassStorageHost/makefile | 2 +- Demos/Host/MouseHost/MouseHost.h | 2 +- Demos/Host/MouseHost/makefile | 2 +- .../Host/MouseHostWithParser/MouseHostWithParser.h | 2 +- Demos/Host/MouseHostWithParser/makefile | 2 +- Demos/Host/StillImageHost/StillImageHost.h | 2 +- Demos/Host/StillImageHost/makefile | 2 +- Demos/OTG/TestApp/TestApp.h | 2 +- Demos/OTG/TestApp/TestEvents.h | 2 +- Demos/OTG/TestApp/makefile | 2 +- LUFA.pnproj | 2 +- LUFA/ChangeLog.txt | 2 +- LUFA/Common/Common.h | 2 +- LUFA/Drivers/Peripheral/SerialStream.c | 45 +++++++++++ LUFA/Drivers/Peripheral/SerialStream.h | 93 ++++++++++++++++++++++ LUFA/Drivers/Peripheral/Serial_Stream.c | 45 ----------- LUFA/Drivers/Peripheral/Serial_Stream.h | 93 ---------------------- LUFA/MigrationInformation.txt | 1 + LUFA/makefile | 2 +- 31 files changed, 169 insertions(+), 169 deletions(-) create mode 100644 LUFA/Drivers/Peripheral/SerialStream.c create mode 100644 LUFA/Drivers/Peripheral/SerialStream.h delete mode 100644 LUFA/Drivers/Peripheral/Serial_Stream.c delete mode 100644 LUFA/Drivers/Peripheral/Serial_Stream.h diff --git a/Demos/Device/RNDISEthernet/ProtocolDecoders.h b/Demos/Device/RNDISEthernet/ProtocolDecoders.h index c8101162d..fa0a869eb 100644 --- a/Demos/Device/RNDISEthernet/ProtocolDecoders.h +++ b/Demos/Device/RNDISEthernet/ProtocolDecoders.h @@ -39,7 +39,7 @@ /* Includes: */ #include - #include + #include #include "EthernetProtocols.h" #include "Ethernet.h" diff --git a/Demos/Device/RNDISEthernet/RNDISEthernet.h b/Demos/Device/RNDISEthernet/RNDISEthernet.h index 732ad5380..b3fd4dbd5 100644 --- a/Demos/Device/RNDISEthernet/RNDISEthernet.h +++ b/Demos/Device/RNDISEthernet/RNDISEthernet.h @@ -51,12 +51,11 @@ #include "ARP.h" #include "Webserver.h" - #include // Library Version Information - #include // USB Functionality - #include // LEDs driver - #include // Simple scheduler for task management - - #include + #include // Library Version Information + #include // USB Functionality + #include // LEDs driver + #include // Simple scheduler for task management + #include // Serial stream driver /* Macros: */ /** Notification value to indicate that a frame is ready to be read by the host. */ diff --git a/Demos/Device/RNDISEthernet/makefile b/Demos/Device/RNDISEthernet/makefile index 23de96761..2b104641e 100644 --- a/Demos/Device/RNDISEthernet/makefile +++ b/Demos/Device/RNDISEthernet/makefile @@ -143,7 +143,7 @@ SRC = $(TARGET).c \ $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBInterrupt.c \ $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c \ $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/StdDescriptors.c \ - $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial_Stream.c \ + $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c \ $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c \ diff --git a/Demos/Host/CDCHost/CDCHost.h b/Demos/Host/CDCHost/CDCHost.h index 48f480791..3819540d6 100644 --- a/Demos/Host/CDCHost/CDCHost.h +++ b/Demos/Host/CDCHost/CDCHost.h @@ -46,7 +46,7 @@ #include // Library Version Information #include // ANSI Terminal Escape Codes #include // USB Functionality - #include // Serial stream driver + #include // Serial stream driver #include // LEDs driver #include // Simple scheduler for task management diff --git a/Demos/Host/CDCHost/makefile b/Demos/Host/CDCHost/makefile index 4c5dc1e43..9d36b0d1f 100644 --- a/Demos/Host/CDCHost/makefile +++ b/Demos/Host/CDCHost/makefile @@ -126,7 +126,7 @@ LUFA_PATH = ../../.. SRC = $(TARGET).c \ ConfigDescriptor.c \ $(LUFA_PATH)/LUFA/Scheduler/Scheduler.c \ - $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial_Stream.c \ + $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c \ $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c \ $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c \ $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c \ diff --git a/Demos/Host/GenericHIDHost/GenericHIDHost.h b/Demos/Host/GenericHIDHost/GenericHIDHost.h index 008188a61..3ae473e00 100644 --- a/Demos/Host/GenericHIDHost/GenericHIDHost.h +++ b/Demos/Host/GenericHIDHost/GenericHIDHost.h @@ -47,7 +47,7 @@ #include // Library Version Information #include // ANSI Terminal Escape Codes #include // USB Functionality - #include // Serial stream driver + #include // Serial stream driver #include // LEDs driver #include // Simple scheduler for task management diff --git a/Demos/Host/GenericHIDHost/makefile b/Demos/Host/GenericHIDHost/makefile index d54317a69..49d4867d5 100644 --- a/Demos/Host/GenericHIDHost/makefile +++ b/Demos/Host/GenericHIDHost/makefile @@ -126,7 +126,7 @@ LUFA_PATH = ../../.. SRC = $(TARGET).c \ ConfigDescriptor.c \ $(LUFA_PATH)/LUFA/Scheduler/Scheduler.c \ - $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial_Stream.c \ + $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c \ $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c \ $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c \ $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c \ diff --git a/Demos/Host/KeyboardHost/KeyboardHost.h b/Demos/Host/KeyboardHost/KeyboardHost.h index 14d92c0c6..6a601439a 100644 --- a/Demos/Host/KeyboardHost/KeyboardHost.h +++ b/Demos/Host/KeyboardHost/KeyboardHost.h @@ -47,7 +47,7 @@ #include // Library Version Information #include // ANSI Terminal Escape Codes #include // USB Functionality - #include // Serial stream driver + #include // Serial stream driver #include // LEDs driver #include // Simple scheduler for task management diff --git a/Demos/Host/KeyboardHost/makefile b/Demos/Host/KeyboardHost/makefile index 9d65c436e..e74cc4d70 100644 --- a/Demos/Host/KeyboardHost/makefile +++ b/Demos/Host/KeyboardHost/makefile @@ -126,7 +126,7 @@ LUFA_PATH = ../../.. SRC = $(TARGET).c \ ConfigDescriptor.c \ $(LUFA_PATH)/LUFA/Scheduler/Scheduler.c \ - $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial_Stream.c \ + $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c \ $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c \ $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c \ $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c \ diff --git a/Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.h b/Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.h index d142bda9d..a0e055fa6 100644 --- a/Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.h +++ b/Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.h @@ -41,7 +41,7 @@ #include // Library Version Information #include // ANSI Terminal Escape Codes #include // USB Functionality - #include // Serial stream driver + #include // Serial stream driver #include // LEDs driver #include // Simple scheduler for task management diff --git a/Demos/Host/KeyboardHostWithParser/makefile b/Demos/Host/KeyboardHostWithParser/makefile index 7a74768d7..9768b4bbd 100644 --- a/Demos/Host/KeyboardHostWithParser/makefile +++ b/Demos/Host/KeyboardHostWithParser/makefile @@ -127,7 +127,7 @@ SRC = $(TARGET).c \ ConfigDescriptor.c \ HIDReport.c \ $(LUFA_PATH)/LUFA/Scheduler/Scheduler.c \ - $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial_Stream.c \ + $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c \ $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c \ $(LUFA_PATH)/LUFA/Drivers/USB/Class/HIDParser.c \ $(LUFA_PATH)/LUFA/Drivers/USB/Class/ConfigDescriptor.c \ diff --git a/Demos/Host/MassStorageHost/MassStorageHost.h b/Demos/Host/MassStorageHost/MassStorageHost.h index 3791d2734..ab5fcb22a 100644 --- a/Demos/Host/MassStorageHost/MassStorageHost.h +++ b/Demos/Host/MassStorageHost/MassStorageHost.h @@ -50,7 +50,7 @@ #include // Library Version Information #include // ANSI Terminal Escape Codes #include // USB Functionality - #include // Serial stream driver + #include // Serial stream driver #include // LEDs driver #include // Hardware Button driver #include // Simple scheduler for task management diff --git a/Demos/Host/MassStorageHost/makefile b/Demos/Host/MassStorageHost/makefile index bfa40726f..dbd0d3285 100644 --- a/Demos/Host/MassStorageHost/makefile +++ b/Demos/Host/MassStorageHost/makefile @@ -127,7 +127,7 @@ SRC = $(TARGET).c \ ConfigDescriptor.c \ MassStoreCommands.c \ $(LUFA_PATH)/LUFA/Scheduler/Scheduler.c \ - $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial_Stream.c \ + $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c \ $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c \ $(LUFA_PATH)/LUFA/Drivers/USB/Class/ConfigDescriptor.c \ $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c \ diff --git a/Demos/Host/MouseHost/MouseHost.h b/Demos/Host/MouseHost/MouseHost.h index a87d6f874..81b0412c5 100644 --- a/Demos/Host/MouseHost/MouseHost.h +++ b/Demos/Host/MouseHost/MouseHost.h @@ -47,7 +47,7 @@ #include // Library Version Information #include // ANSI Terminal Escape Codes #include // USB Functionality - #include // Serial stream driver + #include // Serial stream driver #include // LEDs driver #include // Simple scheduler for task management diff --git a/Demos/Host/MouseHost/makefile b/Demos/Host/MouseHost/makefile index bde4df209..61d6437d5 100644 --- a/Demos/Host/MouseHost/makefile +++ b/Demos/Host/MouseHost/makefile @@ -126,7 +126,7 @@ LUFA_PATH = ../../.. SRC = $(TARGET).c \ ConfigDescriptor.c \ $(LUFA_PATH)/LUFA/Scheduler/Scheduler.c \ - $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial_Stream.c \ + $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c \ $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c \ $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c \ $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c \ diff --git a/Demos/Host/MouseHostWithParser/MouseHostWithParser.h b/Demos/Host/MouseHostWithParser/MouseHostWithParser.h index 746ffe159..99970e261 100644 --- a/Demos/Host/MouseHostWithParser/MouseHostWithParser.h +++ b/Demos/Host/MouseHostWithParser/MouseHostWithParser.h @@ -41,7 +41,7 @@ #include // Library Version Information #include // ANSI Terminal Escape Codes #include // USB Functionality - #include // Serial stream driver + #include // Serial stream driver #include // LEDs driver #include // Simple scheduler for task management diff --git a/Demos/Host/MouseHostWithParser/makefile b/Demos/Host/MouseHostWithParser/makefile index 5d9d2da4c..598ecf30a 100644 --- a/Demos/Host/MouseHostWithParser/makefile +++ b/Demos/Host/MouseHostWithParser/makefile @@ -127,7 +127,7 @@ SRC = $(TARGET).c \ ConfigDescriptor.c \ HIDReport.c \ $(LUFA_PATH)/LUFA/Scheduler/Scheduler.c \ - $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial_Stream.c \ + $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c \ $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c \ $(LUFA_PATH)/LUFA/Drivers/USB/Class/HIDParser.c \ $(LUFA_PATH)/LUFA/Drivers/USB/Class/ConfigDescriptor.c \ diff --git a/Demos/Host/StillImageHost/StillImageHost.h b/Demos/Host/StillImageHost/StillImageHost.h index a1ea47f62..4c9091cfe 100644 --- a/Demos/Host/StillImageHost/StillImageHost.h +++ b/Demos/Host/StillImageHost/StillImageHost.h @@ -48,7 +48,7 @@ #include // ANSI Terminal Escape Codes #include // USB Functionality - #include // Serial stream driver + #include // Serial stream driver #include // LED driver #include // Simple scheduler for task management diff --git a/Demos/Host/StillImageHost/makefile b/Demos/Host/StillImageHost/makefile index 82aa7284d..3b1f48679 100644 --- a/Demos/Host/StillImageHost/makefile +++ b/Demos/Host/StillImageHost/makefile @@ -126,7 +126,7 @@ SRC = $(TARGET).c \ ConfigDescriptor.c \ StillImageCommands.c \ $(LUFA_PATH)/LUFA/Scheduler/Scheduler.c \ - $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial_Stream.c \ + $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c \ $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c \ $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c \ $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c \ diff --git a/Demos/OTG/TestApp/TestApp.h b/Demos/OTG/TestApp/TestApp.h index 5e88dae61..d5ce8dd3a 100644 --- a/Demos/OTG/TestApp/TestApp.h +++ b/Demos/OTG/TestApp/TestApp.h @@ -48,7 +48,7 @@ #include // Auto-defragmenting Dynamic Memory allocation #include // ANSI Terminal Escape Codes #include // ADC driver - #include // USART Stream driver + #include // USART Stream driver #include // Joystick driver #include // LED driver #include // Hardware Button driver diff --git a/Demos/OTG/TestApp/TestEvents.h b/Demos/OTG/TestApp/TestEvents.h index adaf87595..b5a83ed8f 100644 --- a/Demos/OTG/TestApp/TestEvents.h +++ b/Demos/OTG/TestApp/TestEvents.h @@ -42,7 +42,7 @@ #include // Commonly used macros #include // USB Functionality #include // LED driver - #include // USART Stream driver + #include // USART Stream driver #include // ANSI Terminal Escape Codes #include // Simple scheduler for task management diff --git a/Demos/OTG/TestApp/makefile b/Demos/OTG/TestApp/makefile index a7429669e..c4b436df4 100644 --- a/Demos/OTG/TestApp/makefile +++ b/Demos/OTG/TestApp/makefile @@ -129,7 +129,7 @@ SRC = $(TARGET).c \ $(LUFA_PATH)/LUFA/Scheduler/Scheduler.c \ $(LUFA_PATH)/LUFA/MemoryAllocator/DynAlloc.c \ $(LUFA_PATH)/LUFA/Drivers/Board/Temperature.c \ - $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial_Stream.c \ + $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c \ $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c \ $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c \ $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c \ diff --git a/LUFA.pnproj b/LUFA.pnproj index d00f45f7e..55457f518 100644 --- a/LUFA.pnproj +++ b/LUFA.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/LUFA/ChangeLog.txt b/LUFA/ChangeLog.txt index 760aec241..115a04a12 100644 --- a/LUFA/ChangeLog.txt +++ b/LUFA/ChangeLog.txt @@ -47,7 +47,7 @@ * - Updated library doxygen documentation, added groups, changed documentation macro functions to real functions for clarity * - Removed old endpoint and pipe aliased read/write/discard routines which did not have an explicit endian specifier for clarity * - Removed the ButtLoadTag.h header file, as no one used for its intended purpose anyway - * - Renamed the main Drivers/AT90USBXXX directory to Drivers/Peripheral + * - Renamed the main Drivers/AT90USBXXX directory to Drivers/Peripheral, renamed the Serial_Stream driver to SerialStream * * * \section Sec_ChangeLog090401 Version 090401 diff --git a/LUFA/Common/Common.h b/LUFA/Common/Common.h index 0923d513b..24ba1f68b 100644 --- a/LUFA/Common/Common.h +++ b/LUFA/Common/Common.h @@ -103,7 +103,7 @@ #define JTAG_DEBUG_ASSERT(x) MACROS{ if (!(x)) { JTAG_DEBUG_BREAK(); } }MACROE /** Macro for testing condition "x" and writing debug data to the serial stream if false. As a - * prerequisite for this macro, the serial stream should be configured via the Serial_Stream driver. + * prerequisite for this macro, the serial stream should be configured via the Peripheral/SerialStream driver. * * The serial output takes the form "{FILENAME}: Function {FUNCTION NAME}, Line {LINE NUMBER}: Assertion * {x} failed." diff --git a/LUFA/Drivers/Peripheral/SerialStream.c b/LUFA/Drivers/Peripheral/SerialStream.c new file mode 100644 index 000000000..fec5f7314 --- /dev/null +++ b/LUFA/Drivers/Peripheral/SerialStream.c @@ -0,0 +1,45 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2009. + + dean [at] fourwalledcubicle [dot] com + www.fourwalledcubicle.com +*/ + +/* + Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, and distribute this software + and its documentation for any purpose and without fee is hereby + granted, provided that the above copyright notice appear in all + copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +#include "SerialStream.h" + +FILE USARTStream = FDEV_SETUP_STREAM(SerialStream_TxByte, SerialStream_RxByte, _FDEV_SETUP_RW); + +int SerialStream_TxByte(char DataByte, FILE *Stream) +{ + Serial_TxByte(DataByte); + + return 0; +} + +int SerialStream_RxByte(FILE *Stream) +{ + return Serial_RxByte(); +} diff --git a/LUFA/Drivers/Peripheral/SerialStream.h b/LUFA/Drivers/Peripheral/SerialStream.h new file mode 100644 index 000000000..394fd081d --- /dev/null +++ b/LUFA/Drivers/Peripheral/SerialStream.h @@ -0,0 +1,93 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2009. + + dean [at] fourwalledcubicle [dot] com + www.fourwalledcubicle.com +*/ + +/* + Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, and distribute this software + and its documentation for any purpose and without fee is hereby + granted, provided that the above copyright notice appear in all + copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * Serial stream driver for the USART subsystem on supported USB AVRs. This makes use of the functions in the + * regular USART driver, but allows the avr-libc standard stream functions (printf, puts, etc.) to work with the + * USART. + **/ + +/** \ingroup Group_SubsystemDrivers + * @defgroup Group_SerialStream Serial Stream Driver - LUFA/Drivers/Peripheral/SerialStream.h + * + * Functions, macros, variables, enums and types related to the setup of a serial stream, so that standard printf and other + * C stream functions can be used on the serial port. + * + * @{ + */ + +#ifndef __SERIAL_STREAM_H__ +#define __SERIAL_STREAM_H__ + + /* Includes: */ + #include + #include + + #include "Serial.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Private Interface - For use in library only: */ + #if !defined(__DOXYGEN__) + /* External Variables: */ + extern FILE USARTStream; + + /* Function Prototypes: */ + int SerialStream_TxByte(char DataByte, FILE *Stream) ATTR_NON_NULL_PTR_ARG(2); + int SerialStream_RxByte(FILE *Stream) ATTR_NON_NULL_PTR_ARG(1); + #endif + + /* Public Interface - May be used in end-application: */ + /* Inline Functions: */ + /** Initializes the serial stream (and regular USART driver) so that both the stream and regular + * USART driver functions can be used. Must be called before any stream or regular USART functions. + * + * \param BaudRate Baud rate to configure the USART to + * \param DoubleSpeed Enables double speed mode when set, halving the sample time to double the baud rate + */ + static inline void SerialStream_Init(const uint32_t BaudRate, const bool DoubleSpeed) + { + Serial_Init(BaudRate, DoubleSpeed); + + stdout = &USARTStream; + } + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ diff --git a/LUFA/Drivers/Peripheral/Serial_Stream.c b/LUFA/Drivers/Peripheral/Serial_Stream.c deleted file mode 100644 index d986af424..000000000 --- a/LUFA/Drivers/Peripheral/Serial_Stream.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2009. - - dean [at] fourwalledcubicle [dot] com - www.fourwalledcubicle.com -*/ - -/* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaim all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -#include "Serial_Stream.h" - -FILE USARTStream = FDEV_SETUP_STREAM(SerialStream_TxByte, SerialStream_RxByte, _FDEV_SETUP_RW); - -int SerialStream_TxByte(char DataByte, FILE *Stream) -{ - Serial_TxByte(DataByte); - - return 0; -} - -int SerialStream_RxByte(FILE *Stream) -{ - return Serial_RxByte(); -} diff --git a/LUFA/Drivers/Peripheral/Serial_Stream.h b/LUFA/Drivers/Peripheral/Serial_Stream.h deleted file mode 100644 index 406cbed88..000000000 --- a/LUFA/Drivers/Peripheral/Serial_Stream.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2009. - - dean [at] fourwalledcubicle [dot] com - www.fourwalledcubicle.com -*/ - -/* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaim all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * Serial stream driver for the USART subsystem on supported USB AVRs. This makes use of the functions in the - * regular USART driver, but allows the avr-libc standard stream functions (printf, puts, etc.) to work with the - * USART. - **/ - -/** \ingroup Group_SubsystemDrivers - * @defgroup Group_SerialStream Serial Stream Driver - LUFA/Drivers/Peripheral/Serial_Stream.h - * - * Functions, macros, variables, enums and types related to the setup of a serial stream, so that standard printf and other - * C stream functions can be used on the serial port. - * - * @{ - */ - -#ifndef __SERIAL_STREAM_H__ -#define __SERIAL_STREAM_H__ - - /* Includes: */ - #include - #include - - #include "Serial.h" - - /* Enable C linkage for C++ Compilers: */ - #if defined(__cplusplus) - extern "C" { - #endif - - /* Private Interface - For use in library only: */ - #if !defined(__DOXYGEN__) - /* External Variables: */ - extern FILE USARTStream; - - /* Function Prototypes: */ - int SerialStream_TxByte(char DataByte, FILE *Stream) ATTR_NON_NULL_PTR_ARG(2); - int SerialStream_RxByte(FILE *Stream) ATTR_NON_NULL_PTR_ARG(1); - #endif - - /* Public Interface - May be used in end-application: */ - /* Inline Functions: */ - /** Initializes the serial stream (and regular USART driver) so that both the stream and regular - * USART driver functions can be used. Must be called before any stream or regular USART functions. - * - * \param BaudRate Baud rate to configure the USART to - * \param DoubleSpeed Enables double speed mode when set, halving the sample time to double the baud rate - */ - static inline void SerialStream_Init(const uint32_t BaudRate, const bool DoubleSpeed) - { - Serial_Init(BaudRate, DoubleSpeed); - - stdout = &USARTStream; - } - - /* Disable C linkage for C++ Compilers: */ - #if defined(__cplusplus) - } - #endif - -#endif - -/** @} */ diff --git a/LUFA/MigrationInformation.txt b/LUFA/MigrationInformation.txt index 8b8e416f5..f0930a55e 100644 --- a/LUFA/MigrationInformation.txt +++ b/LUFA/MigrationInformation.txt @@ -16,6 +16,7 @@ * - The ButtLoadTag.h header has been removed, as it was never used for its intended purpose. Projects should either remove all * BUTTLOADTAG elements, or download and extract ButtLoadTag.h header from the ButtLoad project. * - The Drivers/AT90USBXXX directory has been renamed to Drivers/Peripheral. + * - The Serial_Stream driver has been renamed to SerialStream to remain consistent with the rest of the library naming scheme. * * Library Demos * - Most demos, bootloaders and applications have had significant changes from previous versions. Applications built off of any diff --git a/LUFA/makefile b/LUFA/makefile index 25f7b3787..3e1ce85b7 100644 --- a/LUFA/makefile +++ b/LUFA/makefile @@ -24,7 +24,7 @@ LUFA_SRC_FILES = ./Drivers/USB/LowLevel/LowLevel.c \ ./MemoryAllocator/DynAlloc.c \ ./Drivers/Board/Temperature.c \ ./Drivers/Peripheral/Serial.c \ - ./Drivers/Peripheral/Serial_Stream.c \ + ./Drivers/Peripheral/SerialStream.c \ all: -- cgit v1.2.3