Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef MAPPEDNANDFLASH_H
00036 #define MAPPEDNANDFLASH_H
00037
00038
00039
00040
00041
00042 #include "ManagedNandFlash.h"
00043
00044
00045
00046
00047
00048 struct MappedNandFlash {
00049
00050 struct ManagedNandFlash managed;
00051 int16_t logicalMapping[NandCommon_MAXNUMBLOCKS];
00052 int16_t logicalMappingBlock;
00053 uint8_t mappingModified;
00054 uint8_t reserved;
00055 };
00056
00057
00058
00059
00060
00061 extern uint8_t MappedNandFlash_Initialize(
00062 struct MappedNandFlash *mapped,
00063 const struct NandFlashModel *model,
00064 uint32_t commandAddress,
00065 uint32_t addressAddress,
00066 uint32_t dataAddress,
00067 const Pin pinChipEnable,
00068 const Pin pinReadyBusy,
00069 uint16_t baseBlock,
00070 uint16_t sizeInBlocks);
00071
00072 extern uint8_t MappedNandFlash_ReadPage(
00073 const struct MappedNandFlash *mapped,
00074 uint16_t block,
00075 uint16_t page,
00076 void *data,
00077 void *spare);
00078
00079 extern uint8_t MappedNandFlash_WritePage(
00080 const struct MappedNandFlash *mapped,
00081 uint16_t block,
00082 uint16_t page,
00083 void *data,
00084 void *spare);
00085
00086 extern uint8_t MappedNandFlash_Map(
00087 struct MappedNandFlash *mapped,
00088 uint16_t logicalBlock,
00089 uint16_t physicalBlock);
00090
00091 extern uint8_t MappedNandFlash_Unmap(
00092 struct MappedNandFlash *mapped,
00093 uint16_t logicalBlock);
00094
00095 extern int16_t MappedNandFlash_LogicalToPhysical(
00096 const struct MappedNandFlash *mapped,
00097 uint16_t logicalBlock);
00098
00099 extern int16_t MappedNandFlash_PhysicalToLogical(
00100 const struct MappedNandFlash *mapped,
00101 uint16_t physicalBlock);
00102
00103 extern uint8_t MappedNandFlash_SaveLogicalMapping(
00104 struct MappedNandFlash *mapped,
00105 uint16_t physicalBlock);
00106
00107 extern uint8_t MappedNandFlash_EraseAll(
00108 struct MappedNandFlash *mapped,
00109 uint8_t level);
00110
00111 #endif
00112