Update Temperature board driver to be AVR32 compatible when the ADC peripheral driver...
[pub/USBasp.git] / LUFA / Drivers / Peripheral / AVR8 / SPI.h
index f466162..42ff8e7 100644 (file)
                         *  \param[in] SPIOptions  SPI Options, a mask consisting of one of each of the SPI_SPEED_*,\r
                         *                         SPI_SCK_*, SPI_SAMPLE_* and SPI_MODE_* masks\r
                         */\r
-                       static inline void SPI_Init(const uint8_t SPIOptions)\r
+                       static inline void SPI_Init(const uintN_t SPIOptions)\r
                        {\r
                                DDRB  |= ((1 << 1) | (1 << 2));\r
                                PORTB |= ((1 << 0) | (1 << 3));\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
+                        *  \param[in] Data  Byte to send through the SPI interface\r
                         *\r
                         *  \return Response byte from the attached SPI device\r
                         */\r
-                       static inline uint8_t SPI_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE;\r
-                       static inline uint8_t SPI_TransferByte(const uint8_t Byte)\r
+                       static inline uint8_t SPI_Transfer(const uint8_t Data) ATTR_ALWAYS_INLINE;\r
+                       static inline uint8_t SPI_Transfer(const uint8_t Data)\r
                        {\r
-                               SPDR = Byte;\r
+                               SPDR = Data;\r
                                while (!(SPSR & (1 << SPIF)));\r
                                return SPDR;\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[in] Byte Byte to send through the SPI interface\r
+                        *  \param[in] Data  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
+                       static inline void SPI_Send(const uint8_t Data) ATTR_ALWAYS_INLINE;\r
+                       static inline void SPI_Send(const uint8_t Data)\r
                        {\r
-                               SPDR = Byte;\r
+                               SPDR = Data;\r
                                while (!(SPSR & (1 << SPIF)));\r
                        }\r
 \r
                         *\r
                         *  \return The response byte from the attached SPI device\r
                         */\r
-                       static inline uint8_t SPI_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;\r
-                       static inline uint8_t SPI_ReceiveByte(void)\r
+                       static inline uint8_t SPI_Receive(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;\r
+                       static inline uint8_t SPI_Receive(void)\r
                        {\r
                                SPDR = 0x00;\r
                                while (!(SPSR & (1 << SPIF)));\r
                                return SPDR;\r
                        }\r
+       \r
+                       #if defined(__DOXYGEN__)\r
+                               /** Alias for \ref SPI_Transfer(), for compatibility with legacy LUFA applications. */\r
+                               static inline uint8_t SPI_TransferByte(const uint8_t Byte) ATTR_DEPRECATED;\r
+\r
+                               /** Alias for \ref SPI_Send(), for compatibility with legacy LUFA applications. */\r
+                               static inline void SPI_SendByte(const uint8_t Byte) ATTR_DEPRECATED;\r
+\r
+                               /** Alias for \ref SPI_Receive(), for compatibility with legacy LUFA applications. */\r
+                               static inline uint8_t SPI_ReceiveByte(void) ATTR_DEPRECATED;\r
+                       #else\r
+                               #define SPI_TransferByte(x)      SPI_Transfer(x)\r
+                               #define SPI_SendByte(x)          SPI_Send(x)\r
+                               #define SPI_ReceiveByte()        SPI_Receive()\r
+                       #endif\r
 \r
        /* Disable C linkage for C++ Compilers: */\r
                #if defined(__cplusplus)\r