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