Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

Flashadds


Data Structures

struct  _FLASHDCB
struct  _FLASHICB

Defines

#define FLASH   13
#define SPI_CS_FLASH1   PORT5
#define SPI_CS_FLASH2   PORT6
#define PAGE_SIZE   0x0108

Functions

int FlashInit (NUTDEVICE *dev)
void flashWritePage (NUTDEVICE *dev, u_int pageNumber, u_char *page)
int flashReadPage (NUTDEVICE *dev, u_int pageNumber, u_char *page)
int FlashIOCtl (NUTDEVICE *dev, int req, void *conf)
void FlashFlush (NUTDEVICE *dev)

Variables

NUTDEVICE devFlashSpi

Detailed Description

This module is designed to manage virtual flash device, read and write flash pages. This driver may join two physical devices and manages it, making one virtual device. This driver uses spi driver to access hardware.

Define Documentation

#define FLASH   13
 

Unique device number.

#define PAGE_SIZE   0x0108
 

Flash page size. This is size of physical page in chip.

#define SPI_CS_FLASH1   PORT5
 

Pin number for CS of first flash chip.

#define SPI_CS_FLASH2   PORT6
 

Pin number for CS of second flash chip.


Function Documentation

void FlashFlush NUTDEVICE   dev
 

Wait until output buffer isn't empty. (not implemented yet).

Parameters:
dev  - flash device.

int FlashInit NUTDEVICE   dev
 

Method for initialize driver. Call it first.

Parameters:
dev  - pointer to driver control structure.
Returns:
0 - on success -1 on failed.

int FlashIOCtl NUTDEVICE   dev,
int    param,
void *    value
 

Sets driver parameters (not implemented yet).

Parameters:
dev  - pointer to driver control structure.
param  - parameter constat which define parameter name.
value  - pointer to structure
Returns:
0 - on success -1 on failed.

int flashReadPage NUTDEVICE   dev,
u_int    pageNumber,
u_char   page
 

Read data from flash.

Parameters:
dev  - pointer to flash device.
pageNumber  - logical number of page to read.
page  - pointer to buffer where data will be stored, buffor size is PAGE_SIZE.
Examples:
adds/app/flash.

void flashWritePage NUTDEVICE   dev,
u_int    pageNumber,
u_char   page
 

Write data to flash. Non blocking function. Copy data to write buffer, and return. Buffer will be written in background thread.

Parameters:
dev  - pointer to flash device.
pageNumber  - logical number of page to write.
page  - pointer to buffor which contains data to write, buffor size is PAGE_SIZE.
Examples:
adds/app/flash.


Variable Documentation

NUTDEVICE devFlashSpi
 

Driver control structure.


Generated on Thu Jan 30 22:30:56 2003 for EduNet by doxygen1.2.18