test

Fork of mbed-dev by mbed official

Committer:
AnnaBridge
Date:
Wed Nov 08 13:50:44 2017 +0000
Revision:
178:d650f5d4c87a
Parent:
171:19eb464bc2be
This updates the lib to the mbed lib v 155

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 169:9672193075cf 1 /* mbed Microcontroller Library
AnnaBridge 169:9672193075cf 2 * Copyright (c) 2013-2016 Realtek Semiconductor Corp.
AnnaBridge 169:9672193075cf 3 *
AnnaBridge 169:9672193075cf 4 * Licensed under the Apache License, Version 2.0 (the "License");
AnnaBridge 169:9672193075cf 5 * you may not use this file except in compliance with the License.
AnnaBridge 169:9672193075cf 6 * You may obtain a copy of the License at
AnnaBridge 169:9672193075cf 7 *
AnnaBridge 169:9672193075cf 8 * http://www.apache.org/licenses/LICENSE-2.0
AnnaBridge 169:9672193075cf 9 *
AnnaBridge 169:9672193075cf 10 * Unless required by applicable law or agreed to in writing, software
AnnaBridge 169:9672193075cf 11 * distributed under the License is distributed on an "AS IS" BASIS,
AnnaBridge 169:9672193075cf 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
AnnaBridge 169:9672193075cf 13 * See the License for the specific language governing permissions and
AnnaBridge 169:9672193075cf 14 * limitations under the License.
AnnaBridge 169:9672193075cf 15 */
AnnaBridge 169:9672193075cf 16 #ifndef MBED_FLASH_EXT_H
AnnaBridge 169:9672193075cf 17 #define MBED_FLASH_EXT_H
AnnaBridge 169:9672193075cf 18
AnnaBridge 169:9672193075cf 19 #include "device.h"
AnnaBridge 169:9672193075cf 20 #include "flash_api.h"
AnnaBridge 169:9672193075cf 21
AnnaBridge 169:9672193075cf 22 #ifdef __cplusplus
AnnaBridge 169:9672193075cf 23 extern "C" {
AnnaBridge 169:9672193075cf 24 #endif
AnnaBridge 169:9672193075cf 25
AnnaBridge 169:9672193075cf 26 #define FLASH_PAGE_SIZE 256
AnnaBridge 169:9672193075cf 27 #define FLASH_SIZE 0x100000
Kojto 171:19eb464bc2be 28 #define FLASH_OFS_START 0x0
AnnaBridge 169:9672193075cf 29 #define FLASH_OFS_END (FLASH_OFS_START + FLASH_SIZE)
AnnaBridge 169:9672193075cf 30
AnnaBridge 169:9672193075cf 31 extern void flash_ext_erase_sector(flash_t *obj, uint32_t address);
AnnaBridge 169:9672193075cf 32 extern void flash_ext_erase_block(flash_t * obj, uint32_t address);
Kojto 171:19eb464bc2be 33 extern int flash_ext_read_word(flash_t *obj, uint32_t address, uint32_t *data);
AnnaBridge 169:9672193075cf 34 extern int flash_ext_write_word(flash_t *obj, uint32_t address, uint32_t data);
Kojto 171:19eb464bc2be 35 extern int flash_ext_stream_read(flash_t *obj, uint32_t address, uint32_t len, uint8_t *data);
Kojto 171:19eb464bc2be 36 extern int flash_ext_stream_write(flash_t *obj, uint32_t address, uint32_t len, const uint8_t *data);
AnnaBridge 169:9672193075cf 37 extern int flash_stream_read(flash_t *obj, uint32_t addr, uint32_t len, uint8_t *data);
Kojto 171:19eb464bc2be 38 extern int flash_stream_write(flash_t *obj, uint32_t addr, uint32_t len, const uint8_t *data);
AnnaBridge 169:9672193075cf 39 extern void flash_ext_write_protect(flash_t *obj, uint32_t protect);
AnnaBridge 169:9672193075cf 40 extern int flash_ext_get_status(flash_t *obj);
AnnaBridge 169:9672193075cf 41 extern int flash_ext_set_status(flash_t *obj, uint32_t data);
AnnaBridge 169:9672193075cf 42 extern void flash_ext_reset_status(flash_t *obj);
AnnaBridge 169:9672193075cf 43
AnnaBridge 169:9672193075cf 44 /* Internal functions for flash API */
AnnaBridge 169:9672193075cf 45 extern void __flash_ext_turnon(void);
AnnaBridge 169:9672193075cf 46 extern void __flash_ext_turnoff(void);
AnnaBridge 169:9672193075cf 47 extern void __flash_ext_erase_sector(flash_t *obj, uint32_t address);
AnnaBridge 169:9672193075cf 48 extern int __flash_ext_stream_write(flash_t *obj, uint32_t addr, uint32_t len, const uint8_t *data);
AnnaBridge 169:9672193075cf 49 #ifdef __cplusplus
AnnaBridge 169:9672193075cf 50 }
AnnaBridge 169:9672193075cf 51 #endif
AnnaBridge 169:9672193075cf 52
AnnaBridge 169:9672193075cf 53 #endif