aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/Peripheral/SPI.h
diff options
context:
space:
mode:
Diffstat (limited to 'LUFA/Drivers/Peripheral/SPI.h')
-rw-r--r--LUFA/Drivers/Peripheral/SPI.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/LUFA/Drivers/Peripheral/SPI.h b/LUFA/Drivers/Peripheral/SPI.h
index 6048d86a6..df741d7b8 100644
--- a/LUFA/Drivers/Peripheral/SPI.h
+++ b/LUFA/Drivers/Peripheral/SPI.h
@@ -108,6 +108,16 @@
SPSR &= ~(1 << SPI2X);
}
+ /** Turns off the SPI driver, disabling and returning used hardware to their default configuration. */
+ static inline void SPI_ShutDown(void)
+ {
+ DDRB &= ~((1 << 1) | (1 << 2));
+ PORTB &= ~((1 << 0) | (1 << 3));
+
+ SPCR = 0;
+ SPSR = 0;
+ }
+
/** Sends and receives a byte through the SPI interface, blocking until the transfer is complete.
*
* \param[in] Byte Byte to send through the SPI interface