orcus
|
NAND. More...
#include <stdint.h>
Macros | |
#define | NAND_BLOCK_SIZE 512 |
Number of bytes in a NAND block. | |
Functions | |
void | nandErase (uint32_t startAdddr, int numberOfBlocks) |
Erase blocks on NAND. More... | |
void | nandRead (uint32_t startAddr, int numberOfBlocks, void *dest) |
Read blocks from NAND. More... | |
void | nandWrite (uint32_t startAddr, int numberOfBlocks, void *src) |
Write blocks to NAND. More... | |
void nandErase | ( | uint32_t | startAdddr, |
int | numberOfBlocks | ||
) |
Erase (set to 0xFF) 512B blocks on NAND. You must do this before writing due to the nature of NAND storage where a write operating can only unset bits.
startAddr | Address to start erasing from (absolute, not in terms of blocks) |
numberOfBlocks | Number of 512B blocks to erase |
void nandRead | ( | uint32_t | startAddr, |
int | numberOfBlocks, | ||
void * | dest | ||
) |
Read 512B blocks from NAND.
startAddr | Address to start reading from (absolute, not in terms of blocks) |
numberOfBlocks | Number of 512B blocks to read |
dest | Pointer to memory location to store data |
void nandWrite | ( | uint32_t | startAddr, |
int | numberOfBlocks, | ||
void * | src | ||
) |
Write 512B blocks to NAND. You must first erase the blocks.
startAddr | Address to start start writing to (absolute, not in terms of blocks) |
numberOfBlocks | Number of 512B blocks to write |
src | Pointer to memory location holding data to write |