mbed library sources. Supersedes mbed-src.

Fork of mbed-dev by mbed official

Committer:
<>
Date:
Tue Nov 08 17:45:16 2016 +0000
Revision:
151:02e0a0aed4ec
This updates the lib to the mbed lib v129

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 151:02e0a0aed4ec 1 /**
<> 151:02e0a0aed4ec 2 * @file flc.h
<> 151:02e0a0aed4ec 3 * @brief Flash Controller function prototypes and data types.
<> 151:02e0a0aed4ec 4 */
<> 151:02e0a0aed4ec 5
<> 151:02e0a0aed4ec 6 /* ****************************************************************************
<> 151:02e0a0aed4ec 7 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
<> 151:02e0a0aed4ec 8 *
<> 151:02e0a0aed4ec 9 * Permission is hereby granted, free of charge, to any person obtaining a
<> 151:02e0a0aed4ec 10 * copy of this software and associated documentation files (the "Software"),
<> 151:02e0a0aed4ec 11 * to deal in the Software without restriction, including without limitation
<> 151:02e0a0aed4ec 12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
<> 151:02e0a0aed4ec 13 * and/or sell copies of the Software, and to permit persons to whom the
<> 151:02e0a0aed4ec 14 * Software is furnished to do so, subject to the following conditions:
<> 151:02e0a0aed4ec 15 *
<> 151:02e0a0aed4ec 16 * The above copyright notice and this permission notice shall be included
<> 151:02e0a0aed4ec 17 * in all copies or substantial portions of the Software.
<> 151:02e0a0aed4ec 18 *
<> 151:02e0a0aed4ec 19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
<> 151:02e0a0aed4ec 20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
<> 151:02e0a0aed4ec 21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
<> 151:02e0a0aed4ec 22 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
<> 151:02e0a0aed4ec 23 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
<> 151:02e0a0aed4ec 24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
<> 151:02e0a0aed4ec 25 * OTHER DEALINGS IN THE SOFTWARE.
<> 151:02e0a0aed4ec 26 *
<> 151:02e0a0aed4ec 27 * Except as contained in this notice, the name of Maxim Integrated
<> 151:02e0a0aed4ec 28 * Products, Inc. shall not be used except as stated in the Maxim Integrated
<> 151:02e0a0aed4ec 29 * Products, Inc. Branding Policy.
<> 151:02e0a0aed4ec 30 *
<> 151:02e0a0aed4ec 31 * The mere transfer of this software does not imply any licenses
<> 151:02e0a0aed4ec 32 * of trade secrets, proprietary technology, copyrights, patents,
<> 151:02e0a0aed4ec 33 * trademarks, maskwork rights, or any other form of intellectual
<> 151:02e0a0aed4ec 34 * property whatsoever. Maxim Integrated Products, Inc. retains all
<> 151:02e0a0aed4ec 35 * ownership rights.
<> 151:02e0a0aed4ec 36 *
<> 151:02e0a0aed4ec 37 * $Date: 2016-08-02 13:46:43 -0500 (Tue, 02 Aug 2016) $
<> 151:02e0a0aed4ec 38 * $Revision: 23898 $
<> 151:02e0a0aed4ec 39 *
<> 151:02e0a0aed4ec 40 *************************************************************************** */
<> 151:02e0a0aed4ec 41
<> 151:02e0a0aed4ec 42 /* Define to prevent redundant inclusion */
<> 151:02e0a0aed4ec 43 #ifndef _FLC_H_
<> 151:02e0a0aed4ec 44 #define _FLC_H_
<> 151:02e0a0aed4ec 45
<> 151:02e0a0aed4ec 46 /* **** Includes **** */
<> 151:02e0a0aed4ec 47 #include "flc_regs.h"
<> 151:02e0a0aed4ec 48
<> 151:02e0a0aed4ec 49 #ifdef __cplusplus
<> 151:02e0a0aed4ec 50 extern "C" {
<> 151:02e0a0aed4ec 51 #endif
<> 151:02e0a0aed4ec 52
<> 151:02e0a0aed4ec 53 /**
<> 151:02e0a0aed4ec 54 * @defgroup flc Flash Controller
<> 151:02e0a0aed4ec 55 * @ingroup sysconfig
<> 151:02e0a0aed4ec 56 * @{
<> 151:02e0a0aed4ec 57 */
<> 151:02e0a0aed4ec 58
<> 151:02e0a0aed4ec 59 /* **** Definitions **** */
<> 151:02e0a0aed4ec 60
<> 151:02e0a0aed4ec 61 /* **** Globals **** */
<> 151:02e0a0aed4ec 62
<> 151:02e0a0aed4ec 63 /* **** Function Prototypes **** */
<> 151:02e0a0aed4ec 64
<> 151:02e0a0aed4ec 65 /**
<> 151:02e0a0aed4ec 66 * @brief Prepares the Flash Controller for in-application flash operations. This function
<> 151:02e0a0aed4ec 67 * only needs to be called one time after a reset event.
<> 151:02e0a0aed4ec 68 *
<> 151:02e0a0aed4ec 69 * @return #E_NO_ERROR if flash controller initialized correctly, error if
<> 151:02e0a0aed4ec 70 * unsuccessful.
<> 151:02e0a0aed4ec 71 */
<> 151:02e0a0aed4ec 72 int FLC_Init(void);
<> 151:02e0a0aed4ec 73
<> 151:02e0a0aed4ec 74 /**
<> 151:02e0a0aed4ec 75 * @brief This function will erase a single page of flash.
<> 151:02e0a0aed4ec 76 *
<> 151:02e0a0aed4ec 77 * @param address Address of the page to be erased.
<> 151:02e0a0aed4ec 78 * @param erase_code Flash erase code; defined as
<> 151:02e0a0aed4ec 79 * #MXC_V_FLC_ERASE_CODE_PAGE_ERASE for page erase
<> 151:02e0a0aed4ec 80 * @param unlock_key Unlock key, #MXC_V_FLC_FLSH_UNLOCK_KEY.
<> 151:02e0a0aed4ec 81 *
<> 151:02e0a0aed4ec 82 * @returns #E_NO_ERROR if page erase successful, error if unsuccessful.
<> 151:02e0a0aed4ec 83 */
<> 151:02e0a0aed4ec 84 int FLC_PageErase(uint32_t address, uint8_t erase_code, uint8_t unlock_key);
<> 151:02e0a0aed4ec 85
<> 151:02e0a0aed4ec 86 /**
<> 151:02e0a0aed4ec 87 * @brief This function writes data to the flash device through the flash
<> 151:02e0a0aed4ec 88 * controller interface
<> 151:02e0a0aed4ec 89 *
<> 151:02e0a0aed4ec 90 * @param address Start address for desired write. @note This address
<> 151:02e0a0aed4ec 91 * must be 32-bit word aligned
<> 151:02e0a0aed4ec 92 * @param data A pointer to the buffer containing the data to write.
<> 151:02e0a0aed4ec 93 * @param length Size of the data to write in bytes. @note The length
<> 151:02e0a0aed4ec 94 * must be in 32-bit multiples.
<> 151:02e0a0aed4ec 95 * @param unlock_key Unlock key, #MXC_V_FLC_FLSH_UNLOCK_KEY.
<> 151:02e0a0aed4ec 96 *
<> 151:02e0a0aed4ec 97 * @returns #E_NO_ERROR if data written successfully, error if unsuccessful.
<> 151:02e0a0aed4ec 98 */
<> 151:02e0a0aed4ec 99 int FLC_Write(uint32_t address, const void *data, uint32_t length, uint8_t unlock_key);
<> 151:02e0a0aed4ec 100
<> 151:02e0a0aed4ec 101 /**
<> 151:02e0a0aed4ec 102 * @brief This function will mass erase the flash.
<> 151:02e0a0aed4ec 103 *
<> 151:02e0a0aed4ec 104 * @param erase_code Flash erase code, #MXC_V_FLC_ERASE_CODE_MASS_ERASE.
<> 151:02e0a0aed4ec 105 * @param unlock_key Unlock key, #MXC_V_FLC_FLSH_UNLOCK_KEY.
<> 151:02e0a0aed4ec 106 *
<> 151:02e0a0aed4ec 107 * @returns #E_NO_ERROR if device mass erase successful, error if unsuccessful.
<> 151:02e0a0aed4ec 108 */
<> 151:02e0a0aed4ec 109 int FLC_MassErase(uint8_t erase_code, uint8_t unlock_key);
<> 151:02e0a0aed4ec 110
<> 151:02e0a0aed4ec 111 /**@} end of group flc */
<> 151:02e0a0aed4ec 112
<> 151:02e0a0aed4ec 113 #ifdef __cplusplus
<> 151:02e0a0aed4ec 114 }
<> 151:02e0a0aed4ec 115 #endif
<> 151:02e0a0aed4ec 116
<> 151:02e0a0aed4ec 117 #endif /* _FLC_H_ */