Flash Manager

Functions to control the ST MP25P80 serial flash device. More...


Defines

#define FLASH_CS   PIN_B3
 Flash Chip Select - Port B3.
#define FLASH_CLK   PIN_B5
 Flash Clock - Port B5.
#define FLASH_D   PIN_B4
 Flash Data Input - Port B4.
#define FLASH_Q   PIN_B2
 Flash Data Output - Port B2.

Functions

bool_t flashIsWriteInProgress ()
 Determine if a flash write or erase operation is currently in progress.
void flashReadBlock (uint32_t address, uint8_t *block, uint16_t length)
 Read a block of memory from the flash device.
void flashWriteBlock (uint32_t address, uint8_t *block, uint8_t length)
 Write a block of memory to the flash device.
void flashErase ()
 Erase the entire flash device (all locations set to 0xff).
uint8_t flashGetByte ()
 Read a single byte from the flash device through the serial interface.
void flashInit ()
 Initialize the flash memory subsystem.
void flashSendByte (uint8_t value)
 Write a single byte to the flash device through the serial interface.
void flashSendAddress (uint32_t address)
 Write the 24-bit address to the flash device through the serial interface.


Detailed Description

Functions to control the ST MP25P80 serial flash device.

Define Documentation

#define FLASH_CLK   PIN_B5

Flash Clock - Port B5.

Definition at line 1135 of file PicoBeacon.c.

Referenced by flashGetByte(), flashInit(), flashSendAddress(), and flashSendByte().

#define FLASH_CS   PIN_B3

Flash Chip Select - Port B3.

Definition at line 1132 of file PicoBeacon.c.

Referenced by flashErase(), flashInit(), flashIsWriteInProgress(), flashReadBlock(), and flashWriteBlock().

#define FLASH_D   PIN_B4

Flash Data Input - Port B4.

Definition at line 1138 of file PicoBeacon.c.

Referenced by flashInit(), flashSendAddress(), and flashSendByte().

#define FLASH_Q   PIN_B2

Flash Data Output - Port B2.

Definition at line 1141 of file PicoBeacon.c.

Referenced by flashGetByte().


Function Documentation

void flashErase (  ) 

Erase the entire flash device (all locations set to 0xff).

Definition at line 1245 of file PicoBeacon.c.

References FLASH_CS, flashIsWriteInProgress(), and flashSendByte().

Referenced by diagEraseFlash().

Here is the call graph for this function:

uint8_t flashGetByte (  ) 

Read a single byte from the flash device through the serial interface.

This function only controls the clock line. The chip select must be configured before calling this function.

Returns:
byte read from device

Definition at line 1267 of file PicoBeacon.c.

References FLASH_CLK, FLASH_Q, and value.

Referenced by flashIsWriteInProgress(), and flashReadBlock().

void flashInit (  ) 

Initialize the flash memory subsystem.

Definition at line 1294 of file PicoBeacon.c.

References FLASH_CLK, FLASH_CS, and FLASH_D.

Referenced by main().

bool_t flashIsWriteInProgress (  ) 

Determine if a flash write or erase operation is currently in progress.

Returns:
true if write/erase in progress

Definition at line 1148 of file PicoBeacon.c.

References FLASH_CS, flashGetByte(), and flashSendByte().

Referenced by flashErase(), and flashWriteBlock().

Here is the call graph for this function:

void flashReadBlock ( uint32_t  address,
uint8_t block,
uint16_t  length 
)

Read a block of memory from the flash device.

Parameters:
address of desired location in the range 0x00000 to 0xFFFFF (1MB)
block pointer to locate of data block
length number of bytes to read

Definition at line 1171 of file PicoBeacon.c.

References FLASH_CS, flashGetByte(), flashSendAddress(), and flashSendByte().

Referenced by diagReadFlash(), and logInit().

Here is the call graph for this function:

void flashSendAddress ( uint32_t  address  ) 

Write the 24-bit address to the flash device through the serial interface.

This function only controls the clock line. The chip select must be configured before calling this function.

Parameters:
address 24-bit flash device address

Definition at line 1338 of file PicoBeacon.c.

References FLASH_CLK, and FLASH_D.

Referenced by flashReadBlock(), and flashWriteBlock().

void flashSendByte ( uint8_t  value  ) 

Write a single byte to the flash device through the serial interface.

This function only controls the clock line. The chip select must be configured before calling this function.

Parameters:
value byte to write to device

Definition at line 1309 of file PicoBeacon.c.

References FLASH_CLK, and FLASH_D.

Referenced by flashErase(), flashIsWriteInProgress(), flashReadBlock(), and flashWriteBlock().

void flashWriteBlock ( uint32_t  address,
uint8_t block,
uint8_t  length 
)

Write a block of memory to the flash device.

Parameters:
address of desired location in the range 0x00000 to 0xFFFFF (1MB)
block pointer data block to write
length number of bytes to write

Definition at line 1194 of file PicoBeacon.c.

References FLASH_CS, flashIsWriteInProgress(), flashSendAddress(), and flashSendByte().

Referenced by logFlush().

Here is the call graph for this function:


Generated on Sun Oct 5 11:25:48 2008 for Pico Beacon by  doxygen 1.5.7