SAM3S8/SD8 Software Package: libraries/memories/include/NorFlashAmd.h Source File

SAM3S8/SD8 Software Package 1.2

# NorFlashAmd.h

Go to the documentation of this file.

    00001 /* ----------------------------------------------------------------------------
    00002  *         ATMEL Microcontroller Software Support
    00003  * ----------------------------------------------------------------------------
    00004  * Copyright (c) 2009, Atmel Corporation
    00005  *
    00006  * All rights reserved.
    00007  *
    00008  * Redistribution and use in source and binary forms, with or without
    00009  * modification, are permitted provided that the following conditions are met:
    00010  *
    00011  * - Redistributions of source code must retain the above copyright notice,
    00012  * this list of conditions and the disclaimer below.
    00013  *
    00014  * Atmel's name may not be used to endorse or promote products derived from
    00015  * this software without specific prior written permission.
    00016  *
    00017  * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
    00018  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    00019  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
    00020  * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
    00021  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    00022  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
    00023  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    00024  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    00025  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    00026  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    00027  * ----------------------------------------------------------------------------
    00028  */
    00029
    00030 /**
    00031  * \file
    00032  *
    00033  * \section Purpose
    00034  *
    00035  * The AMD %norflash Low-level driver code implement procedures to program
    00036  * basic operations described AMD-specified command set flash devices.
    00037  * The various commands recognized by the devices are listed in the Commands
    00038  * Tables provided in the corresponding AMD command set compatible flash
    00039  * datasheets. All operation functions are blocked, they wait for the
    00040  * completion of an operation by polling the status register.
    00041  *
    00042  * \section Usage
    00043  * -# Flash program using AMD_Write_Data().
    00044  *    - The Program command is used to modify the data stored at the
    00045  *      specified device address. Programming can only change bits
    00046  *      from ¡®1¡¯ to ¡®0¡¯. It may be necessary to erase the block before
    00047  *      programming to addresses within it. Programming modifies a single
    00048  *      Word at a time using static function amd_Program(). Programming
    00049  *      larger amounts of data must be done in one Word at a time by
    00050  *      giving a Program command, waiting for the command to complete,
    00051  *      giving the next Program command and so on.
    00052  * -# erase a block within the flash using AMD_EraseSector().
    00053  *    - Flash erase is performed on a block basis. An entire block is
    00054  *      erased each time an erase command sequence is given.
    00055  * -# erase whole blocks within the flash using AMD_EraseChip().
    00056  * -# AMD_Reset() function can be issued, between Bus Write cycles
    00057  *    before the start of a program or erase operation, to return the
    00058  *    device to read mode.
    00059  * -# AMD_ReadDeviceID() is used to retrieve information
    00060  *    about the Flash Device type.
    00061  * -# AMD_ReadManufactoryId() is used to retrieve information
    00062  *    about the Flash Device Manufactory ID.
    00063  */
    00064
    00065 #ifndef _NORFLASH_AMD_
    00066 #define _NORFLASH_AMD_
    00067
    00068 #include "NorFlashApi.h"
    00069
    00070 #include <stdint.h>
    00071
    00072 /*----------------------------------------------------------------------------
    00073  *        Local functions
    00074  *----------------------------------------------------------------------------*/
    00075
    00076 void AMD_Reset( NorFlashInfo *pNorFlashInfo, uint32_t address);
    00077
    00078 uint32_t AMD_ReadManufactoryId( NorFlashInfo *pNorFlashInfo);
    00079
    00080 uint32_t AMD_ReadDeviceID( NorFlashInfo *pNorFlashInfo);
    00081
    00082 uint8_t AMD_EraseSector( NorFlashInfo *pNorFlashInfo, uint32_t sectorAddr);
    00083
    00084 uint8_t AMD_EraseChip( NorFlashInfo *pNorFlashInfo);
    00085
    00086 uint8_t AMD_Write_Data( NorFlashInfo *pNorFlashInfo, uint32_t address, uint8_t *buffer, uint32_t size ) ;
    00087
    00088 void AMD_UnlockSector( NorFlashInfo *pNorFlashInfo, uint32_t address );
    00089
    00090 extern const NorFlashOperations amdOperations ;
    00091
    00092 #endif /* #ifndef _NORFLASH_AMD_ */

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines