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_BLOCK_H 10 #define MTD_BLOCK_H 11 12 #include "mtd_core.h" 13 14 #ifdef __cplusplus 15 #if __cplusplus 16 extern "C" { 17 #endif 18 #endif /* __cplusplus */ 19 20 /** 21 * @brief Block device init for the mtd device. 22 * 23 * This function behaves differently in different OS 24 * 25 * @param mtdDevice Indicates the pointer to the mtd device. 26 * 27 * @return Returns 0 if init successfully; returns a negative value otherwise. 28 */ 29 int32_t MtdBlockInit(struct MtdDevice *mtdDevice); 30 31 /** 32 * @brief Block device uninit for the mtd device. 33 * 34 * This function behaves differently in different OS 35 * 36 * @param mtdDevice Indicates the pointer to the mtd device. 37 * 38 */ 39 void MtdBlockUninit(struct MtdDevice *mtdDevice); 40 41 /** 42 * @brief Block device init for the mtd device in specific os. 43 * 44 * These function gona be implemented by specific os 45 * 46 * @param mtdDevice Indicates the pointer to the mtd device. 47 * 48 * @return Returns 0 if init successfully; returns a negative value otherwise. 49 */ 50 int32_t MtdBlockOsInit(struct MtdDevice *mtd); 51 52 /** 53 * @brief Block device uninit for the mtd device in specific os. 54 * 55 * These function gona be implemented by specific os 56 * 57 * @param mtdDevice Indicates the pointer to the mtd device. 58 * 59 */ 60 void MtdBlockOsUninit(struct MtdDevice *mtd); 61 62 #ifdef __cplusplus 63 #if __cplusplus 64 } 65 #endif 66 #endif /* __cplusplus */ 67 68 #endif /* MTD_BLOCK_H */ 69