Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- * This file is the master dispatch header file for the board-specific dataflash driver, for boards containing
- * dataflash ICs for external non-volatile storage.
+ * This file is the master dispatch header file for the board-specific Atmel dataflash driver, for boards containing
+ * Atmel Dataflash ICs for external non-volatile storage.
*
* User code should include this file, which will in turn include the correct dataflash driver header file for
* the currently selected board.
*
*
* User code should include this file, which will in turn include the correct dataflash driver header file for
* the currently selected board.
*
*
* \section Sec_Dependencies Module Source Dependencies
* The following files must be built with any user project that uses this module:
* - None
*
*
* \section Sec_Dependencies Module Source Dependencies
* The following files must be built with any user project that uses this module:
* - None
*
* Dataflash driver. This module provides an easy to use interface for the Dataflash ICs located on many boards,
* for the storage of large amounts of data into the Dataflash's non-volatile memory.
*
* Dataflash driver. This module provides an easy to use interface for the Dataflash ICs located on many boards,
* for the storage of large amounts of data into the Dataflash's non-volatile memory.
*
- * For possible BOARD makefile values, see \ref Group_BoardTypes.
+ * For possible \c BOARD makefile values, see \ref Group_BoardTypes.
+ *
+ * \section Sec_ExampleUsage Example Usage
+ * The following snippet is an example of how this module may be used within a typical
+ * application.
* \code
* // Initialise the SPI and board Dataflash drivers before first use
* SPI_Init(SPI_SPEED_FCPU_DIV_2 | SPI_ORDER_MSB_FIRST | SPI_SCK_LEAD_FALLING |
* \code
* // Initialise the SPI and board Dataflash drivers before first use
* SPI_Init(SPI_SPEED_FCPU_DIV_2 | SPI_ORDER_MSB_FIRST | SPI_SCK_LEAD_FALLING |
* printf("Committing page to non-volatile memory page index 5:\r\n");
* Dataflash_SendByte(DF_CMD_BUFF1TOMAINMEMWITHERASE);
* Dataflash_SendAddressBytes(5, 0);
* Dataflash_WaitWhileBusy();
*
* printf("Committing page to non-volatile memory page index 5:\r\n");
* Dataflash_SendByte(DF_CMD_BUFF1TOMAINMEMWITHERASE);
* Dataflash_SendAddressBytes(5, 0);
* Dataflash_WaitWhileBusy();
*
* printf("Reading data into second dataflash buffer:\r\n");
* Dataflash_SendByte(DF_CMD_MAINMEMTOBUFF2);
* Dataflash_SendAddressBytes(5, 0);
* printf("Reading data into second dataflash buffer:\r\n");
* Dataflash_SendByte(DF_CMD_MAINMEMTOBUFF2);
* Dataflash_SendAddressBytes(5, 0);
*/
static inline void Dataflash_Init(void);
/** Determines the currently selected dataflash chip.
*
* \return Mask of the currently selected Dataflash chip, either \ref DATAFLASH_NO_CHIP if no chip is selected
*/
static inline void Dataflash_Init(void);
/** Determines the currently selected dataflash chip.
*
* \return Mask of the currently selected Dataflash chip, either \ref DATAFLASH_NO_CHIP if no chip is selected
*/
static inline uint8_t Dataflash_GetSelectedChip(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
/** Selects the given dataflash chip.
*
*/
static inline uint8_t Dataflash_GetSelectedChip(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
/** Selects the given dataflash chip.
*
/** Selects a dataflash IC from the given page number, which should range from 0 to
* ((DATAFLASH_PAGES * DATAFLASH_TOTALCHIPS) - 1). For boards containing only one
/** Selects a dataflash IC from the given page number, which should range from 0 to
* ((DATAFLASH_PAGES * DATAFLASH_TOTALCHIPS) - 1). For boards containing only one
#elif (BOARD == BOARD_USBKEY)
#include "USBKEY/Dataflash.h"
#elif (BOARD == BOARD_STK525)
#elif (BOARD == BOARD_USBKEY)
#include "USBKEY/Dataflash.h"
#elif (BOARD == BOARD_STK525)
#include "XPLAIN/Dataflash.h"
#elif (BOARD == BOARD_EVK527)
#include "EVK527/Dataflash.h"
#include "XPLAIN/Dataflash.h"
#elif (BOARD == BOARD_EVK527)
#include "EVK527/Dataflash.h"