The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
AnnaBridge
Date:
Thu Nov 08 11:45:42 2018 +0000
Revision:
171:3a7713b1edbc
Parent:
TARGET_MAX32620FTHR/TARGET_Maxim/TARGET_MAX32620C/mxc/flc.h@167:84c0a372a020
mbed library. Release version 164

Who changed what in which revision?

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