aboutsummaryrefslogtreecommitdiff
path: root/LUFA/CodeTemplates
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-11-01 06:06:41 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-11-01 06:06:41 +0000
commita9b7a71ae4ed3a7f74615c39975e3742113bd99c (patch)
tree31b31122131ccc4f7370565dc11ef54200552918 /LUFA/CodeTemplates
parent3c7d9f49e2d3b9d744f0d5a290db033dc0372c1e (diff)
Add partial support for the Atmel A3BU Xplained's Dataflash IC (physical USART-as-SPI transport driver still pending).
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1969 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/CodeTemplates')
-rw-r--r--LUFA/CodeTemplates/DriverStubs/Dataflash.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/LUFA/CodeTemplates/DriverStubs/Dataflash.h b/LUFA/CodeTemplates/DriverStubs/Dataflash.h
index 5edd26f6..4ab1b8dc 100644
--- a/LUFA/CodeTemplates/DriverStubs/Dataflash.h
+++ b/LUFA/CodeTemplates/DriverStubs/Dataflash.h
@@ -88,6 +88,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