X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/77dbfd3cc44b91ea04990c65f3de70267ceb2460..cdd4e11fa8559fc7fbea54f29310f6a2307d075c:/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h?ds=sidebyside diff --git a/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h b/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h index 42b9b77f5..8b65e6238 100644 --- a/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h +++ b/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h @@ -29,7 +29,7 @@ */ /** \file - * \brief Board specific Dataflash driver header for the Atmel XPLAIN. + * \brief Board specific Dataflash driver header for the original Atmel XPLAIN. * \copydetails Group_Dataflash_XPLAIN * * \note This file should not be included directly. It is automatically included as needed by the dataflash driver @@ -38,7 +38,9 @@ /** \ingroup Group_Dataflash * \defgroup Group_Dataflash_XPLAIN XPLAIN - * \brief Board specific Dataflash driver header for the Atmel XPLAIN. + * \brief Board specific Dataflash driver header for the original Atmel XPLAIN. + * + * \note For the first revision XPLAIN board, compile with BOARD = BOARD_XPLAIN_REV1. * * Board specific Dataflash driver header for the Atmel XPLAIN. * @@ -98,6 +100,38 @@ DATAFLASH_CHIPCS_PORT |= DATAFLASH_CHIPCS_MASK; } + /** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash. + * + * \param[in] Byte of data to send to the dataflash + * + * \return Last response byte from the dataflash + */ + static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; + static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) + { + return SPI_TransferByte(Byte); + } + + /** Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash. + * + * \param[in] Byte of data to send to the dataflash + */ + static inline void Dataflash_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; + static inline void Dataflash_SendByte(const uint8_t Byte) + { + SPI_SendByte(Byte); + } + + /** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash. + * + * \return Last response byte from the dataflash + */ + static inline uint8_t Dataflash_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; + static inline uint8_t Dataflash_ReceiveByte(void) + { + return SPI_ReceiveByte(); + } + /** Determines the currently selected dataflash chip. * * \return Mask of the currently selected Dataflash chip, either \ref DATAFLASH_NO_CHIP if no chip is selected