X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/312748702a0f87f79c6e86745d3699d09a91778c..be9d0a5aa97c84cc8723f69f2b88576965e386aa:/LUFA/Drivers/Peripheral/Serial.h?ds=inline diff --git a/LUFA/Drivers/Peripheral/Serial.h b/LUFA/Drivers/Peripheral/Serial.h index e688cfc02..bde1449e8 100644 --- a/LUFA/Drivers/Peripheral/Serial.h +++ b/LUFA/Drivers/Peripheral/Serial.h @@ -118,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