#include <kernel.h>
#include <device.h>
#include <flash.h>
|
devcall | logicalRead (struct flash *, uchar *, ulong) |
|
devcall | flashRead (device *devptr, uchar *buffer, ulong block) |
|
A simple, high-level interface to read from flash.
devcall flashRead |
( |
device * |
devptr, |
|
|
uchar * |
buffer, |
|
|
ulong |
block |
|
) |
| |
Provides a simple way to read in the contents of a block
- Parameters
-
*devptr | pointer to the flash device |
*buffer | buffer to store contents into (should be flash->log_size) |
block | block number to read in |
- Returns
- OK on success, SYSERR on failure
devcall logicalRead |
( |
struct flash * |
flash, |
|
|
uchar * |
buffer, |
|
|
ulong |
block |
|
) |
| |
With a logical block address, read in the contents of the block into the buffer. This will check if the erase-block is already in memory and if so simply read from the cached copy, if it is not read it into memory and read the specified block. If there is no more room in memory to store an erase-block it will automatically write to the oldest erase-block to flash and read in the requested block.
- Parameters
-
*flash | flash device to read on. |
*buffer | buffer to read into. |
block | block to read on device. |
- Returns
- number of bytes read or SYSERR on failure