1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 #ifndef MTD_NAND_H 10 #define MTD_NAND_H 11 12 #include "hdf_base.h" 13 #include "osal_mutex.h" 14 15 #ifdef __cplusplus 16 #if __cplusplus 17 extern "C" { 18 #endif 19 #endif /* __cplusplus */ 20 21 /** 22 * @brief Enumerates the page size type of a nand flash memory. 23 * 24 */ 25 enum MtdNandPageSize { 26 MTD_NAND_PAGE_SIZE_512 = 512, 27 MTD_NAND_PAGE_SIZE_2K = 2048, 28 MTD_NAND_PAGE_SIZE_4K = 4096, 29 MTD_NAND_PAGE_SIZE_8K = 8192, 30 MTD_NAND_PAGE_SIZE_16K = 16384, 31 }; 32 33 /** 34 * @brief Enumerates the ECC type of a nand flash memory. 35 * 36 */ 37 enum MtdNandEccTYpe { 38 MTD_NAND_ECC_0BIT = 0, 39 MTD_NAND_ECC_8BIT_1K = 1, 40 MTD_NAND_ECC_16BIT_1K = 2, 41 MTD_NAND_ECC_24BIT_1K = 3, 42 MTD_NAND_ECC_28BIT_1K = 4, 43 MTD_NAND_ECC_40BIT_1K = 5, 44 MTD_NAND_ECC_64BIT_1K = 6, 45 }; 46 47 /** 48 * @brief Defines the bad block area size of a nand flash memory. 49 * 50 */ 51 #define MTD_NAND_BB_SIZE 2 52 53 #ifdef __cplusplus 54 #if __cplusplus 55 } 56 #endif 57 #endif /* __cplusplus */ 58 59 #endif /* MTD_NAND_H */ 60