• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef __HI_FLASH_BASE_H__
17 #define __HI_FLASH_BASE_H__
18 
19 #include <hi_types_base.h>
20 
21 #define HI_FLASH_CMD_ADD_FUNC   0
22 #define HI_FLASH_CMD_GET_INFO   1  /**< IOCTL command ID for obtaining the flash information.
23                                         The corresponding output parameter points to the hi_flash_info structure.
24 CNcomment:IOCTL获取Flash信息,对应出参指向结构体为hi_flash_info.CNend */
25 #define HI_FLASH_CMD_IS_BUSY    2  /**< IOCTL Obtain whether the flash memory is busy. The corresponding output
26                                         parameter point type is hi_bool.
27 CNcomment:IOCTL获取Flash是否busy,对应出参指向类型为hi_bool CNend */
28 
29 #define HI_FLASH_CHIP_ID_NUM    3
30 #define HI_FLASH_CAPACITY_ID    2
31 
32 /**
33 * @ingroup  iot_flash
34 *
35 * Flash information obtaining structure, used to describe the return structure of the command ID HI_FLASH_CMD_GET_INFO.
36 CNcomment:Flash信息获取结构体,用于描述命令ID(HI_FLASH_CMD_GET_INFO)的返回结构体。CNend
37 */
38 typedef struct {
39     hi_char *name;                     /**< Flash name.CNcomment:Flash名字CNend  */
40     hi_u8   id[HI_FLASH_CHIP_ID_NUM];  /**< Flash Id  */
41     hi_u8   pad;
42     hi_u32 total_size;                 /**< Flash totoal size (unit: byte).
43                                           CNcomment:Flash总大小(单位:byte)CNend  */
44     hi_u32 sector_size;                /**< Flash block size (unit: byte).
45                                           CNcomment:Flash块大小(单位:byte)CNend */
46 } hi_flash_info;
47 
48 #endif
49 
50