X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/11bb2f21720c2af4b29732ca128963869e5c512c..7aecda6fda5bcced68d72b0cf73d00174aa5c7cd:/LUFA/Drivers/Peripheral/SerialStream.h?ds=sidebyside diff --git a/LUFA/Drivers/Peripheral/SerialStream.h b/LUFA/Drivers/Peripheral/SerialStream.h index 394fd081d..d93ea529e 100644 --- a/LUFA/Drivers/Peripheral/SerialStream.h +++ b/LUFA/Drivers/Peripheral/SerialStream.h @@ -35,11 +35,17 @@ * USART. **/ -/** \ingroup Group_SubsystemDrivers +/** \ingroup Group_PeripheralDrivers * @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. + * \section Sec_Dependencies Module Source Dependencies + * The following files must be built with any user project that uses this module: + * - LUFA/Drivers/Peripheral/SerialStream.c + * + * \section Module Description + * 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. * * @{ */ @@ -64,8 +70,10 @@ 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); + #if defined(INCLUDE_FROM_SERIALSTREAM_C) + static int SerialStream_TxByte(char DataByte, FILE *Stream) ATTR_NON_NULL_PTR_ARG(2); + static int SerialStream_RxByte(FILE *Stream) ATTR_NON_NULL_PTR_ARG(1); + #endif #endif /* Public Interface - May be used in end-application: */ @@ -73,8 +81,8 @@ /** 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 + * \param[in] BaudRate Baud rate to configure the USART to + * \param[in] 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) { @@ -82,6 +90,14 @@ stdout = &USARTStream; } + + /** Turns off the serial stream (and regular USART driver), disabling and returning used hardware to + * their default configuration. + */ + static inline void SerialStream_ShutDown(void) + { + Serial_ShutDown(); + } /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus)