diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-08-23 04:01:49 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-08-23 04:01:49 +0000 |
commit | 1e8df8951a3335e4b45ad0c25a82df3d90d785f3 (patch) | |
tree | f331b6886dbc830352574d94d7693b9d73af939c /LUFA/Drivers/Peripheral/Serial.h | |
parent | d540276b448ff70bd70f54b1ce015cbb951c76c0 (diff) | |
download | lufa-1e8df8951a3335e4b45ad0c25a82df3d90d785f3.tar.gz lufa-1e8df8951a3335e4b45ad0c25a82df3d90d785f3.tar.bz2 lufa-1e8df8951a3335e4b45ad0c25a82df3d90d785f3.zip |
Added V2Protocol handlers to the AVRISP project to enter/exit programming mode, and read/write fuses, lockbits, OSCCAL and Signature bytes.
Added ShutDown functions for all hardware peripheral drivers, so that peripherals can be turned off after use.
Diffstat (limited to 'LUFA/Drivers/Peripheral/Serial.h')
-rw-r--r-- | LUFA/Drivers/Peripheral/Serial.h | 13 |
1 files changed, 13 insertions, 0 deletions
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
|