<< Previous | Next >>

flash_init

int flash_init( FlashDescriptor * fd, int mb3cr );

Description

Initializes an internal data structure of type FlashDescriptor with information about the flash memory chip. The Memory Interface Unit bank register (MB3CR) will be assigned the value of mb3cr whenever a function accesses the flash memory referenced by fd. See the Rabbit 2000 Users Manual for the correct chip select and wait state settings.

NOTE Improper use of this function can cause your program to be overwritten or operate incorrectly. This and the other flash memory access functions should not be used on the same flash memory that your program resides on, nor should they be used on the same region of a second flash memory where a file system resides.
NOTE Use WriteFlash() to write to the primary flash memory.

Parameters

fd
This is a pointer to an internal data structure that holds information about a flash memory chip.

mb3cr
This is the value to set MB3CR to whenever the flash memory is accessed. 0xc2 (i.e., CS2, /OE0, /WE0, 0 WS) is a typical setting for the second flash memory on the TCP/IP Dev Kit, the Intellicom, the Advanced Ethernet Core, and the RabbitLink.

Return value

 0: Success.
 1: Invalid flash memory type.
-1: Attempt made to initialize primary flash memory.

Library

FLASH.LIB

See also

flash_erasechip, flash_erasesector, flash_gettype, flash_read, flash_readsector, flash_sector2xwindow, flash_writesector


Dynamic C Functions << Previous | Next >> rabbit.com