实现读取nand的id,正在编写坏块管理算法

This commit is contained in:
ranchuan
2023-06-12 18:32:55 +08:00
parent ed44e2b9dd
commit 64db6e94bc
1385 changed files with 791640 additions and 92 deletions

37
source/nand/myftl.h Normal file
View File

@@ -0,0 +1,37 @@
#ifndef myftl_h__
#define myftl_h__
#include "stdint.h"
typedef int (*nand_init)(void);
typedef uint32_t (*nand_read_id)(void);
typedef uint32_t (*nand_read_page_8b)
(uint16_t plan,uint16_t block,uint16_t page,uint8_t *buff,uint32_t size);
typedef uint32_t (*nand_read_page_spare_area_8b)
(uint16_t plan,uint16_t block,uint16_t page,uint8_t *buff,uint32_t size);
typedef uint32_t (*nand_write_page_8b)
(uint16_t plan,uint16_t block,uint16_t page,uint8_t *buff,uint32_t size);
typedef uint32_t (*nand_write_page_spare_area_8b)
(uint16_t plan,uint16_t block,uint16_t page,uint8_t *buff,uint32_t size);
typedef int (*nand_erase_block)(uint16_t plan,uint16_t block);
typedef struct{
nand_init init;
nand_read_id read_id;
nand_read_page_8b read_page;
nand_read_page_spare_area_8b read_page_spare_area;
nand_write_page_8b write_page;
nand_write_page_spare_area_8b write_page_spare_area;
nand_erase_block erase_block;
}nand_if;
#endif