MT7687 API Reference  LinkIt SDK v4
hal_flash.h
1 /* Copyright Statement:
2  *
3  * (C) 2005-2016 MediaTek Inc. All rights reserved.
4  *
5  * This software/firmware and related documentation ("MediaTek Software") are
6  * protected under relevant copyright laws. The information contained herein
7  * is confidential and proprietary to MediaTek Inc. ("MediaTek") and/or its licensors.
8  * Without the prior written permission of MediaTek and/or its licensors,
9  * any reproduction, modification, use or disclosure of MediaTek Software,
10  * and information contained herein, in whole or in part, shall be strictly prohibited.
11  * You may only use, reproduce, modify, or distribute (as applicable) MediaTek Software
12  * if you have agreed to and been bound by the applicable license agreement with
13  * MediaTek ("License Agreement") and been granted explicit permission to do so within
14  * the License Agreement ("Permitted User"). If you are not a Permitted User,
15  * please cease any access or use of MediaTek Software immediately.
16  * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
17  * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES
18  * ARE PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
19  * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
21  * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
22  * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
23  * SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
24  * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
25  * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
26  * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
27  * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
28  * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
29  * CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
30  * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE MEDIATEK SOFTWARE AT ISSUE,
31  * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
32  * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
33  */
34 
35 #ifndef __HAL_FLASH_H__
36 #define __HAL_FLASH_H__
37 #include "hal_platform.h"
38 
39 #ifdef HAL_FLASH_MODULE_ENABLED
40 
93 #include "hal_define.h"
94 
95 #ifdef __cplusplus
96 extern "C" {
97 #endif
98 
99 
100 /*****************************************************************************
101  * Enums
102  *****************************************************************************/
103 
110 typedef enum {
120 
121 
123 typedef enum {
128 
134 /*****************************************************************************
135  * Structures
136  *****************************************************************************/
137 
138 
139 
140 /*****************************************************************************
141  * Functions
142  *****************************************************************************/
149 
150 
157 
158 
168 hal_flash_status_t hal_flash_erase(uint32_t start_address, hal_flash_block_t block_type);
169 
170 
179 hal_flash_status_t hal_flash_read(uint32_t start_address, uint8_t *buffer, uint32_t length);
180 
181 
191 hal_flash_status_t hal_flash_write(uint32_t address, const uint8_t *data, uint32_t length);
192 
193 
194 
195 #ifdef __cplusplus
196 }
197 #endif
198 
199 
204 #endif /*HAL_FLASH_MODULE_ENABLED*/
205 #endif /* __HAL_FLASH_H__ */
206 
207 
flash has no space to write
Definition: hal_flash.h:114
hal_flash_status_t hal_flash_deinit(void)
flash deinit
flash had locked
Definition: hal_flash.h:116
hal_flash_status_t hal_flash_write(uint32_t address, const uint8_t *data, uint32_t length)
flash write
hal_flash_status_t hal_flash_init(void)
flash init
flash function error
Definition: hal_flash.h:117
flash function ok
Definition: hal_flash.h:118
flash driver don't initiate
Definition: hal_flash.h:113
hal_flash_status_t hal_flash_erase(uint32_t start_address, hal_flash_block_t block_type)
flash erase
flash erase block size 32k
Definition: hal_flash.h:125
flash erase block size 4k
Definition: hal_flash.h:124
hal_flash_status_t hal_flash_read(uint32_t start_address, uint8_t *buffer, uint32_t length)
flash read
flash invalid access address
Definition: hal_flash.h:115
flash erase block size 64k
Definition: hal_flash.h:126
flash program fail
Definition: hal_flash.h:112
flash erase fail
Definition: hal_flash.h:111
hal_flash_status_t
flash API return status definition
Definition: hal_flash.h:110
hal_flash_block_t
flash block definition
Definition: hal_flash.h:123