X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/f1076ac4d6e56bff7fb6d2126746af1108211370..0fdc1a2bc66f97048b94b967e80cd294189fca62:/LUFA/Drivers/Peripheral/Serial.h?ds=sidebyside diff --git a/LUFA/Drivers/Peripheral/Serial.h b/LUFA/Drivers/Peripheral/Serial.h index 82cbcfc2c..bde1449e8 100644 --- a/LUFA/Drivers/Peripheral/Serial.h +++ b/LUFA/Drivers/Peripheral/Serial.h @@ -41,7 +41,8 @@ * - LUFA/Drivers/Peripheral/Serial.c * * \section Module Description - * Functions, macros, variables, enums and types related to the setup of the USART for serial communications. + * Hardware serial USART driver. This module provides an easy to use driver for + * the setup of and transfer of data over the AVR's USART port. * * @{ */ @@ -117,6 +118,19 @@ UBRR1 = (DoubleSpeed ? SERIAL_2X_UBBRVAL(BaudRate) : SERIAL_UBBRVAL(BaudRate)); } + /** Turns off the USART driver, disabling and returning used hardware to their default configuration. */ + static inline void Serial_ShutDown(void) + { + UCSR1A = 0; + UCSR1B = 0; + UCSR1C = 0; + + DDRD &= ~(1 << 3); + PORTD &= ~(1 << 2); + + UBRR1 = 0; + } + /** Transmits a given byte through the USART. * * \param[in] DataByte Byte to transmit through the USART