SAMV71 Xplained Ultra Software Package 1.0

NandSpareScheme.h

Go to the documentation of this file.
00001 /* ----------------------------------------------------------------------------
00002  *         ATMEL Microcontroller Software Support
00003  * ----------------------------------------------------------------------------
00004  * Copyright (c) 2010, 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  *  Include Defines & macros for the nand flash spare scheme.
00034  */
00035 
00036 #ifndef NANDSPARESCHEME_H
00037 #define NANDSPARESCHEME_H
00038 
00039 /*----------------------------------------------------------------------------
00040  *        Headers
00041  *----------------------------------------------------------------------------*/
00042 
00043 #include "NandCommon.h"
00044 
00045 /*----------------------------------------------------------------------------
00046  *        Type
00047  *----------------------------------------------------------------------------*/
00048 
00049 struct NandSpareScheme {
00050 
00051     uint8_t badBlockMarkerPosition;
00052     uint8_t numEccBytes;
00053     uint8_t eccBytesPositions[NandCommon_MAXSPAREECCBYTES];
00054     uint8_t numExtraBytes;
00055     uint8_t extraBytesPositions[NandCommon_MAXSPAREEXTRABYTES];
00056 };
00057 
00058 /*----------------------------------------------------------------------------
00059  *        Exported variables
00060  *----------------------------------------------------------------------------*/
00061 extern const struct NandSpareScheme nandSpareScheme256;
00062 extern const struct NandSpareScheme nandSpareScheme512;
00063 extern const struct NandSpareScheme nandSpareScheme2048;
00064 extern const struct NandSpareScheme nandSpareScheme4096;
00065 
00066 /*----------------------------------------------------------------------------
00067  *        Exported function
00068  *----------------------------------------------------------------------------*/
00069 
00070 extern void NandSpareScheme_ReadBadBlockMarker(
00071     const struct NandSpareScheme *scheme,
00072     const uint8_t *spare,
00073     uint8_t *marker);
00074 
00075 extern void NandSpareScheme_WriteBadBlockMarker(
00076     const struct NandSpareScheme *scheme,
00077     uint8_t *spare,
00078     uint8_t marker);
00079 
00080 extern void NandSpareScheme_ReadEcc(
00081     const struct NandSpareScheme *scheme,
00082     const uint8_t *spare,
00083     uint8_t *ecc);
00084 
00085 extern void NandSpareScheme_WriteEcc(
00086     const struct NandSpareScheme *scheme,
00087     uint8_t *spare,
00088     const uint8_t *ecc);
00089 
00090 extern void NandSpareScheme_ReadExtra(
00091     const struct NandSpareScheme *scheme,
00092     const uint8_t *spare,
00093     void *extra,
00094     uint8_t size,
00095     uint8_t offset);
00096 
00097 extern void NandSpareScheme_WriteExtra(
00098     const struct NandSpareScheme *scheme,
00099     uint8_t *spare,
00100     const void *extra,
00101     uint8_t size,
00102     uint8_t offset);
00103 
00104 #endif /*#ifndef NANDSPARESCHEME_H*/
00105 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines