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.
TARGET_LPC54114/TOOLCHAIN_IAR/fsl_flashiap.h@172:65be27845400, 2019-02-20 (annotated)
- Committer:
- AnnaBridge
- Date:
- Wed Feb 20 20:53:29 2019 +0000
- Revision:
- 172:65be27845400
- Parent:
- 171:3a7713b1edbc
mbed library release version 165
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 148:fd96258d940d | 1 | /* |
Kojto | 148:fd96258d940d | 2 | * Copyright (c) 2016, Freescale Semiconductor, Inc. |
Kojto | 148:fd96258d940d | 3 | * All rights reserved. |
Kojto | 148:fd96258d940d | 4 | * |
Kojto | 148:fd96258d940d | 5 | * Redistribution and use in source and binary forms, with or without modification, |
Kojto | 148:fd96258d940d | 6 | * are permitted provided that the following conditions are met: |
Kojto | 148:fd96258d940d | 7 | * |
Kojto | 148:fd96258d940d | 8 | * o Redistributions of source code must retain the above copyright notice, this list |
Kojto | 148:fd96258d940d | 9 | * of conditions and the following disclaimer. |
Kojto | 148:fd96258d940d | 10 | * |
Kojto | 148:fd96258d940d | 11 | * o Redistributions in binary form must reproduce the above copyright notice, this |
Kojto | 148:fd96258d940d | 12 | * list of conditions and the following disclaimer in the documentation and/or |
Kojto | 148:fd96258d940d | 13 | * other materials provided with the distribution. |
Kojto | 148:fd96258d940d | 14 | * |
Kojto | 148:fd96258d940d | 15 | * o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
Kojto | 148:fd96258d940d | 16 | * contributors may be used to endorse or promote products derived from this |
Kojto | 148:fd96258d940d | 17 | * software without specific prior written permission. |
Kojto | 148:fd96258d940d | 18 | * |
Kojto | 148:fd96258d940d | 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
Kojto | 148:fd96258d940d | 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
Kojto | 148:fd96258d940d | 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Kojto | 148:fd96258d940d | 22 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
Kojto | 148:fd96258d940d | 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
Kojto | 148:fd96258d940d | 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
Kojto | 148:fd96258d940d | 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
Kojto | 148:fd96258d940d | 26 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
Kojto | 148:fd96258d940d | 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
Kojto | 148:fd96258d940d | 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Kojto | 148:fd96258d940d | 29 | */ |
Kojto | 148:fd96258d940d | 30 | |
Kojto | 148:fd96258d940d | 31 | #ifndef _FSL_FLASHIAP_H_ |
Kojto | 148:fd96258d940d | 32 | #define _FSL_FLASHIAP_H_ |
Kojto | 148:fd96258d940d | 33 | |
Kojto | 148:fd96258d940d | 34 | #include "fsl_common.h" |
Kojto | 148:fd96258d940d | 35 | |
Kojto | 148:fd96258d940d | 36 | /*! |
Kojto | 148:fd96258d940d | 37 | * @addtogroup flashiap_driver |
Kojto | 148:fd96258d940d | 38 | * @{ |
Kojto | 148:fd96258d940d | 39 | */ |
Kojto | 148:fd96258d940d | 40 | |
Kojto | 148:fd96258d940d | 41 | /*! @file */ |
Kojto | 148:fd96258d940d | 42 | |
Kojto | 148:fd96258d940d | 43 | /******************************************************************************* |
Kojto | 148:fd96258d940d | 44 | * Definitions |
Kojto | 148:fd96258d940d | 45 | ******************************************************************************/ |
Kojto | 148:fd96258d940d | 46 | |
Kojto | 148:fd96258d940d | 47 | /*! @name Driver version */ |
Kojto | 148:fd96258d940d | 48 | /*@{*/ |
Kojto | 148:fd96258d940d | 49 | #define FSL_FLASHIAP_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) /*!< Version 2.0.0. */ |
Kojto | 148:fd96258d940d | 50 | /*@}*/ |
Kojto | 148:fd96258d940d | 51 | |
Kojto | 148:fd96258d940d | 52 | /*! |
Kojto | 148:fd96258d940d | 53 | * @brief Flashiap status codes. |
Kojto | 148:fd96258d940d | 54 | */ |
Kojto | 148:fd96258d940d | 55 | enum _flashiap_status |
Kojto | 148:fd96258d940d | 56 | { |
Kojto | 148:fd96258d940d | 57 | kStatus_FLASHIAP_Success = kStatus_Success, /*!< Api is executed successfully */ |
Kojto | 148:fd96258d940d | 58 | kStatus_FLASHIAP_InvalidCommand = MAKE_STATUS(kStatusGroup_FLASHIAP, 1U), /*!< Invalid command */ |
Kojto | 148:fd96258d940d | 59 | kStatus_FLASHIAP_SrcAddrError = |
Kojto | 148:fd96258d940d | 60 | MAKE_STATUS(kStatusGroup_FLASHIAP, 2U), /*!< Source address is not on word boundary */ |
Kojto | 148:fd96258d940d | 61 | kStatus_FLASHIAP_DstAddrError = |
Kojto | 148:fd96258d940d | 62 | MAKE_STATUS(kStatusGroup_FLASHIAP, 3U), /*!< Destination address is not on a correct boundary */ |
Kojto | 148:fd96258d940d | 63 | kStatus_FLASHIAP_SrcAddrNotMapped = |
Kojto | 148:fd96258d940d | 64 | MAKE_STATUS(kStatusGroup_FLASHIAP, 4U), /*!< Source address is not mapped in the memory map */ |
Kojto | 148:fd96258d940d | 65 | kStatus_FLASHIAP_DstAddrNotMapped = |
Kojto | 148:fd96258d940d | 66 | MAKE_STATUS(kStatusGroup_FLASHIAP, 5U), /*!< Destination address is not mapped in the memory map */ |
Kojto | 148:fd96258d940d | 67 | kStatus_FLASHIAP_CountError = |
Kojto | 148:fd96258d940d | 68 | MAKE_STATUS(kStatusGroup_FLASHIAP, 6U), /*!< Byte count is not multiple of 4 or is not a permitted value */ |
Kojto | 148:fd96258d940d | 69 | kStatus_FLASHIAP_InvalidSector = |
Kojto | 148:fd96258d940d | 70 | MAKE_STATUS(kStatusGroup_FLASHIAP, |
Kojto | 148:fd96258d940d | 71 | 7), /*!< Sector number is invalid or end sector number is greater than start sector number */ |
Kojto | 148:fd96258d940d | 72 | kStatus_FLASHIAP_SectorNotblank = MAKE_STATUS(kStatusGroup_FLASHIAP, 8U), /*!< One or more sectors are not blank */ |
Kojto | 148:fd96258d940d | 73 | kStatus_FLASHIAP_NotPrepared = |
Kojto | 148:fd96258d940d | 74 | MAKE_STATUS(kStatusGroup_FLASHIAP, 9U), /*!< Command to prepare sector for write operation was not executed */ |
Kojto | 148:fd96258d940d | 75 | kStatus_FLASHIAP_CompareError = |
Kojto | 148:fd96258d940d | 76 | MAKE_STATUS(kStatusGroup_FLASHIAP, 10U), /*!< Destination and source memory contents do not match */ |
Kojto | 148:fd96258d940d | 77 | kStatus_FLASHIAP_Busy = |
Kojto | 148:fd96258d940d | 78 | MAKE_STATUS(kStatusGroup_FLASHIAP, 11U), /*!< Flash programming hardware interface is busy */ |
Kojto | 148:fd96258d940d | 79 | kStatus_FLASHIAP_ParamError = |
Kojto | 148:fd96258d940d | 80 | MAKE_STATUS(kStatusGroup_FLASHIAP, 12U), /*!< Insufficient number of parameters or invalid parameter */ |
Kojto | 148:fd96258d940d | 81 | kStatus_FLASHIAP_AddrError = MAKE_STATUS(kStatusGroup_FLASHIAP, 13U), /*!< Address is not on word boundary */ |
Kojto | 148:fd96258d940d | 82 | kStatus_FLASHIAP_AddrNotMapped = |
Kojto | 148:fd96258d940d | 83 | MAKE_STATUS(kStatusGroup_FLASHIAP, 14U), /*!< Address is not mapped in the memory map */ |
Kojto | 148:fd96258d940d | 84 | kStatus_FLASHIAP_NoPower = MAKE_STATUS(kStatusGroup_FLASHIAP, 24U), /*!< Flash memory block is powered down */ |
Kojto | 148:fd96258d940d | 85 | kStatus_FLASHIAP_NoClock = |
Kojto | 148:fd96258d940d | 86 | MAKE_STATUS(kStatusGroup_FLASHIAP, 27U), /*!< Flash memory block or controller is not clocked */ |
Kojto | 148:fd96258d940d | 87 | }; |
Kojto | 148:fd96258d940d | 88 | |
Kojto | 148:fd96258d940d | 89 | /*! |
Kojto | 148:fd96258d940d | 90 | * @brief Flashiap command codes. |
Kojto | 148:fd96258d940d | 91 | */ |
Kojto | 148:fd96258d940d | 92 | enum _flashiap_commands |
Kojto | 148:fd96258d940d | 93 | { |
Kojto | 148:fd96258d940d | 94 | kIapCmd_FLASHIAP_PrepareSectorforWrite = 50U, /*!< Prepare Sector for write */ |
Kojto | 148:fd96258d940d | 95 | kIapCmd_FLASHIAP_CopyRamToFlash = 51U, /*!< Copy RAM to flash */ |
Kojto | 148:fd96258d940d | 96 | kIapCmd_FLASHIAP_EraseSector = 52U, /*!< Erase Sector */ |
Kojto | 148:fd96258d940d | 97 | kIapCmd_FLASHIAP_BlankCheckSector = 53U, /*!< Blank check sector */ |
Kojto | 148:fd96258d940d | 98 | kIapCmd_FLASHIAP_ReadPartId = 54U, /*!< Read part id */ |
Kojto | 148:fd96258d940d | 99 | kIapCmd_FLASHIAP_Read_BootromVersion = 55U, /*!< Read bootrom version */ |
Kojto | 148:fd96258d940d | 100 | kIapCmd_FLASHIAP_Compare = 56U, /*!< Compare */ |
Kojto | 148:fd96258d940d | 101 | kIapCmd_FLASHIAP_ReinvokeISP = 57U, /*!< Reinvoke ISP */ |
Kojto | 148:fd96258d940d | 102 | kIapCmd_FLASHIAP_ReadUid = 58U, /*!< Read Uid isp */ |
Kojto | 148:fd96258d940d | 103 | kIapCmd_FLASHIAP_ErasePage = 59U, /*!< Erase Page */ |
Kojto | 148:fd96258d940d | 104 | kIapCmd_FLASHIAP_ReadMisr = 70U, /*!< Read Misr */ |
Kojto | 148:fd96258d940d | 105 | kIapCmd_FLASHIAP_ReinvokeI2cSpiISP = 71U /*!< Reinvoke I2C/SPI isp */ |
Kojto | 148:fd96258d940d | 106 | }; |
Kojto | 148:fd96258d940d | 107 | |
Kojto | 148:fd96258d940d | 108 | /*! @brief IAP_ENTRY API function type */ |
Kojto | 148:fd96258d940d | 109 | typedef void (*IAP_ENTRY_T)(uint32_t cmd[5], uint32_t stat[4]); |
Kojto | 148:fd96258d940d | 110 | |
Kojto | 148:fd96258d940d | 111 | /******************************************************************************* |
Kojto | 148:fd96258d940d | 112 | * API |
Kojto | 148:fd96258d940d | 113 | ******************************************************************************/ |
Kojto | 148:fd96258d940d | 114 | |
Kojto | 148:fd96258d940d | 115 | #if defined(__cplusplus) |
Kojto | 148:fd96258d940d | 116 | extern "C" { |
Kojto | 148:fd96258d940d | 117 | #endif |
Kojto | 148:fd96258d940d | 118 | |
Kojto | 148:fd96258d940d | 119 | /*! |
Kojto | 148:fd96258d940d | 120 | * @brief IAP_ENTRY API function type |
Kojto | 148:fd96258d940d | 121 | * |
Kojto | 148:fd96258d940d | 122 | * Wrapper for rom iap call |
Kojto | 148:fd96258d940d | 123 | * |
Kojto | 148:fd96258d940d | 124 | * @param cmd_param IAP command and relevant parameter array. |
Kojto | 148:fd96258d940d | 125 | * @param status_result IAP status result array. |
Kojto | 148:fd96258d940d | 126 | * |
Kojto | 148:fd96258d940d | 127 | * @retval None. Status/Result is returned via status_result array. |
Kojto | 148:fd96258d940d | 128 | */ |
Kojto | 148:fd96258d940d | 129 | static inline void iap_entry(uint32_t *cmd_param, uint32_t *status_result) |
Kojto | 148:fd96258d940d | 130 | { |
Kojto | 148:fd96258d940d | 131 | ((IAP_ENTRY_T)FSL_FEATURE_SYSCON_IAP_ENTRY_LOCATION)(cmd_param, status_result); |
Kojto | 148:fd96258d940d | 132 | } |
Kojto | 148:fd96258d940d | 133 | |
Kojto | 148:fd96258d940d | 134 | /*! |
Kojto | 148:fd96258d940d | 135 | * @brief Prepare sector for write operation |
Kojto | 148:fd96258d940d | 136 | |
Kojto | 148:fd96258d940d | 137 | * This function prepares sector(s) for write/erase operation. This function must be |
Kojto | 148:fd96258d940d | 138 | * called before calling the FLASHIAP_CopyRamToFlash() or FLASHIAP_EraseSector() or |
Kojto | 148:fd96258d940d | 139 | * FLASHIAP_ErasePage() function. The end sector must be greater than or equal to |
Kojto | 148:fd96258d940d | 140 | * start sector number. |
Kojto | 148:fd96258d940d | 141 | * |
Kojto | 148:fd96258d940d | 142 | * @param startSector Start sector number. |
Kojto | 148:fd96258d940d | 143 | * @param endSector End sector number. |
Kojto | 148:fd96258d940d | 144 | * |
Kojto | 148:fd96258d940d | 145 | * @retval #kStatus_FLASHIAP_Success Api was executed successfully. |
Kojto | 148:fd96258d940d | 146 | * @retval #kStatus_FLASHIAP_NoPower Flash memory block is powered down. |
Kojto | 148:fd96258d940d | 147 | * @retval #kStatus_FLASHIAP_NoClock Flash memory block or controller is not clocked. |
Kojto | 148:fd96258d940d | 148 | * @retval #kStatus_FLASHIAP_InvalidSector Sector number is invalid or end sector number |
Kojto | 148:fd96258d940d | 149 | * is greater than start sector number. |
Kojto | 148:fd96258d940d | 150 | * @retval #kStatus_FLASHIAP_Busy Flash programming hardware interface is busy. |
Kojto | 148:fd96258d940d | 151 | */ |
Kojto | 148:fd96258d940d | 152 | status_t FLASHIAP_PrepareSectorForWrite(uint32_t startSector, uint32_t endSector); |
Kojto | 148:fd96258d940d | 153 | |
Kojto | 148:fd96258d940d | 154 | /*! |
Kojto | 148:fd96258d940d | 155 | * @brief Copy RAM to flash. |
Kojto | 148:fd96258d940d | 156 | |
Kojto | 148:fd96258d940d | 157 | * This function programs the flash memory. Corresponding sectors must be prepared |
Kojto | 148:fd96258d940d | 158 | * via FLASHIAP_PrepareSectorForWrite before calling calling this function. The addresses |
Kojto | 148:fd96258d940d | 159 | * should be a 256 byte boundary and the number of bytes should be 256 | 512 | 1024 | 4096. |
Kojto | 148:fd96258d940d | 160 | * |
Kojto | 148:fd96258d940d | 161 | * @param dstAddr Destination flash address where data bytes are to be written. |
Kojto | 148:fd96258d940d | 162 | * @param srcAddr Source ram address from where data bytes are to be read. |
Kojto | 148:fd96258d940d | 163 | * @param numOfBytes Number of bytes to be written. |
Kojto | 148:fd96258d940d | 164 | * @param systemCoreClock SystemCoreClock in Hz. It is converted to KHz before calling the |
Kojto | 148:fd96258d940d | 165 | * rom IAP function. |
Kojto | 148:fd96258d940d | 166 | * |
Kojto | 148:fd96258d940d | 167 | * @retval #kStatus_FLASHIAP_Success Api was executed successfully. |
Kojto | 148:fd96258d940d | 168 | * @retval #kStatus_FLASHIAP_NoPower Flash memory block is powered down. |
Kojto | 148:fd96258d940d | 169 | * @retval #kStatus_FLASHIAP_NoClock Flash memory block or controller is not clocked. |
Kojto | 148:fd96258d940d | 170 | * @retval #kStatus_FLASHIAP_SrcAddrError Source address is not on word boundary. |
Kojto | 148:fd96258d940d | 171 | * @retval #kStatus_FLASHIAP_DstAddrError Destination address is not on a correct boundary. |
Kojto | 148:fd96258d940d | 172 | * @retval #kStatus_FLASHIAP_SrcAddrNotMapped Source address is not mapped in the memory map. |
Kojto | 148:fd96258d940d | 173 | * @retval #kStatus_FLASHIAP_DstAddrNotMapped Destination address is not mapped in the memory map. |
Kojto | 148:fd96258d940d | 174 | * @retval #kStatus_FLASHIAP_CountError Byte count is not multiple of 4 or is not a permitted value. |
Kojto | 148:fd96258d940d | 175 | * @retval #kStatus_FLASHIAP_NotPrepared Command to prepare sector for write operation was not executed. |
Kojto | 148:fd96258d940d | 176 | * @retval #kStatus_FLASHIAP_Busy Flash programming hardware interface is busy. |
Kojto | 148:fd96258d940d | 177 | */ |
Kojto | 148:fd96258d940d | 178 | status_t FLASHIAP_CopyRamToFlash(uint32_t dstAddr, uint32_t *srcAddr, uint32_t numOfBytes, uint32_t systemCoreClock); |
Kojto | 148:fd96258d940d | 179 | |
Kojto | 148:fd96258d940d | 180 | /*! |
Kojto | 148:fd96258d940d | 181 | * @brief Erase sector |
Kojto | 148:fd96258d940d | 182 | |
Kojto | 148:fd96258d940d | 183 | * This function erases sector(s). The end sector must be greater than or equal to |
Kojto | 148:fd96258d940d | 184 | * start sector number. FLASHIAP_PrepareSectorForWrite must be called before |
Kojto | 148:fd96258d940d | 185 | * calling this function. |
Kojto | 148:fd96258d940d | 186 | * |
Kojto | 148:fd96258d940d | 187 | * @param startSector Start sector number. |
Kojto | 148:fd96258d940d | 188 | * @param endSector End sector number. |
Kojto | 148:fd96258d940d | 189 | * @param systemCoreClock SystemCoreClock in Hz. It is converted to KHz before calling the |
Kojto | 148:fd96258d940d | 190 | * rom IAP function. |
Kojto | 148:fd96258d940d | 191 | * |
Kojto | 148:fd96258d940d | 192 | * @retval #kStatus_FLASHIAP_Success Api was executed successfully. |
Kojto | 148:fd96258d940d | 193 | * @retval #kStatus_FLASHIAP_NoPower Flash memory block is powered down. |
Kojto | 148:fd96258d940d | 194 | * @retval #kStatus_FLASHIAP_NoClock Flash memory block or controller is not clocked. |
Kojto | 148:fd96258d940d | 195 | * @retval #kStatus_FLASHIAP_InvalidSector Sector number is invalid or end sector number |
Kojto | 148:fd96258d940d | 196 | * is greater than start sector number. |
Kojto | 148:fd96258d940d | 197 | * @retval #kStatus_FLASHIAP_NotPrepared Command to prepare sector for write operation was not executed. |
Kojto | 148:fd96258d940d | 198 | * @retval #kStatus_FLASHIAP_Busy Flash programming hardware interface is busy. |
Kojto | 148:fd96258d940d | 199 | */ |
Kojto | 148:fd96258d940d | 200 | status_t FLASHIAP_EraseSector(uint32_t startSector, uint32_t endSector, uint32_t systemCoreClock); |
Kojto | 148:fd96258d940d | 201 | |
Kojto | 148:fd96258d940d | 202 | /*! |
Kojto | 148:fd96258d940d | 203 | |
Kojto | 148:fd96258d940d | 204 | * This function erases page(s). The end page must be greater than or equal to |
Kojto | 148:fd96258d940d | 205 | * start page number. Corresponding sectors must be prepared via FLASHIAP_PrepareSectorForWrite |
Kojto | 148:fd96258d940d | 206 | * before calling calling this function. |
Kojto | 148:fd96258d940d | 207 | * |
Kojto | 148:fd96258d940d | 208 | * @param startPage Start page number |
Kojto | 148:fd96258d940d | 209 | * @param endPage End page number |
Kojto | 148:fd96258d940d | 210 | * @param systemCoreClock SystemCoreClock in Hz. It is converted to KHz before calling the |
Kojto | 148:fd96258d940d | 211 | * rom IAP function. |
Kojto | 148:fd96258d940d | 212 | * |
Kojto | 148:fd96258d940d | 213 | * @retval #kStatus_FLASHIAP_Success Api was executed successfully. |
Kojto | 148:fd96258d940d | 214 | * @retval #kStatus_FLASHIAP_NoPower Flash memory block is powered down. |
Kojto | 148:fd96258d940d | 215 | * @retval #kStatus_FLASHIAP_NoClock Flash memory block or controller is not clocked. |
Kojto | 148:fd96258d940d | 216 | * @retval #kStatus_FLASHIAP_InvalidSector Page number is invalid or end page number |
Kojto | 148:fd96258d940d | 217 | * is greater than start page number |
Kojto | 148:fd96258d940d | 218 | * @retval #kStatus_FLASHIAP_NotPrepared Command to prepare sector for write operation was not executed. |
Kojto | 148:fd96258d940d | 219 | * @retval #kStatus_FLASHIAP_Busy Flash programming hardware interface is busy. |
Kojto | 148:fd96258d940d | 220 | */ |
Kojto | 148:fd96258d940d | 221 | status_t FLASHIAP_ErasePage(uint32_t startPage, uint32_t endPage, uint32_t systemCoreClock); |
Kojto | 148:fd96258d940d | 222 | |
Kojto | 148:fd96258d940d | 223 | /*! |
Kojto | 148:fd96258d940d | 224 | * @brief Blank check sector(s) |
Kojto | 148:fd96258d940d | 225 | * |
Kojto | 148:fd96258d940d | 226 | * Blank check single or multiples sectors of flash memory. The end sector must be greater than or equal to |
Kojto | 148:fd96258d940d | 227 | * start sector number. It can be used to verify the sector eraseure after FLASHIAP_EraseSector call. |
Kojto | 148:fd96258d940d | 228 | * |
Kojto | 148:fd96258d940d | 229 | * @param startSector : Start sector number. Must be greater than or equal to start sector number |
Kojto | 148:fd96258d940d | 230 | * @param endSector : End sector number |
Kojto | 148:fd96258d940d | 231 | * @retval #kStatus_FLASHIAP_Success One or more sectors are in erased state. |
Kojto | 148:fd96258d940d | 232 | * @retval #kStatus_FLASHIAP_NoPower Flash memory block is powered down. |
Kojto | 148:fd96258d940d | 233 | * @retval #kStatus_FLASHIAP_NoClock Flash memory block or controller is not clocked. |
Kojto | 148:fd96258d940d | 234 | * @retval #kStatus_FLASHIAP_SectorNotblank One or more sectors are not blank. |
Kojto | 148:fd96258d940d | 235 | */ |
Kojto | 148:fd96258d940d | 236 | status_t FLASHIAP_BlankCheckSector(uint32_t startSector, uint32_t endSector); |
Kojto | 148:fd96258d940d | 237 | |
Kojto | 148:fd96258d940d | 238 | /*! |
Kojto | 148:fd96258d940d | 239 | * @brief Compare memory contents of flash with ram. |
Kojto | 148:fd96258d940d | 240 | |
Kojto | 148:fd96258d940d | 241 | * This function compares the contents of flash and ram. It can be used to verify the flash |
Kojto | 148:fd96258d940d | 242 | * memory contents after FLASHIAP_CopyRamToFlash call. |
Kojto | 148:fd96258d940d | 243 | * |
Kojto | 148:fd96258d940d | 244 | * @param dstAddr Destination flash address. |
Kojto | 148:fd96258d940d | 245 | * @param srcAddr Source ram address. |
Kojto | 148:fd96258d940d | 246 | * @param numOfBytes Number of bytes to be compared. |
Kojto | 148:fd96258d940d | 247 | * |
Kojto | 148:fd96258d940d | 248 | * @retval #kStatus_FLASHIAP_Success Contents of flash and ram match. |
Kojto | 148:fd96258d940d | 249 | * @retval #kStatus_FLASHIAP_NoPower Flash memory block is powered down. |
Kojto | 148:fd96258d940d | 250 | * @retval #kStatus_FLASHIAP_NoClock Flash memory block or controller is not clocked. |
Kojto | 148:fd96258d940d | 251 | * @retval #kStatus_FLASHIAP_AddrError Address is not on word boundary. |
Kojto | 148:fd96258d940d | 252 | * @retval #kStatus_FLASHIAP_AddrNotMapped Address is not mapped in the memory map. |
Kojto | 148:fd96258d940d | 253 | * @retval #kStatus_FLASHIAP_CountError Byte count is not multiple of 4 or is not a permitted value. |
Kojto | 148:fd96258d940d | 254 | * @retval #kStatus_FLASHIAP_CompareError Destination and source memory contents do not match. |
Kojto | 148:fd96258d940d | 255 | */ |
Kojto | 148:fd96258d940d | 256 | status_t FLASHIAP_Compare(uint32_t dstAddr, uint32_t *srcAddr, uint32_t numOfBytes); |
Kojto | 148:fd96258d940d | 257 | |
Kojto | 148:fd96258d940d | 258 | #ifdef __cplusplus |
Kojto | 148:fd96258d940d | 259 | } |
Kojto | 148:fd96258d940d | 260 | #endif |
Kojto | 148:fd96258d940d | 261 | |
Kojto | 148:fd96258d940d | 262 | /*@}*/ |
Kojto | 148:fd96258d940d | 263 | |
Kojto | 148:fd96258d940d | 264 | #endif /* _FSL_FLASHIAP_H_ */ |