11bd4fe43Sopenharmony_ci/* 21bd4fe43Sopenharmony_ci * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 31bd4fe43Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 41bd4fe43Sopenharmony_ci * you may not use this file except in compliance with the License. 51bd4fe43Sopenharmony_ci * You may obtain a copy of the License at 61bd4fe43Sopenharmony_ci * 71bd4fe43Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 81bd4fe43Sopenharmony_ci * 91bd4fe43Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 101bd4fe43Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 111bd4fe43Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 121bd4fe43Sopenharmony_ci * See the License for the specific language governing permissions and 131bd4fe43Sopenharmony_ci * limitations under the License. 141bd4fe43Sopenharmony_ci */ 151bd4fe43Sopenharmony_ci 161bd4fe43Sopenharmony_ci#ifndef __HI_FLASH_BASE_H__ 171bd4fe43Sopenharmony_ci#define __HI_FLASH_BASE_H__ 181bd4fe43Sopenharmony_ci 191bd4fe43Sopenharmony_ci#include <hi_types_base.h> 201bd4fe43Sopenharmony_ci 211bd4fe43Sopenharmony_ci#define HI_FLASH_CMD_ADD_FUNC 0 221bd4fe43Sopenharmony_ci#define HI_FLASH_CMD_GET_INFO 1 /**< IOCTL command ID for obtaining the flash information. 231bd4fe43Sopenharmony_ci The corresponding output parameter points to the hi_flash_info structure. 241bd4fe43Sopenharmony_ciCNcomment:IOCTL获取Flash信息,对应出参指向结构体为hi_flash_info.CNend */ 251bd4fe43Sopenharmony_ci#define HI_FLASH_CMD_IS_BUSY 2 /**< IOCTL Obtain whether the flash memory is busy. The corresponding output 261bd4fe43Sopenharmony_ci parameter point type is hi_bool. 271bd4fe43Sopenharmony_ciCNcomment:IOCTL获取Flash是否busy,对应出参指向类型为hi_bool CNend */ 281bd4fe43Sopenharmony_ci 291bd4fe43Sopenharmony_ci#define HI_FLASH_CHIP_ID_NUM 3 301bd4fe43Sopenharmony_ci#define HI_FLASH_CAPACITY_ID 2 311bd4fe43Sopenharmony_ci 321bd4fe43Sopenharmony_ci/** 331bd4fe43Sopenharmony_ci* @ingroup iot_flash 341bd4fe43Sopenharmony_ci* 351bd4fe43Sopenharmony_ci* Flash information obtaining structure, used to describe the return structure of the command ID HI_FLASH_CMD_GET_INFO. 361bd4fe43Sopenharmony_ciCNcomment:Flash信息获取结构体,用于描述命令ID(HI_FLASH_CMD_GET_INFO)的返回结构体。CNend 371bd4fe43Sopenharmony_ci*/ 381bd4fe43Sopenharmony_citypedef struct { 391bd4fe43Sopenharmony_ci hi_char *name; /**< Flash name.CNcomment:Flash名字CNend */ 401bd4fe43Sopenharmony_ci hi_u8 id[HI_FLASH_CHIP_ID_NUM]; /**< Flash Id */ 411bd4fe43Sopenharmony_ci hi_u8 pad; 421bd4fe43Sopenharmony_ci hi_u32 total_size; /**< Flash totoal size (unit: byte). 431bd4fe43Sopenharmony_ci CNcomment:Flash总大小(单位:byte)CNend */ 441bd4fe43Sopenharmony_ci hi_u32 sector_size; /**< Flash block size (unit: byte). 451bd4fe43Sopenharmony_ci CNcomment:Flash块大小(单位:byte)CNend */ 461bd4fe43Sopenharmony_ci} hi_flash_info; 471bd4fe43Sopenharmony_ci 481bd4fe43Sopenharmony_ci#endif 491bd4fe43Sopenharmony_ci 50