* Hardware SPI subsystem driver for the supported USB AVRs models.\r
*/\r
\r
-/** \ingroup Group_SubsystemDrivers\r
+/** \ingroup Group_PeripheralDrivers\r
* @defgroup Group_SPI SPI Driver - LUFA/Drivers/Peripheral/SPI.h\r
*\r
- * Functions, macros, variables, enums and types related to the setup of a the SPI port.\r
+ * \section Sec_Dependencies Module Source Dependencies\r
+ * The following files must be built with any user project that uses this module:\r
+ * - None\r
+ *\r
+ * \section Module Description\r
+ * Driver for the hardware SPI port avaliable on most AVR models. This module provides\r
+ * an easy to use driver for the setup of and transfer of data over the AVR's SPI port.\r
*\r
* @{\r
*/\r
/** Initializes the SPI subsystem, ready for transfers. Must be called before calling any other\r
* SPI routines.\r
*\r
- * \param PrescalerMask Prescaler mask to set the SPI clock speed\r
- * \param Master If true, sets the SPI system to use master mode, slave if false\r
+ * \param[in] PrescalerMask Prescaler mask to set the SPI clock speed\r
+ * \param[in] Master If true, sets the SPI system to use master mode, slave if false\r
*/\r
static inline void SPI_Init(const uint8_t PrescalerMask, const bool Master)\r
{\r
(PrescalerMask & ~SPI_USE_DOUBLESPEED));\r
\r
if (PrescalerMask & SPI_USE_DOUBLESPEED)\r
- SPSR = (1 << SPI2X);\r
+ SPSR |= (1 << SPI2X);\r
+ else\r
+ SPSR &= ~(1 << SPI2X);\r
}\r
\r
/** Sends and receives a byte through the SPI interface, blocking until the transfer is complete.\r
*\r
- * \param Byte Byte to send through the SPI interface\r
+ * \param[in] Byte Byte to send through the SPI interface\r
*\r
* \return Response byte from the attached SPI device\r
*/\r
/** Sends a byte through the SPI interface, blocking until the transfer is complete. The response\r
* byte sent to from the attached SPI device is ignored.\r
*\r
- * \param Byte Byte to send through the SPI interface\r
+ * \param[in] Byte Byte to send through the SPI interface\r
*/\r
static inline void SPI_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE;\r
static inline void SPI_SendByte(const uint8_t Byte)\r