X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/d540276b448ff70bd70f54b1ce015cbb951c76c0..1e8df8951a3335e4b45ad0c25a82df3d90d785f3:/LUFA/Drivers/Peripheral/SPI.h 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