Added V2Protocol handlers to the AVRISP project to enter/exit programming mode, and...
[pub/USBasp.git] / LUFA / Drivers / Peripheral / SPI.h
index 6048d86..df741d7 100644 (file)
                                  SPSR &= ~(1 << SPI2X);\r
                        }\r
                        \r
+                       /** Turns off the SPI driver, disabling and returning used hardware to their default configuration. */\r
+                       static inline void SPI_ShutDown(void)\r
+                       {\r
+                               DDRB  &= ~((1 << 1) | (1 << 2));\r
+                               PORTB &= ~((1 << 0) | (1 << 3));\r
+                               \r
+                               SPCR   = 0;\r
+                               SPSR   = 0;\r
+                       }\r
+                       \r
                        /** Sends and receives a byte through the SPI interface, blocking until the transfer is complete.\r
                         *\r
                         *  \param[in] Byte  Byte to send through the SPI interface\r