|
| 1 | +/** \addtogroup hal */ |
| 2 | +/** @{*/ |
| 3 | + |
| 4 | +/* mbed Microcontroller Library |
| 5 | + * Copyright (c) 2006-2013 ARM Limited |
| 6 | + * |
| 7 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + * you may not use this file except in compliance with the License. |
| 9 | + * You may obtain a copy of the License at |
| 10 | + * |
| 11 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + * |
| 13 | + * Unless required by applicable law or agreed to in writing, software |
| 14 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + * See the License for the specific language governing permissions and |
| 17 | + * limitations under the License. |
| 18 | + */ |
| 19 | +#ifndef MBED_FLASH_API_H |
| 20 | +#define MBED_FLASH_API_H |
| 21 | + |
| 22 | +#include "device.h" |
| 23 | +#include "stdint.h" |
| 24 | + |
| 25 | +#if DEVICE_FLASH |
| 26 | + |
| 27 | +typedef struct flash_s flash_t; |
| 28 | + |
| 29 | +#ifdef __cplusplus |
| 30 | +extern "C" { |
| 31 | +#endif |
| 32 | + |
| 33 | +// maps to FlashAlgo Init |
| 34 | +int32_t flash_init(flash_t *obj); |
| 35 | + |
| 36 | +// maps to FlashAlgo UnInit |
| 37 | +int32_t flash_free(flash_t *obj); |
| 38 | + |
| 39 | +// maps to FlashAlgo EraseSector |
| 40 | +int32_t flash_erase_sector(flash_t *obj, uint32_t address); |
| 41 | + |
| 42 | +// maps FlashAlgo to ProgramPage |
| 43 | +int32_t flash_program_page(flash_t *obj, uint32_t address, const uint8_t *data, uint32_t size); |
| 44 | + |
| 45 | +#ifdef __cplusplus |
| 46 | +} |
| 47 | +#endif |
| 48 | + |
| 49 | +#endif |
| 50 | + |
| 51 | +#endif |
| 52 | + |
| 53 | +/** @}*/ |
0 commit comments