flash25.h File Reference

Function library for serial Flash memory. More...

#include <kern/kfile.h>
#include <cfg/compiler.h>
#include <appconfig.h>

Go to the source code of this file.


Defines

#define FLASH25_AT25F2048   1
 Memory definition.

Typedefs

typedef uint32_t flash25Addr_t
 Type definition for serial flash memory.

Enumerations

enum  Flash25Opcode {
  FLASH25_WREN = 0x6, FLASH25_WRDI = 0x4, FLASH25_RDSR = 0x5, FLASH25_WRSR = 0x1,
  FLASH25_READ = 0x3, FLASH25_PROGRAM = 0x2, FLASH25_SECTORE_ERASE = 0x52, FLASH25_CHIP_ERASE = 0x62,
  FLASH25_RDID = 0x15
}
 Serial flash opcode commands. More...
enum  Flash25Sector { FLASH25_SECT1 = 0x0, FLASH25_SECT2 = 0x10000, FLASH25_SECT3 = 0x20000, FLASH25_SECT4 = 0x30000 }
 Serial flash sector memory address. More...

Functions

void flash25_init (struct KFile *fd, struct KFile *_channel)
 Init data flash memory interface.
void flash25_chipErase (void)
 Chip erase function.
void flash25_sectorErase (Flash25Sector sector)
 Sector erase function.

Detailed Description

Function library for serial Flash memory.

Version:
Id
flash25.h 1051 2008-01-16 16:35:25Z asterix
Author:
Daniele Basile <asterix@develer.com>

Definition in file flash25.h.


Define Documentation

#define FLASH25_AT25F2048   1

Memory definition.

Note:
Below are defined valid serial flash memory support to this drive. Every time we call flash25_init() function we check if memory defined are right (see flash25.c form more detail).

Definition at line 66 of file flash25.h.


Enumeration Type Documentation

Serial flash opcode commands.

Enumerator:
FLASH25_WREN  Set write enable latch.
FLASH25_WRDI  Reset enable write latch.
FLASH25_RDSR  Read status register.
FLASH25_WRSR  Write status register.
FLASH25_READ  Read data from memory array.
FLASH25_PROGRAM  Program data into memory array.
FLASH25_SECTORE_ERASE  Erase one sector in memory array.
FLASH25_CHIP_ERASE  Erase all sector in memory array.
FLASH25_RDID  Read Manufacturer and product ID.

Definition at line 86 of file flash25.h.

Serial flash sector memory address.

Enumerator:
FLASH25_SECT1  Sector 1 (0x0 -0xFFFF).
FLASH25_SECT2  Sector 2 (0x10000 -0x1FFFF).
FLASH25_SECT3  Sector 3 (0x20000 -0x2FFFF).
FLASH25_SECT4  Sector 4 (0x30000 -0x3FFFF).

Definition at line 105 of file flash25.h.


Function Documentation

void flash25_chipErase ( void   ) 

Chip erase function.

Erase all sector of serial flash memory.

Note:
This operation could take a while.

Definition at line 348 of file flash25.c.

void flash25_sectorErase ( Flash25Sector  sector  ) 

Sector erase function.

Erase a select sector of serial flash memory.

Note:
A sector size is FLASH25_SECTOR_SIZE. This operation could take a while.

Definition at line 301 of file flash25.c.