LUFA Custom Board Dataflash Hardware Driver (Template) More...
Macros | |
#define | DATAFLASH_CHIP1 |
#define | DATAFLASH_CHIP2 |
#define | DATAFLASH_NO_CHIP 0 |
#define | DATAFLASH_PAGE_SIZE |
#define | DATAFLASH_PAGES |
#define | DATAFLASH_TOTALCHIPS 1 |
Functions | |
static void | Dataflash_DeselectChip (void) ATTR_ALWAYS_INLINE |
static uint8_t | Dataflash_GetSelectedChip (void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT |
static void | Dataflash_Init (void) |
static uint8_t | Dataflash_ReceiveByte (void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT |
static void | Dataflash_SelectChip (const uint8_t ChipMask) ATTR_ALWAYS_INLINE |
static void | Dataflash_SelectChipFromPage (const uint16_t PageAddress) |
static void | Dataflash_SendAddressBytes (uint16_t PageAddress, const uint16_t BufferByte) |
static void | Dataflash_SendByte (const uint8_t Byte) ATTR_ALWAYS_INLINE |
static void | Dataflash_ToggleSelectedChipCS (void) |
static uint8_t | Dataflash_TransferByte (const uint8_t Byte) ATTR_ALWAYS_INLINE |
static void | Dataflash_WaitWhileBusy (void) |
This is a stub driver header file, for implementing custom board layout hardware with compatible LUFA board specific drivers. If the library is configured to use the BOARD_USER board mode, this driver file should be completed and copied into the "/Board/" folder inside the application's folder.
This stub is for the board-specific component of the LUFA Dataflash driver.
#define DATAFLASH_CHIP1 |
Mask for the first dataflash chip selected.
#define DATAFLASH_CHIP2 |
Mask for the second dataflash chip selected.
#define DATAFLASH_NO_CHIP 0 |
Mask for no dataflash chip selected.
#define DATAFLASH_PAGE_SIZE |
Internal main memory page size for the board's dataflash ICs.
#define DATAFLASH_PAGES |
Total number of pages inside each of the board's dataflash ICs.
#define DATAFLASH_TOTALCHIPS 1 |
Constant indicating the total number of dataflash ICs mounted on the selected board.
|
inlinestatic |
Deselects the current dataflash chip, so that no dataflash is selected.
|
inlinestatic |
Determines the currently selected dataflash chip.
|
inlinestatic |
Initializes the dataflash driver so that commands and data may be sent to an attached dataflash IC. The microcontroller's SPI driver MUST be initialized before any of the dataflash commands are used.
|
inlinestatic |
Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash.
|
inlinestatic |
Selects the given dataflash chip.
[in] | ChipMask | Mask of the Dataflash IC to select, in the form of a DATAFLASH_CHIPn mask (where n is the chip number). |
|
inlinestatic |
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 dataflash IC, this will select DATAFLASH_CHIP1. If the given page number is outside the total number of pages contained in the boards dataflash ICs, all dataflash ICs are deselected.
[in] | PageAddress | Address of the page to manipulate, ranging from 0 to ((DATAFLASH_PAGES * DATAFLASH_TOTALCHIPS) - 1). |
|
inlinestatic |
Sends a set of page and buffer address bytes to the currently selected dataflash IC, for use with dataflash commands which require a complete 24-bit address.
[in] | PageAddress | Page address within the selected dataflash IC |
[in] | BufferByte | Address within the dataflash's buffer |
|
inlinestatic |
Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash.
[in] | Byte | Byte of data to send to the dataflash |
|
inlinestatic |
Toggles the select line of the currently selected dataflash IC, so that it is ready to receive a new command.
|
inlinestatic |
Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash.
[in] | Byte | Byte of data to send to the dataflash |
|
inlinestatic |
Spin-loops while the currently selected dataflash is busy executing a command, such as a main memory page program or main memory to buffer transfer.