added prescaler for 16 bit pwm in LPC1347 target

Fork of mbed-dev by mbed official

Committer:
<>
Date:
Fri Sep 02 15:07:44 2016 +0100
Revision:
144:ef7eb2e8f9f7
This updates the lib to the mbed lib v125

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 144:ef7eb2e8f9f7 1 /*
<> 144:ef7eb2e8f9f7 2 * Copyright (c) 2013-2016, Freescale Semiconductor, Inc.
<> 144:ef7eb2e8f9f7 3 * All rights reserved.
<> 144:ef7eb2e8f9f7 4 *
<> 144:ef7eb2e8f9f7 5 * Redistribution and use in source and binary forms, with or without modification,
<> 144:ef7eb2e8f9f7 6 * are permitted provided that the following conditions are met:
<> 144:ef7eb2e8f9f7 7 *
<> 144:ef7eb2e8f9f7 8 * o Redistributions of source code must retain the above copyright notice, this list
<> 144:ef7eb2e8f9f7 9 * of conditions and the following disclaimer.
<> 144:ef7eb2e8f9f7 10 *
<> 144:ef7eb2e8f9f7 11 * o Redistributions in binary form must reproduce the above copyright notice, this
<> 144:ef7eb2e8f9f7 12 * list of conditions and the following disclaimer in the documentation and/or
<> 144:ef7eb2e8f9f7 13 * other materials provided with the distribution.
<> 144:ef7eb2e8f9f7 14 *
<> 144:ef7eb2e8f9f7 15 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
<> 144:ef7eb2e8f9f7 16 * contributors may be used to endorse or promote products derived from this
<> 144:ef7eb2e8f9f7 17 * software without specific prior written permission.
<> 144:ef7eb2e8f9f7 18 *
<> 144:ef7eb2e8f9f7 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
<> 144:ef7eb2e8f9f7 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
<> 144:ef7eb2e8f9f7 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
<> 144:ef7eb2e8f9f7 22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
<> 144:ef7eb2e8f9f7 23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
<> 144:ef7eb2e8f9f7 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
<> 144:ef7eb2e8f9f7 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
<> 144:ef7eb2e8f9f7 26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
<> 144:ef7eb2e8f9f7 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
<> 144:ef7eb2e8f9f7 28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<> 144:ef7eb2e8f9f7 29 */
<> 144:ef7eb2e8f9f7 30
<> 144:ef7eb2e8f9f7 31 #ifndef _FSL_FLASH_H_
<> 144:ef7eb2e8f9f7 32 #define _FSL_FLASH_H_
<> 144:ef7eb2e8f9f7 33
<> 144:ef7eb2e8f9f7 34 #if (defined(BL_TARGET_FLASH) || defined(BL_TARGET_ROM) || defined(BL_TARGET_RAM))
<> 144:ef7eb2e8f9f7 35 #include <assert.h>
<> 144:ef7eb2e8f9f7 36 #include <string.h>
<> 144:ef7eb2e8f9f7 37 #include "fsl_device_registers.h"
<> 144:ef7eb2e8f9f7 38 #include "bootloader_common.h"
<> 144:ef7eb2e8f9f7 39 #else
<> 144:ef7eb2e8f9f7 40 #include "fsl_common.h"
<> 144:ef7eb2e8f9f7 41 #endif
<> 144:ef7eb2e8f9f7 42
<> 144:ef7eb2e8f9f7 43 /*******************************************************************************
<> 144:ef7eb2e8f9f7 44 * Definitions
<> 144:ef7eb2e8f9f7 45 ******************************************************************************/
<> 144:ef7eb2e8f9f7 46
<> 144:ef7eb2e8f9f7 47 /*!
<> 144:ef7eb2e8f9f7 48 * @addtogroup flash_driver
<> 144:ef7eb2e8f9f7 49 * @{
<> 144:ef7eb2e8f9f7 50 */
<> 144:ef7eb2e8f9f7 51
<> 144:ef7eb2e8f9f7 52 /*!
<> 144:ef7eb2e8f9f7 53 * @name Flash version
<> 144:ef7eb2e8f9f7 54 * @{
<> 144:ef7eb2e8f9f7 55 */
<> 144:ef7eb2e8f9f7 56 /*! @brief Construct the version number for drivers. */
<> 144:ef7eb2e8f9f7 57 #if !defined(MAKE_VERSION)
<> 144:ef7eb2e8f9f7 58 #define MAKE_VERSION(major, minor, bugfix) (((major) << 16) | ((minor) << 8) | (bugfix))
<> 144:ef7eb2e8f9f7 59 #endif
<> 144:ef7eb2e8f9f7 60
<> 144:ef7eb2e8f9f7 61 /*! @brief FLASH driver version for SDK*/
<> 144:ef7eb2e8f9f7 62 #define FSL_FLASH_DRIVER_VERSION (MAKE_VERSION(2, 1, 0)) /*!< Version 2.1.0. */
<> 144:ef7eb2e8f9f7 63
<> 144:ef7eb2e8f9f7 64 /*! @brief FLASH driver version for ROM*/
<> 144:ef7eb2e8f9f7 65 enum _flash_driver_version_constants
<> 144:ef7eb2e8f9f7 66 {
<> 144:ef7eb2e8f9f7 67 kFLASH_driverVersionName = 'F', /*!< Flash driver version name.*/
<> 144:ef7eb2e8f9f7 68 kFLASH_driverVersionMajor = 2, /*!< Major flash driver version.*/
<> 144:ef7eb2e8f9f7 69 kFLASH_driverVersionMinor = 1, /*!< Minor flash driver version.*/
<> 144:ef7eb2e8f9f7 70 kFLASH_driverVersionBugfix = 0 /*!< Bugfix for flash driver version.*/
<> 144:ef7eb2e8f9f7 71 };
<> 144:ef7eb2e8f9f7 72 /*@}*/
<> 144:ef7eb2e8f9f7 73
<> 144:ef7eb2e8f9f7 74 /*!
<> 144:ef7eb2e8f9f7 75 * @name Flash configuration
<> 144:ef7eb2e8f9f7 76 * @{
<> 144:ef7eb2e8f9f7 77 */
<> 144:ef7eb2e8f9f7 78 /*! @brief Whether to support FlexNVM in flash driver */
<> 144:ef7eb2e8f9f7 79 #if !defined(FLASH_SSD_CONFIG_ENABLE_FLEXNVM_SUPPORT)
<> 144:ef7eb2e8f9f7 80 #define FLASH_SSD_CONFIG_ENABLE_FLEXNVM_SUPPORT 1 /*!< Enable FlexNVM support by default. */
<> 144:ef7eb2e8f9f7 81 #endif
<> 144:ef7eb2e8f9f7 82
<> 144:ef7eb2e8f9f7 83 /*! @brief Whether the FlexNVM is enabled in flash driver */
<> 144:ef7eb2e8f9f7 84 #define FLASH_SSD_IS_FLEXNVM_ENABLED (FLASH_SSD_CONFIG_ENABLE_FLEXNVM_SUPPORT && FSL_FEATURE_FLASH_HAS_FLEX_NVM)
<> 144:ef7eb2e8f9f7 85
<> 144:ef7eb2e8f9f7 86 /*! @brief Flash driver location. */
<> 144:ef7eb2e8f9f7 87 #if !defined(FLASH_DRIVER_IS_FLASH_RESIDENT)
<> 144:ef7eb2e8f9f7 88 #if (!defined(BL_TARGET_ROM) && !defined(BL_TARGET_RAM))
<> 144:ef7eb2e8f9f7 89 #define FLASH_DRIVER_IS_FLASH_RESIDENT 1 /*!< Used for flash resident application. */
<> 144:ef7eb2e8f9f7 90 #else
<> 144:ef7eb2e8f9f7 91 #define FLASH_DRIVER_IS_FLASH_RESIDENT 0 /*!< Used for non-flash resident application. */
<> 144:ef7eb2e8f9f7 92 #endif
<> 144:ef7eb2e8f9f7 93 #endif
<> 144:ef7eb2e8f9f7 94
<> 144:ef7eb2e8f9f7 95 /*! @brief Flash Driver Export option */
<> 144:ef7eb2e8f9f7 96 #if !defined(FLASH_DRIVER_IS_EXPORTED)
<> 144:ef7eb2e8f9f7 97 #if (defined(BL_TARGET_ROM) || defined(BL_TARGET_FLASH))
<> 144:ef7eb2e8f9f7 98 #define FLASH_DRIVER_IS_EXPORTED 1 /*!< Used for ROM bootloader. */
<> 144:ef7eb2e8f9f7 99 #else
<> 144:ef7eb2e8f9f7 100 #define FLASH_DRIVER_IS_EXPORTED 0 /*!< Used for SDK application. */
<> 144:ef7eb2e8f9f7 101 #endif
<> 144:ef7eb2e8f9f7 102 #endif
<> 144:ef7eb2e8f9f7 103 /*@}*/
<> 144:ef7eb2e8f9f7 104
<> 144:ef7eb2e8f9f7 105 /*!
<> 144:ef7eb2e8f9f7 106 * @name Flash status
<> 144:ef7eb2e8f9f7 107 * @{
<> 144:ef7eb2e8f9f7 108 */
<> 144:ef7eb2e8f9f7 109 /*! @brief Flash driver status group. */
<> 144:ef7eb2e8f9f7 110 #if defined(kStatusGroup_FlashDriver)
<> 144:ef7eb2e8f9f7 111 #define kStatusGroupGeneric kStatusGroup_Generic
<> 144:ef7eb2e8f9f7 112 #define kStatusGroupFlashDriver kStatusGroup_FlashDriver
<> 144:ef7eb2e8f9f7 113 #elif defined(kStatusGroup_FLASH)
<> 144:ef7eb2e8f9f7 114 #define kStatusGroupGeneric kStatusGroup_Generic
<> 144:ef7eb2e8f9f7 115 #define kStatusGroupFlashDriver kStatusGroup_FLASH
<> 144:ef7eb2e8f9f7 116 #else
<> 144:ef7eb2e8f9f7 117 #define kStatusGroupGeneric 0
<> 144:ef7eb2e8f9f7 118 #define kStatusGroupFlashDriver 1
<> 144:ef7eb2e8f9f7 119 #endif
<> 144:ef7eb2e8f9f7 120
<> 144:ef7eb2e8f9f7 121 /*! @brief Construct a status code value from a group and code number. */
<> 144:ef7eb2e8f9f7 122 #if !defined(MAKE_STATUS)
<> 144:ef7eb2e8f9f7 123 #define MAKE_STATUS(group, code) ((((group)*100) + (code)))
<> 144:ef7eb2e8f9f7 124 #endif
<> 144:ef7eb2e8f9f7 125
<> 144:ef7eb2e8f9f7 126 /*!
<> 144:ef7eb2e8f9f7 127 * @brief Flash driver status codes.
<> 144:ef7eb2e8f9f7 128 */
<> 144:ef7eb2e8f9f7 129 enum _flash_status
<> 144:ef7eb2e8f9f7 130 {
<> 144:ef7eb2e8f9f7 131 kStatus_FLASH_Success = MAKE_STATUS(kStatusGroupGeneric, 0), /*!< Api is executed successfully*/
<> 144:ef7eb2e8f9f7 132 kStatus_FLASH_InvalidArgument = MAKE_STATUS(kStatusGroupGeneric, 4), /*!< Invalid argument*/
<> 144:ef7eb2e8f9f7 133 kStatus_FLASH_SizeError = MAKE_STATUS(kStatusGroupFlashDriver, 0), /*!< Error size*/
<> 144:ef7eb2e8f9f7 134 kStatus_FLASH_AlignmentError =
<> 144:ef7eb2e8f9f7 135 MAKE_STATUS(kStatusGroupFlashDriver, 1), /*!< Parameter is not aligned with specified baseline*/
<> 144:ef7eb2e8f9f7 136 kStatus_FLASH_AddressError = MAKE_STATUS(kStatusGroupFlashDriver, 2), /*!< Address is out of range */
<> 144:ef7eb2e8f9f7 137 kStatus_FLASH_AccessError =
<> 144:ef7eb2e8f9f7 138 MAKE_STATUS(kStatusGroupFlashDriver, 3), /*!< Invalid instruction codes and out-of bounds addresses */
<> 144:ef7eb2e8f9f7 139 kStatus_FLASH_ProtectionViolation = MAKE_STATUS(
<> 144:ef7eb2e8f9f7 140 kStatusGroupFlashDriver, 4), /*!< The program/erase operation is requested to execute on protected areas */
<> 144:ef7eb2e8f9f7 141 kStatus_FLASH_CommandFailure =
<> 144:ef7eb2e8f9f7 142 MAKE_STATUS(kStatusGroupFlashDriver, 5), /*!< Run-time error during command execution. */
<> 144:ef7eb2e8f9f7 143 kStatus_FLASH_UnknownProperty = MAKE_STATUS(kStatusGroupFlashDriver, 6), /*!< Unknown property.*/
<> 144:ef7eb2e8f9f7 144 kStatus_FLASH_EraseKeyError = MAKE_STATUS(kStatusGroupFlashDriver, 7), /*!< Api erase key is invalid.*/
<> 144:ef7eb2e8f9f7 145 kStatus_FLASH_RegionExecuteOnly = MAKE_STATUS(kStatusGroupFlashDriver, 8), /*!< Current region is execute only.*/
<> 144:ef7eb2e8f9f7 146 kStatus_FLASH_ExecuteInRamFunctionNotReady =
<> 144:ef7eb2e8f9f7 147 MAKE_STATUS(kStatusGroupFlashDriver, 9), /*!< Execute-in-ram function is not available.*/
<> 144:ef7eb2e8f9f7 148 kStatus_FLASH_PartitionStatusUpdateFailure =
<> 144:ef7eb2e8f9f7 149 MAKE_STATUS(kStatusGroupFlashDriver, 10), /*!< Failed to update partition status.*/
<> 144:ef7eb2e8f9f7 150 kStatus_FLASH_SetFlexramAsEepromError =
<> 144:ef7eb2e8f9f7 151 MAKE_STATUS(kStatusGroupFlashDriver, 11), /*!< Failed to set flexram as eeprom.*/
<> 144:ef7eb2e8f9f7 152 kStatus_FLASH_RecoverFlexramAsRamError =
<> 144:ef7eb2e8f9f7 153 MAKE_STATUS(kStatusGroupFlashDriver, 12), /*!< Failed to recover flexram as ram.*/
<> 144:ef7eb2e8f9f7 154 kStatus_FLASH_SetFlexramAsRamError = MAKE_STATUS(kStatusGroupFlashDriver, 13), /*!< Failed to set flexram as ram.*/
<> 144:ef7eb2e8f9f7 155 kStatus_FLASH_RecoverFlexramAsEepromError =
<> 144:ef7eb2e8f9f7 156 MAKE_STATUS(kStatusGroupFlashDriver, 14), /*!< Failed to recover flexram as eeprom.*/
<> 144:ef7eb2e8f9f7 157 kStatus_FLASH_CommandNotSupported = MAKE_STATUS(kStatusGroupFlashDriver, 15), /*!< Flash api is not supported.*/
<> 144:ef7eb2e8f9f7 158 kStatus_FLASH_SwapSystemNotInUninitialized =
<> 144:ef7eb2e8f9f7 159 MAKE_STATUS(kStatusGroupFlashDriver, 16), /*!< Swap system is not in uninitialzed state.*/
<> 144:ef7eb2e8f9f7 160 kStatus_FLASH_SwapIndicatorAddressError =
<> 144:ef7eb2e8f9f7 161 MAKE_STATUS(kStatusGroupFlashDriver, 17), /*!< Swap indicator address is invalid.*/
<> 144:ef7eb2e8f9f7 162 };
<> 144:ef7eb2e8f9f7 163 /*@}*/
<> 144:ef7eb2e8f9f7 164
<> 144:ef7eb2e8f9f7 165 /*!
<> 144:ef7eb2e8f9f7 166 * @name Flash API key
<> 144:ef7eb2e8f9f7 167 * @{
<> 144:ef7eb2e8f9f7 168 */
<> 144:ef7eb2e8f9f7 169 /*! @brief Construct the four char code for flash driver API key. */
<> 144:ef7eb2e8f9f7 170 #if !defined(FOUR_CHAR_CODE)
<> 144:ef7eb2e8f9f7 171 #define FOUR_CHAR_CODE(a, b, c, d) (((d) << 24) | ((c) << 16) | ((b) << 8) | ((a)))
<> 144:ef7eb2e8f9f7 172 #endif
<> 144:ef7eb2e8f9f7 173
<> 144:ef7eb2e8f9f7 174 /*!
<> 144:ef7eb2e8f9f7 175 * @brief Enumeration for flash driver API keys.
<> 144:ef7eb2e8f9f7 176 *
<> 144:ef7eb2e8f9f7 177 * @note The resulting value is built with a byte order such that the string
<> 144:ef7eb2e8f9f7 178 * being readable in expected order when viewed in a hex editor, if the value
<> 144:ef7eb2e8f9f7 179 * is treated as a 32-bit little endian value.
<> 144:ef7eb2e8f9f7 180 */
<> 144:ef7eb2e8f9f7 181 enum _flash_driver_api_keys
<> 144:ef7eb2e8f9f7 182 {
<> 144:ef7eb2e8f9f7 183 kFLASH_apiEraseKey = FOUR_CHAR_CODE('k', 'f', 'e', 'k') /*!< Key value used to validate all flash erase APIs.*/
<> 144:ef7eb2e8f9f7 184 };
<> 144:ef7eb2e8f9f7 185 /*@}*/
<> 144:ef7eb2e8f9f7 186
<> 144:ef7eb2e8f9f7 187 /*!
<> 144:ef7eb2e8f9f7 188 * @brief Enumeration for supported flash margin levels.
<> 144:ef7eb2e8f9f7 189 */
<> 144:ef7eb2e8f9f7 190 typedef enum _flash_margin_value
<> 144:ef7eb2e8f9f7 191 {
<> 144:ef7eb2e8f9f7 192 kFLASH_marginValueNormal, /*!< Use the 'normal' read level for 1s.*/
<> 144:ef7eb2e8f9f7 193 kFLASH_marginValueUser, /*!< Apply the 'User' margin to the normal read-1 level.*/
<> 144:ef7eb2e8f9f7 194 kFLASH_marginValueFactory, /*!< Apply the 'Factory' margin to the normal read-1 level.*/
<> 144:ef7eb2e8f9f7 195 kFLASH_marginValueInvalid /*!< Not real margin level, Used to determine the range of valid margin level. */
<> 144:ef7eb2e8f9f7 196 } flash_margin_value_t;
<> 144:ef7eb2e8f9f7 197
<> 144:ef7eb2e8f9f7 198 /*!
<> 144:ef7eb2e8f9f7 199 * @brief Enumeration for the three possible flash security states.
<> 144:ef7eb2e8f9f7 200 */
<> 144:ef7eb2e8f9f7 201 typedef enum _flash_security_state
<> 144:ef7eb2e8f9f7 202 {
<> 144:ef7eb2e8f9f7 203 kFLASH_securityStateNotSecure, /*!< Flash is not secure.*/
<> 144:ef7eb2e8f9f7 204 kFLASH_securityStateBackdoorEnabled, /*!< Flash backdoor is enabled.*/
<> 144:ef7eb2e8f9f7 205 kFLASH_securityStateBackdoorDisabled /*!< Flash backdoor is disabled.*/
<> 144:ef7eb2e8f9f7 206 } flash_security_state_t;
<> 144:ef7eb2e8f9f7 207
<> 144:ef7eb2e8f9f7 208 /*!
<> 144:ef7eb2e8f9f7 209 * @brief Enumeration for the three possible flash protection levels.
<> 144:ef7eb2e8f9f7 210 */
<> 144:ef7eb2e8f9f7 211 typedef enum _flash_protection_state
<> 144:ef7eb2e8f9f7 212 {
<> 144:ef7eb2e8f9f7 213 kFLASH_protectionStateUnprotected, /*!< Flash region is not protected.*/
<> 144:ef7eb2e8f9f7 214 kFLASH_protectionStateProtected, /*!< Flash region is protected.*/
<> 144:ef7eb2e8f9f7 215 kFLASH_protectionStateMixed /*!< Flash is mixed with protected and unprotected region.*/
<> 144:ef7eb2e8f9f7 216 } flash_protection_state_t;
<> 144:ef7eb2e8f9f7 217
<> 144:ef7eb2e8f9f7 218 /*!
<> 144:ef7eb2e8f9f7 219 * @brief Enumeration for the three possible flash execute access levels.
<> 144:ef7eb2e8f9f7 220 */
<> 144:ef7eb2e8f9f7 221 typedef enum _flash_execute_only_access_state
<> 144:ef7eb2e8f9f7 222 {
<> 144:ef7eb2e8f9f7 223 kFLASH_accessStateUnLimited, /*!< Flash region is unLimited.*/
<> 144:ef7eb2e8f9f7 224 kFLASH_accessStateExecuteOnly, /*!< Flash region is execute only.*/
<> 144:ef7eb2e8f9f7 225 kFLASH_accessStateMixed /*!< Flash is mixed with unLimited and execute only region.*/
<> 144:ef7eb2e8f9f7 226 } flash_execute_only_access_state_t;
<> 144:ef7eb2e8f9f7 227
<> 144:ef7eb2e8f9f7 228 /*!
<> 144:ef7eb2e8f9f7 229 * @brief Enumeration for various flash properties.
<> 144:ef7eb2e8f9f7 230 */
<> 144:ef7eb2e8f9f7 231 typedef enum _flash_property_tag
<> 144:ef7eb2e8f9f7 232 {
<> 144:ef7eb2e8f9f7 233 kFLASH_propertyPflashSectorSize = 0x00U, /*!< Pflash sector size property.*/
<> 144:ef7eb2e8f9f7 234 kFLASH_propertyPflashTotalSize = 0x01U, /*!< Pflash total size property.*/
<> 144:ef7eb2e8f9f7 235 kFLASH_propertyPflashBlockSize = 0x02U, /*!< Pflash block size property.*/
<> 144:ef7eb2e8f9f7 236 kFLASH_propertyPflashBlockCount = 0x03U, /*!< Pflash block count property.*/
<> 144:ef7eb2e8f9f7 237 kFLASH_propertyPflashBlockBaseAddr = 0x04U, /*!< Pflash block base address property.*/
<> 144:ef7eb2e8f9f7 238 kFLASH_propertyPflashFacSupport = 0x05U, /*!< Pflash fac support property.*/
<> 144:ef7eb2e8f9f7 239 kFLASH_propertyPflashAccessSegmentSize = 0x06U, /*!< Pflash access segment size property.*/
<> 144:ef7eb2e8f9f7 240 kFLASH_propertyPflashAccessSegmentCount = 0x07U, /*!< Pflash access segment count property.*/
<> 144:ef7eb2e8f9f7 241 kFLASH_propertyFlexRamBlockBaseAddr = 0x08U, /*!< FlexRam block base address property.*/
<> 144:ef7eb2e8f9f7 242 kFLASH_propertyFlexRamTotalSize = 0x09U, /*!< FlexRam total size property.*/
<> 144:ef7eb2e8f9f7 243 kFLASH_propertyDflashSectorSize = 0x10U, /*!< Dflash sector size property.*/
<> 144:ef7eb2e8f9f7 244 kFLASH_propertyDflashTotalSize = 0x11U, /*!< Dflash total size property.*/
<> 144:ef7eb2e8f9f7 245 kFLASH_propertyDflashBlockSize = 0x12U, /*!< Dflash block count property.*/
<> 144:ef7eb2e8f9f7 246 kFLASH_propertyDflashBlockCount = 0x13U, /*!< Dflash block base address property.*/
<> 144:ef7eb2e8f9f7 247 kFLASH_propertyDflashBlockBaseAddr = 0x14U, /*!< Eeprom total size property.*/
<> 144:ef7eb2e8f9f7 248 kFLASH_propertyEepromTotalSize = 0x15U
<> 144:ef7eb2e8f9f7 249 } flash_property_tag_t;
<> 144:ef7eb2e8f9f7 250
<> 144:ef7eb2e8f9f7 251 /*!
<> 144:ef7eb2e8f9f7 252 * @brief Constants for execute-in-ram flash function.
<> 144:ef7eb2e8f9f7 253 */
<> 144:ef7eb2e8f9f7 254 enum _flash_execute_in_ram_function_constants
<> 144:ef7eb2e8f9f7 255 {
<> 144:ef7eb2e8f9f7 256 kFLASH_executeInRamFunctionMaxSize = 64U, /*!< Max size of execute-in-ram function.*/
<> 144:ef7eb2e8f9f7 257 kFLASH_executeInRamFunctionTotalNum = 2U /*!< Total number of execute-in-ram functions.*/
<> 144:ef7eb2e8f9f7 258 };
<> 144:ef7eb2e8f9f7 259
<> 144:ef7eb2e8f9f7 260 /*!
<> 144:ef7eb2e8f9f7 261 * @brief Flash execute-in-ram function information.
<> 144:ef7eb2e8f9f7 262 */
<> 144:ef7eb2e8f9f7 263 typedef struct _flash_execute_in_ram_function_config
<> 144:ef7eb2e8f9f7 264 {
<> 144:ef7eb2e8f9f7 265 uint32_t activeFunctionCount; /*!< Number of available execute-in-ram functions.*/
<> 144:ef7eb2e8f9f7 266 uint8_t *flashRunCommand; /*!< execute-in-ram function: flash_run_command.*/
<> 144:ef7eb2e8f9f7 267 uint8_t *flashCacheClearCommand; /*!< execute-in-ram function: flash_cache_clear_command.*/
<> 144:ef7eb2e8f9f7 268 } flash_execute_in_ram_function_config_t;
<> 144:ef7eb2e8f9f7 269
<> 144:ef7eb2e8f9f7 270 /*!
<> 144:ef7eb2e8f9f7 271 * @brief Enumeration for the two possible options of flash read resource command.
<> 144:ef7eb2e8f9f7 272 */
<> 144:ef7eb2e8f9f7 273 typedef enum _flash_read_resource_option
<> 144:ef7eb2e8f9f7 274 {
<> 144:ef7eb2e8f9f7 275 kFLASH_resourceOptionFlashIfr =
<> 144:ef7eb2e8f9f7 276 0x00U, /*!< Select code for Program flash 0 IFR, Program flash swap 0 IFR, Data flash 0 IFR */
<> 144:ef7eb2e8f9f7 277 kFLASH_resourceOptionVersionId = 0x01U /*!< Select code for Version ID*/
<> 144:ef7eb2e8f9f7 278 } flash_read_resource_option_t;
<> 144:ef7eb2e8f9f7 279
<> 144:ef7eb2e8f9f7 280 /*!
<> 144:ef7eb2e8f9f7 281 * @brief Enumeration for the range of special-purpose flash resource
<> 144:ef7eb2e8f9f7 282 */
<> 144:ef7eb2e8f9f7 283 enum _flash_read_resource_range
<> 144:ef7eb2e8f9f7 284 {
<> 144:ef7eb2e8f9f7 285 #if (FSL_FEATURE_FLASH_IS_FTFE == 1)
<> 144:ef7eb2e8f9f7 286 kFLASH_resourceRangePflashIfrSizeInBytes = 1024U, /*!< Pflash IFR size in byte.*/
<> 144:ef7eb2e8f9f7 287 kFLASH_resourceRangeVersionIdSizeInBytes = 8U, /*!< Version ID IFR size in byte.*/
<> 144:ef7eb2e8f9f7 288 kFLASH_resourceRangeVersionIdStart = 0x08U, /*!< Version ID IFR start address.*/
<> 144:ef7eb2e8f9f7 289 kFLASH_resourceRangeVersionIdEnd = 0x0FU, /*!< Version ID IFR end address.*/
<> 144:ef7eb2e8f9f7 290 #else /* FSL_FEATURE_FLASH_IS_FTFL == 1 or FSL_FEATURE_FLASH_IS_FTFA = =1 */
<> 144:ef7eb2e8f9f7 291 kFLASH_resourceRangePflashIfrSizeInBytes = 256U, /*!< Pflash IFR size in byte.*/
<> 144:ef7eb2e8f9f7 292 kFLASH_resourceRangeVersionIdSizeInBytes = 8U, /*!< Version ID IFR size in byte.*/
<> 144:ef7eb2e8f9f7 293 kFLASH_resourceRangeVersionIdStart = 0x00U, /*!< Version ID IFR start address.*/
<> 144:ef7eb2e8f9f7 294 kFLASH_resourceRangeVersionIdEnd = 0x07U, /*!< Version ID IFR end address.*/
<> 144:ef7eb2e8f9f7 295 #endif
<> 144:ef7eb2e8f9f7 296 kFLASH_resourceRangePflashSwapIfrStart = 0x40000U, /*!< Pflash swap IFR start address.*/
<> 144:ef7eb2e8f9f7 297 kFLASH_resourceRangePflashSwapIfrEnd = 0x403FFU, /*!< Pflash swap IFR end address.*/
<> 144:ef7eb2e8f9f7 298 kFLASH_resourceRangeDflashIfrStart = 0x800000U, /*!< Dflash IFR start address.*/
<> 144:ef7eb2e8f9f7 299 kFLASH_resourceRangeDflashIfrEnd = 0x8003FFU, /*!< Dflash IFR end address.*/
<> 144:ef7eb2e8f9f7 300 };
<> 144:ef7eb2e8f9f7 301
<> 144:ef7eb2e8f9f7 302 /*!
<> 144:ef7eb2e8f9f7 303 * @brief Enumeration for the two possilbe options of set flexram function command.
<> 144:ef7eb2e8f9f7 304 */
<> 144:ef7eb2e8f9f7 305 typedef enum _flash_flexram_function_option
<> 144:ef7eb2e8f9f7 306 {
<> 144:ef7eb2e8f9f7 307 kFLASH_flexramFunctionOptionAvailableAsRam = 0xFFU, /*!< Option used to make FlexRAM available as RAM */
<> 144:ef7eb2e8f9f7 308 kFLASH_flexramFunctionOptionAvailableForEeprom = 0x00U /*!< Option used to make FlexRAM available for EEPROM */
<> 144:ef7eb2e8f9f7 309 } flash_flexram_function_option_t;
<> 144:ef7eb2e8f9f7 310
<> 144:ef7eb2e8f9f7 311 /*!
<> 144:ef7eb2e8f9f7 312 * @brief Enumeration for the possible options of Swap function
<> 144:ef7eb2e8f9f7 313 */
<> 144:ef7eb2e8f9f7 314 typedef enum _flash_swap_function_option
<> 144:ef7eb2e8f9f7 315 {
<> 144:ef7eb2e8f9f7 316 kFLASH_swapFunctionOptionEnable = 0x00U, /*!< Option used to enable Swap function */
<> 144:ef7eb2e8f9f7 317 kFLASH_swapFunctionOptionDisable = 0x01U /*!< Option used to Disable Swap function */
<> 144:ef7eb2e8f9f7 318 } flash_swap_function_option_t;
<> 144:ef7eb2e8f9f7 319
<> 144:ef7eb2e8f9f7 320 /*!
<> 144:ef7eb2e8f9f7 321 * @brief Enumeration for the possible options of Swap Control commands
<> 144:ef7eb2e8f9f7 322 */
<> 144:ef7eb2e8f9f7 323 typedef enum _flash_swap_control_option
<> 144:ef7eb2e8f9f7 324 {
<> 144:ef7eb2e8f9f7 325 kFLASH_swapControlOptionIntializeSystem = 0x01U, /*!< Option used to Intialize Swap System */
<> 144:ef7eb2e8f9f7 326 kFLASH_swapControlOptionSetInUpdateState = 0x02U, /*!< Option used to Set Swap in Update State */
<> 144:ef7eb2e8f9f7 327 kFLASH_swapControlOptionSetInCompleteState = 0x04U, /*!< Option used to Set Swap in Complete State */
<> 144:ef7eb2e8f9f7 328 kFLASH_swapControlOptionReportStatus = 0x08U, /*!< Option used to Report Swap Status */
<> 144:ef7eb2e8f9f7 329 kFLASH_swapControlOptionDisableSystem = 0x10U /*!< Option used to Disable Swap Status */
<> 144:ef7eb2e8f9f7 330 } flash_swap_control_option_t;
<> 144:ef7eb2e8f9f7 331
<> 144:ef7eb2e8f9f7 332 /*!
<> 144:ef7eb2e8f9f7 333 * @brief Enumeration for the possible flash swap status.
<> 144:ef7eb2e8f9f7 334 */
<> 144:ef7eb2e8f9f7 335 typedef enum _flash_swap_state
<> 144:ef7eb2e8f9f7 336 {
<> 144:ef7eb2e8f9f7 337 kFLASH_swapStateUninitialized = 0x00U, /*!< Flash swap system is in uninitialized state.*/
<> 144:ef7eb2e8f9f7 338 kFLASH_swapStateReady = 0x01U, /*!< Flash swap system is in ready state.*/
<> 144:ef7eb2e8f9f7 339 kFLASH_swapStateUpdate = 0x02U, /*!< Flash swap system is in update state.*/
<> 144:ef7eb2e8f9f7 340 kFLASH_swapStateUpdateErased = 0x03U, /*!< Flash swap system is in updateErased state.*/
<> 144:ef7eb2e8f9f7 341 kFLASH_swapStateComplete = 0x04U, /*!< Flash swap system is in complete state.*/
<> 144:ef7eb2e8f9f7 342 kFLASH_swapStateDisabled = 0x05U /*!< Flash swap system is in disabled state.*/
<> 144:ef7eb2e8f9f7 343 } flash_swap_state_t;
<> 144:ef7eb2e8f9f7 344
<> 144:ef7eb2e8f9f7 345 /*!
<> 144:ef7eb2e8f9f7 346 * @breif Enumeration for the possible flash swap block status
<> 144:ef7eb2e8f9f7 347 */
<> 144:ef7eb2e8f9f7 348 typedef enum _flash_swap_block_status
<> 144:ef7eb2e8f9f7 349 {
<> 144:ef7eb2e8f9f7 350 kFLASH_swapBlockStatusLowerHalfProgramBlocksAtZero =
<> 144:ef7eb2e8f9f7 351 0x00U, /*!< Swap block status is that lower half program block at zero.*/
<> 144:ef7eb2e8f9f7 352 kFLASH_swapBlockStatusUpperHalfProgramBlocksAtZero =
<> 144:ef7eb2e8f9f7 353 0x01U, /*!< Swap block status is that upper half program block at zero.*/
<> 144:ef7eb2e8f9f7 354 } flash_swap_block_status_t;
<> 144:ef7eb2e8f9f7 355
<> 144:ef7eb2e8f9f7 356 /*!
<> 144:ef7eb2e8f9f7 357 * @brief Flash Swap information.
<> 144:ef7eb2e8f9f7 358 */
<> 144:ef7eb2e8f9f7 359 typedef struct _flash_swap_state_config
<> 144:ef7eb2e8f9f7 360 {
<> 144:ef7eb2e8f9f7 361 flash_swap_state_t flashSwapState; /*!< Current swap system status.*/
<> 144:ef7eb2e8f9f7 362 flash_swap_block_status_t currentSwapBlockStatus; /*!< Current swap block status.*/
<> 144:ef7eb2e8f9f7 363 flash_swap_block_status_t nextSwapBlockStatus; /*!< Next swap block status.*/
<> 144:ef7eb2e8f9f7 364 } flash_swap_state_config_t;
<> 144:ef7eb2e8f9f7 365
<> 144:ef7eb2e8f9f7 366 /*!
<> 144:ef7eb2e8f9f7 367 * @brief Flash Swap IFR fileds.
<> 144:ef7eb2e8f9f7 368 */
<> 144:ef7eb2e8f9f7 369 typedef struct _flash_swap_ifr_field_config
<> 144:ef7eb2e8f9f7 370 {
<> 144:ef7eb2e8f9f7 371 uint16_t swapIndicatorAddress; /*!< Swap indicator address field.*/
<> 144:ef7eb2e8f9f7 372 uint16_t swapEnableWord; /*!< Swap enable word field.*/
<> 144:ef7eb2e8f9f7 373 uint8_t reserved0[6]; /*!< Reserved field.*/
<> 144:ef7eb2e8f9f7 374 uint16_t swapDisableWord; /*!< Swap disable word field.*/
<> 144:ef7eb2e8f9f7 375 uint8_t reserved1[4]; /*!< Reserved field.*/
<> 144:ef7eb2e8f9f7 376 } flash_swap_ifr_field_config_t;
<> 144:ef7eb2e8f9f7 377
<> 144:ef7eb2e8f9f7 378 /*!
<> 144:ef7eb2e8f9f7 379 * @brief Enumeration for FlexRAM load during reset option.
<> 144:ef7eb2e8f9f7 380 */
<> 144:ef7eb2e8f9f7 381 typedef enum _flash_partition_flexram_load_option
<> 144:ef7eb2e8f9f7 382 {
<> 144:ef7eb2e8f9f7 383 kFLASH_partitionFlexramLoadOptionLoadedWithValidEepromData =
<> 144:ef7eb2e8f9f7 384 0x00U, /*!< FlexRAM is loaded with valid EEPROM data during reset sequence.*/
<> 144:ef7eb2e8f9f7 385 kFLASH_partitionFlexramLoadOptionNotLoaded = 0x01U /*!< FlexRAM is not loaded during reset sequence.*/
<> 144:ef7eb2e8f9f7 386 } flash_partition_flexram_load_option_t;
<> 144:ef7eb2e8f9f7 387
<> 144:ef7eb2e8f9f7 388 /*! @brief callback type used for pflash block*/
<> 144:ef7eb2e8f9f7 389 typedef void (*flash_callback_t)(void);
<> 144:ef7eb2e8f9f7 390
<> 144:ef7eb2e8f9f7 391 /*!
<> 144:ef7eb2e8f9f7 392 * @brief Active flash information for current operation.
<> 144:ef7eb2e8f9f7 393 */
<> 144:ef7eb2e8f9f7 394 typedef struct _flash_operation_config
<> 144:ef7eb2e8f9f7 395 {
<> 144:ef7eb2e8f9f7 396 uint32_t convertedAddress; /*!< Converted address for current flash type.*/
<> 144:ef7eb2e8f9f7 397 uint32_t activeSectorSize; /*!< Sector size of current flash type.*/
<> 144:ef7eb2e8f9f7 398 uint32_t activeBlockSize; /*!< Block size of current flash type.*/
<> 144:ef7eb2e8f9f7 399 uint32_t blockWriteUnitSize; /*!< write unit size.*/
<> 144:ef7eb2e8f9f7 400 uint32_t sectorCmdAddressAligment; /*!< Erase sector command address alignment.*/
<> 144:ef7eb2e8f9f7 401 uint32_t sectionCmdAddressAligment; /*!< Program/Verify section command address alignment.*/
<> 144:ef7eb2e8f9f7 402 uint32_t resourceCmdAddressAligment; /*!< Read resource command address alignment.*/
<> 144:ef7eb2e8f9f7 403 uint32_t checkCmdAddressAligment; /*!< Program check command address alignment.*/
<> 144:ef7eb2e8f9f7 404 } flash_operation_config_t;
<> 144:ef7eb2e8f9f7 405
<> 144:ef7eb2e8f9f7 406 /*! @brief Flash driver state information.
<> 144:ef7eb2e8f9f7 407 *
<> 144:ef7eb2e8f9f7 408 * An instance of this structure is allocated by the user of the flash driver and
<> 144:ef7eb2e8f9f7 409 * passed into each of the driver APIs.
<> 144:ef7eb2e8f9f7 410 */
<> 144:ef7eb2e8f9f7 411 typedef struct _flash_config
<> 144:ef7eb2e8f9f7 412 {
<> 144:ef7eb2e8f9f7 413 uint32_t PFlashBlockBase; /*!< Base address of the first PFlash block */
<> 144:ef7eb2e8f9f7 414 uint32_t PFlashTotalSize; /*!< Size of all combined PFlash block. */
<> 144:ef7eb2e8f9f7 415 uint32_t PFlashBlockCount; /*!< Number of PFlash blocks. */
<> 144:ef7eb2e8f9f7 416 uint32_t PFlashSectorSize; /*!< Size in bytes of a sector of PFlash. */
<> 144:ef7eb2e8f9f7 417 flash_callback_t PFlashCallback; /*!< Callback function for flash API. */
<> 144:ef7eb2e8f9f7 418 uint32_t PFlashAccessSegmentSize; /*!< Size in bytes of a access segment of PFlash. */
<> 144:ef7eb2e8f9f7 419 uint32_t PFlashAccessSegmentCount; /*!< Number of PFlash access segments. */
<> 144:ef7eb2e8f9f7 420 uint32_t *flashExecuteInRamFunctionInfo; /*!< Info struct of flash execute-in-ram function. */
<> 144:ef7eb2e8f9f7 421 uint32_t FlexRAMBlockBase; /*!< For FlexNVM device, this is the base address of FlexRAM
<> 144:ef7eb2e8f9f7 422 For non-FlexNVM device, this is the base address of acceleration RAM memory */
<> 144:ef7eb2e8f9f7 423 uint32_t FlexRAMTotalSize; /*!< For FlexNVM device, this is the size of FlexRAM
<> 144:ef7eb2e8f9f7 424 For non-FlexNVM device, this is the size of acceleration RAM memory */
<> 144:ef7eb2e8f9f7 425 uint32_t DFlashBlockBase; /*!< For FlexNVM device, this is the base address of D-Flash memory (FlexNVM memory);
<> 144:ef7eb2e8f9f7 426 For non-FlexNVM device, this field is unused */
<> 144:ef7eb2e8f9f7 427 uint32_t DFlashTotalSize; /*!< For FlexNVM device, this is total size of the FlexNVM memory;
<> 144:ef7eb2e8f9f7 428 For non-FlexNVM device, this field is unused */
<> 144:ef7eb2e8f9f7 429 uint32_t EEpromTotalSize; /*!< For FlexNVM device, this is the size in byte of EEPROM area which was partitioned
<> 144:ef7eb2e8f9f7 430 from FlexRAM;
<> 144:ef7eb2e8f9f7 431 For non-FlexNVM device, this field is unused */
<> 144:ef7eb2e8f9f7 432 } flash_config_t;
<> 144:ef7eb2e8f9f7 433
<> 144:ef7eb2e8f9f7 434 /*******************************************************************************
<> 144:ef7eb2e8f9f7 435 * API
<> 144:ef7eb2e8f9f7 436 ******************************************************************************/
<> 144:ef7eb2e8f9f7 437
<> 144:ef7eb2e8f9f7 438 #if defined(__cplusplus)
<> 144:ef7eb2e8f9f7 439 extern "C" {
<> 144:ef7eb2e8f9f7 440 #endif
<> 144:ef7eb2e8f9f7 441
<> 144:ef7eb2e8f9f7 442 /*!
<> 144:ef7eb2e8f9f7 443 * @name Initialization
<> 144:ef7eb2e8f9f7 444 * @{
<> 144:ef7eb2e8f9f7 445 */
<> 144:ef7eb2e8f9f7 446
<> 144:ef7eb2e8f9f7 447 /*!
<> 144:ef7eb2e8f9f7 448 * @brief Initializes global flash properties structure members
<> 144:ef7eb2e8f9f7 449 *
<> 144:ef7eb2e8f9f7 450 * This function checks and initializes Flash module for the other Flash APIs.
<> 144:ef7eb2e8f9f7 451 *
<> 144:ef7eb2e8f9f7 452 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 453 *
<> 144:ef7eb2e8f9f7 454 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 455 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 456 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 457 * @retval #kStatus_FLASH_PartitionStatusUpdateFailure Failed to update partition status.
<> 144:ef7eb2e8f9f7 458 */
<> 144:ef7eb2e8f9f7 459 status_t FLASH_Init(flash_config_t *config);
<> 144:ef7eb2e8f9f7 460
<> 144:ef7eb2e8f9f7 461 /*!
<> 144:ef7eb2e8f9f7 462 * @brief Set the desired flash callback function
<> 144:ef7eb2e8f9f7 463 *
<> 144:ef7eb2e8f9f7 464 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 465 * @param callback callback function to be stored in driver
<> 144:ef7eb2e8f9f7 466 *
<> 144:ef7eb2e8f9f7 467 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 468 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 469 */
<> 144:ef7eb2e8f9f7 470 status_t FLASH_SetCallback(flash_config_t *config, flash_callback_t callback);
<> 144:ef7eb2e8f9f7 471
<> 144:ef7eb2e8f9f7 472 /*!
<> 144:ef7eb2e8f9f7 473 * @brief Prepare flash execute-in-ram functions
<> 144:ef7eb2e8f9f7 474 *
<> 144:ef7eb2e8f9f7 475 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 476 *
<> 144:ef7eb2e8f9f7 477 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 478 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 479 */
<> 144:ef7eb2e8f9f7 480 #if FLASH_DRIVER_IS_FLASH_RESIDENT
<> 144:ef7eb2e8f9f7 481 status_t FLASH_PrepareExecuteInRamFunctions(flash_config_t *config);
<> 144:ef7eb2e8f9f7 482 #endif
<> 144:ef7eb2e8f9f7 483
<> 144:ef7eb2e8f9f7 484 /*@}*/
<> 144:ef7eb2e8f9f7 485
<> 144:ef7eb2e8f9f7 486 /*!
<> 144:ef7eb2e8f9f7 487 * @name Erasing
<> 144:ef7eb2e8f9f7 488 * @{
<> 144:ef7eb2e8f9f7 489 */
<> 144:ef7eb2e8f9f7 490
<> 144:ef7eb2e8f9f7 491 /*!
<> 144:ef7eb2e8f9f7 492 * @brief Erases entire flash
<> 144:ef7eb2e8f9f7 493 *
<> 144:ef7eb2e8f9f7 494 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 495 * @param key value used to validate all flash erase APIs.
<> 144:ef7eb2e8f9f7 496 *
<> 144:ef7eb2e8f9f7 497 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 498 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 499 * @retval #kStatus_FLASH_EraseKeyError Api erase key is invalid.
<> 144:ef7eb2e8f9f7 500 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 501 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 502 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 503 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 504 * @retval #kStatus_FLASH_PartitionStatusUpdateFailure Failed to update partition status
<> 144:ef7eb2e8f9f7 505 */
<> 144:ef7eb2e8f9f7 506 status_t FLASH_EraseAll(flash_config_t *config, uint32_t key);
<> 144:ef7eb2e8f9f7 507
<> 144:ef7eb2e8f9f7 508 /*!
<> 144:ef7eb2e8f9f7 509 * @brief Erases flash sectors encompassed by parameters passed into function
<> 144:ef7eb2e8f9f7 510 *
<> 144:ef7eb2e8f9f7 511 * This function erases the appropriate number of flash sectors based on the
<> 144:ef7eb2e8f9f7 512 * desired start address and length.
<> 144:ef7eb2e8f9f7 513 *
<> 144:ef7eb2e8f9f7 514 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 515 * @param start The start address of the desired flash memory to be erased.
<> 144:ef7eb2e8f9f7 516 * The start address does not need to be sector aligned but must be word-aligned.
<> 144:ef7eb2e8f9f7 517 * @param lengthInBytes The length, given in bytes (not words or long-words)
<> 144:ef7eb2e8f9f7 518 * to be erased. Must be word aligned.
<> 144:ef7eb2e8f9f7 519 * @param key value used to validate all flash erase APIs.
<> 144:ef7eb2e8f9f7 520 *
<> 144:ef7eb2e8f9f7 521 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 522 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 523 * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with specified baseline.
<> 144:ef7eb2e8f9f7 524 * @retval #kStatus_FLASH_AddressError Address is out of range.
<> 144:ef7eb2e8f9f7 525 * @retval #kStatus_FLASH_EraseKeyError Api erase key is invalid.
<> 144:ef7eb2e8f9f7 526 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 527 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 528 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 529 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 530 */
<> 144:ef7eb2e8f9f7 531 status_t FLASH_Erase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key);
<> 144:ef7eb2e8f9f7 532
<> 144:ef7eb2e8f9f7 533 /*!
<> 144:ef7eb2e8f9f7 534 * @brief Erases entire flash, including protected sectors.
<> 144:ef7eb2e8f9f7 535 *
<> 144:ef7eb2e8f9f7 536 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 537 * @param key value used to validate all flash erase APIs.
<> 144:ef7eb2e8f9f7 538 *
<> 144:ef7eb2e8f9f7 539 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 540 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 541 * @retval #kStatus_FLASH_EraseKeyError Api erase key is invalid.
<> 144:ef7eb2e8f9f7 542 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 543 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 544 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 545 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 546 * @retval #kStatus_FLASH_PartitionStatusUpdateFailure Failed to update partition status
<> 144:ef7eb2e8f9f7 547 */
<> 144:ef7eb2e8f9f7 548 #if defined(FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD) && FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD
<> 144:ef7eb2e8f9f7 549 status_t FLASH_EraseAllUnsecure(flash_config_t *config, uint32_t key);
<> 144:ef7eb2e8f9f7 550 #endif
<> 144:ef7eb2e8f9f7 551
<> 144:ef7eb2e8f9f7 552 /*!
<> 144:ef7eb2e8f9f7 553 * @brief Erases all program flash execute-only segments defined by the FXACC registers.
<> 144:ef7eb2e8f9f7 554 *
<> 144:ef7eb2e8f9f7 555 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 556 * @param key value used to validate all flash erase APIs.
<> 144:ef7eb2e8f9f7 557 *
<> 144:ef7eb2e8f9f7 558 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 559 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 560 * @retval #kStatus_FLASH_EraseKeyError Api erase key is invalid.
<> 144:ef7eb2e8f9f7 561 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 562 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 563 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 564 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 565 */
<> 144:ef7eb2e8f9f7 566 status_t FLASH_EraseAllExecuteOnlySegments(flash_config_t *config, uint32_t key);
<> 144:ef7eb2e8f9f7 567
<> 144:ef7eb2e8f9f7 568 /*@}*/
<> 144:ef7eb2e8f9f7 569
<> 144:ef7eb2e8f9f7 570 /*!
<> 144:ef7eb2e8f9f7 571 * @name Programming
<> 144:ef7eb2e8f9f7 572 * @{
<> 144:ef7eb2e8f9f7 573 */
<> 144:ef7eb2e8f9f7 574
<> 144:ef7eb2e8f9f7 575 /*!
<> 144:ef7eb2e8f9f7 576 * @brief Programs flash with data at locations passed in through parameters
<> 144:ef7eb2e8f9f7 577 *
<> 144:ef7eb2e8f9f7 578 * This function programs the flash memory with desired data for a given
<> 144:ef7eb2e8f9f7 579 * flash area as determined by the start address and length.
<> 144:ef7eb2e8f9f7 580 *
<> 144:ef7eb2e8f9f7 581 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 582 * @param start The start address of the desired flash memory to be programmed. Must be
<> 144:ef7eb2e8f9f7 583 * word-aligned.
<> 144:ef7eb2e8f9f7 584 * @param src Pointer to the source buffer of data that is to be programmed
<> 144:ef7eb2e8f9f7 585 * into the flash.
<> 144:ef7eb2e8f9f7 586 * @param lengthInBytes The length, given in bytes (not words or long-words)
<> 144:ef7eb2e8f9f7 587 * to be programmed. Must be word-aligned.
<> 144:ef7eb2e8f9f7 588 *
<> 144:ef7eb2e8f9f7 589 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 590 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 591 * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with specified baseline.
<> 144:ef7eb2e8f9f7 592 * @retval #kStatus_FLASH_AddressError Address is out of range.
<> 144:ef7eb2e8f9f7 593 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 594 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 595 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 596 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 597 */
<> 144:ef7eb2e8f9f7 598 status_t FLASH_Program(flash_config_t *config, uint32_t start, uint32_t *src, uint32_t lengthInBytes);
<> 144:ef7eb2e8f9f7 599
<> 144:ef7eb2e8f9f7 600 /*!
<> 144:ef7eb2e8f9f7 601 * @brief Programs Program Once Field through parameters
<> 144:ef7eb2e8f9f7 602 *
<> 144:ef7eb2e8f9f7 603 * This function programs the Program Once Field with desired data for a given
<> 144:ef7eb2e8f9f7 604 * flash area as determined by the index and length.
<> 144:ef7eb2e8f9f7 605 *
<> 144:ef7eb2e8f9f7 606 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 607 * @param index The index indicating which area of Program Once Field to be programmed.
<> 144:ef7eb2e8f9f7 608 * @param src Pointer to the source buffer of data that is to be programmed
<> 144:ef7eb2e8f9f7 609 * into the Program Once Field.
<> 144:ef7eb2e8f9f7 610 * @param lengthInBytes The length, given in bytes (not words or long-words)
<> 144:ef7eb2e8f9f7 611 * to be programmed. Must be word-aligned.
<> 144:ef7eb2e8f9f7 612 *
<> 144:ef7eb2e8f9f7 613 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 614 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 615 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 616 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 617 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 618 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 619 */
<> 144:ef7eb2e8f9f7 620 status_t FLASH_ProgramOnce(flash_config_t *config, uint32_t index, uint32_t *src, uint32_t lengthInBytes);
<> 144:ef7eb2e8f9f7 621
<> 144:ef7eb2e8f9f7 622 /*!
<> 144:ef7eb2e8f9f7 623 * @brief Programs flash with data at locations passed in through parameters via Program Section command
<> 144:ef7eb2e8f9f7 624 *
<> 144:ef7eb2e8f9f7 625 * This function programs the flash memory with desired data for a given
<> 144:ef7eb2e8f9f7 626 * flash area as determined by the start address and length.
<> 144:ef7eb2e8f9f7 627 *
<> 144:ef7eb2e8f9f7 628 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 629 * @param start The start address of the desired flash memory to be programmed. Must be
<> 144:ef7eb2e8f9f7 630 * word-aligned.
<> 144:ef7eb2e8f9f7 631 * @param src Pointer to the source buffer of data that is to be programmed
<> 144:ef7eb2e8f9f7 632 * into the flash.
<> 144:ef7eb2e8f9f7 633 * @param lengthInBytes The length, given in bytes (not words or long-words)
<> 144:ef7eb2e8f9f7 634 * to be programmed. Must be word-aligned.
<> 144:ef7eb2e8f9f7 635 *
<> 144:ef7eb2e8f9f7 636 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 637 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 638 * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with specified baseline.
<> 144:ef7eb2e8f9f7 639 * @retval #kStatus_FLASH_AddressError Address is out of range.
<> 144:ef7eb2e8f9f7 640 * @retval #kStatus_FLASH_SetFlexramAsRamError Failed to set flexram as ram
<> 144:ef7eb2e8f9f7 641 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 642 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 643 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 644 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 645 * @retval #kStatus_FLASH_RecoverFlexramAsEepromError Failed to recover flexram as eeprom
<> 144:ef7eb2e8f9f7 646 */
<> 144:ef7eb2e8f9f7 647 #if defined(FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD) && FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD
<> 144:ef7eb2e8f9f7 648 status_t FLASH_ProgramSection(flash_config_t *config, uint32_t start, uint32_t *src, uint32_t lengthInBytes);
<> 144:ef7eb2e8f9f7 649 #endif
<> 144:ef7eb2e8f9f7 650
<> 144:ef7eb2e8f9f7 651 /*!
<> 144:ef7eb2e8f9f7 652 * @brief Programs EEPROM with data at locations passed in through parameters
<> 144:ef7eb2e8f9f7 653 *
<> 144:ef7eb2e8f9f7 654 * This function programs the Emulated EEPROM with desired data for a given
<> 144:ef7eb2e8f9f7 655 * flash area as determined by the start address and length.
<> 144:ef7eb2e8f9f7 656 *
<> 144:ef7eb2e8f9f7 657 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 658 * @param start The start address of the desired flash memory to be programmed. Must be
<> 144:ef7eb2e8f9f7 659 * word-aligned.
<> 144:ef7eb2e8f9f7 660 * @param src Pointer to the source buffer of data that is to be programmed
<> 144:ef7eb2e8f9f7 661 * into the flash.
<> 144:ef7eb2e8f9f7 662 * @param lengthInBytes The length, given in bytes (not words or long-words)
<> 144:ef7eb2e8f9f7 663 * to be programmed. Must be word-aligned.
<> 144:ef7eb2e8f9f7 664 *
<> 144:ef7eb2e8f9f7 665 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 666 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 667 * @retval #kStatus_FLASH_AddressError Address is out of range.
<> 144:ef7eb2e8f9f7 668 * @retval #kStatus_FLASH_SetFlexramAsEepromError Failed to set flexram as eeprom.
<> 144:ef7eb2e8f9f7 669 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 670 * @retval #kStatus_FLASH_RecoverFlexramAsRamError Failed to recover flexram as ram
<> 144:ef7eb2e8f9f7 671 */
<> 144:ef7eb2e8f9f7 672 #if FLASH_SSD_IS_FLEXNVM_ENABLED
<> 144:ef7eb2e8f9f7 673 status_t FLASH_EepromWrite(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes);
<> 144:ef7eb2e8f9f7 674 #endif
<> 144:ef7eb2e8f9f7 675
<> 144:ef7eb2e8f9f7 676 /*@}*/
<> 144:ef7eb2e8f9f7 677
<> 144:ef7eb2e8f9f7 678 /*!
<> 144:ef7eb2e8f9f7 679 * @name Reading
<> 144:ef7eb2e8f9f7 680 * @{
<> 144:ef7eb2e8f9f7 681 */
<> 144:ef7eb2e8f9f7 682
<> 144:ef7eb2e8f9f7 683 /*!
<> 144:ef7eb2e8f9f7 684 * @brief Read resource with data at locations passed in through parameters
<> 144:ef7eb2e8f9f7 685 *
<> 144:ef7eb2e8f9f7 686 * This function reads the flash memory with desired location for a given
<> 144:ef7eb2e8f9f7 687 * flash area as determined by the start address and length.
<> 144:ef7eb2e8f9f7 688 *
<> 144:ef7eb2e8f9f7 689 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 690 * @param start The start address of the desired flash memory to be programmed. Must be
<> 144:ef7eb2e8f9f7 691 * word-aligned.
<> 144:ef7eb2e8f9f7 692 * @param dst Pointer to the destination buffer of data that is used to store
<> 144:ef7eb2e8f9f7 693 * data to be read.
<> 144:ef7eb2e8f9f7 694 * @param lengthInBytes The length, given in bytes (not words or long-words)
<> 144:ef7eb2e8f9f7 695 * to be read. Must be word-aligned.
<> 144:ef7eb2e8f9f7 696 * @param option The resource option which indicates which area should be read back.
<> 144:ef7eb2e8f9f7 697 *
<> 144:ef7eb2e8f9f7 698 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 699 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 700 * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with specified baseline.
<> 144:ef7eb2e8f9f7 701 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 702 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 703 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 704 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 705 */
<> 144:ef7eb2e8f9f7 706 #if defined(FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD) && FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD
<> 144:ef7eb2e8f9f7 707 status_t FLASH_ReadResource(
<> 144:ef7eb2e8f9f7 708 flash_config_t *config, uint32_t start, uint32_t *dst, uint32_t lengthInBytes, flash_read_resource_option_t option);
<> 144:ef7eb2e8f9f7 709 #endif
<> 144:ef7eb2e8f9f7 710
<> 144:ef7eb2e8f9f7 711 /*!
<> 144:ef7eb2e8f9f7 712 * @brief Read Program Once Field through parameters
<> 144:ef7eb2e8f9f7 713 *
<> 144:ef7eb2e8f9f7 714 * This function reads the read once feild with given index and length
<> 144:ef7eb2e8f9f7 715 *
<> 144:ef7eb2e8f9f7 716 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 717 * @param index The index indicating the area of program once field to be read.
<> 144:ef7eb2e8f9f7 718 * @param dst Pointer to the destination buffer of data that is used to store
<> 144:ef7eb2e8f9f7 719 * data to be read.
<> 144:ef7eb2e8f9f7 720 * @param lengthInBytes The length, given in bytes (not words or long-words)
<> 144:ef7eb2e8f9f7 721 * to be programmed. Must be word-aligned.
<> 144:ef7eb2e8f9f7 722 *
<> 144:ef7eb2e8f9f7 723 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 724 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 725 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 726 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 727 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 728 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 729 */
<> 144:ef7eb2e8f9f7 730 status_t FLASH_ReadOnce(flash_config_t *config, uint32_t index, uint32_t *dst, uint32_t lengthInBytes);
<> 144:ef7eb2e8f9f7 731
<> 144:ef7eb2e8f9f7 732 /*@}*/
<> 144:ef7eb2e8f9f7 733
<> 144:ef7eb2e8f9f7 734 /*!
<> 144:ef7eb2e8f9f7 735 * @name Security
<> 144:ef7eb2e8f9f7 736 * @{
<> 144:ef7eb2e8f9f7 737 */
<> 144:ef7eb2e8f9f7 738
<> 144:ef7eb2e8f9f7 739 /*!
<> 144:ef7eb2e8f9f7 740 * @brief Returns the security state via the pointer passed into the function
<> 144:ef7eb2e8f9f7 741 *
<> 144:ef7eb2e8f9f7 742 * This function retrieves the current Flash security status, including the
<> 144:ef7eb2e8f9f7 743 * security enabling state and the backdoor key enabling state.
<> 144:ef7eb2e8f9f7 744 *
<> 144:ef7eb2e8f9f7 745 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 746 * @param state Pointer to the value returned for the current security status code:
<> 144:ef7eb2e8f9f7 747 *
<> 144:ef7eb2e8f9f7 748 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 749 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 750 */
<> 144:ef7eb2e8f9f7 751 status_t FLASH_GetSecurityState(flash_config_t *config, flash_security_state_t *state);
<> 144:ef7eb2e8f9f7 752
<> 144:ef7eb2e8f9f7 753 /*!
<> 144:ef7eb2e8f9f7 754 * @brief Allows user to bypass security with a backdoor key
<> 144:ef7eb2e8f9f7 755 *
<> 144:ef7eb2e8f9f7 756 * If the MCU is in secured state, this function will unsecure the MCU by
<> 144:ef7eb2e8f9f7 757 * comparing the provided backdoor key with ones in the Flash Configuration
<> 144:ef7eb2e8f9f7 758 * Field.
<> 144:ef7eb2e8f9f7 759 *
<> 144:ef7eb2e8f9f7 760 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 761 * @param backdoorKey Pointer to the user buffer containing the backdoor key.
<> 144:ef7eb2e8f9f7 762 *
<> 144:ef7eb2e8f9f7 763 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 764 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 765 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 766 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 767 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 768 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 769 */
<> 144:ef7eb2e8f9f7 770 status_t FLASH_SecurityBypass(flash_config_t *config, const uint8_t *backdoorKey);
<> 144:ef7eb2e8f9f7 771
<> 144:ef7eb2e8f9f7 772 /*@}*/
<> 144:ef7eb2e8f9f7 773
<> 144:ef7eb2e8f9f7 774 /*!
<> 144:ef7eb2e8f9f7 775 * @name Verification
<> 144:ef7eb2e8f9f7 776 * @{
<> 144:ef7eb2e8f9f7 777 */
<> 144:ef7eb2e8f9f7 778
<> 144:ef7eb2e8f9f7 779 /*!
<> 144:ef7eb2e8f9f7 780 * @brief Verifies erasure of entire flash at specified margin level
<> 144:ef7eb2e8f9f7 781 *
<> 144:ef7eb2e8f9f7 782 * This function will check to see if the flash have been erased to the
<> 144:ef7eb2e8f9f7 783 * specified read margin level.
<> 144:ef7eb2e8f9f7 784 *
<> 144:ef7eb2e8f9f7 785 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 786 * @param margin Read margin choice
<> 144:ef7eb2e8f9f7 787 *
<> 144:ef7eb2e8f9f7 788 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 789 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 790 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 791 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 792 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 793 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 794 */
<> 144:ef7eb2e8f9f7 795 status_t FLASH_VerifyEraseAll(flash_config_t *config, flash_margin_value_t margin);
<> 144:ef7eb2e8f9f7 796
<> 144:ef7eb2e8f9f7 797 /*!
<> 144:ef7eb2e8f9f7 798 * @brief Verifies erasure of desired flash area at specified margin level
<> 144:ef7eb2e8f9f7 799 *
<> 144:ef7eb2e8f9f7 800 * This function will check the appropriate number of flash sectors based on
<> 144:ef7eb2e8f9f7 801 * the desired start address and length to see if the flash have been erased
<> 144:ef7eb2e8f9f7 802 * to the specified read margin level.
<> 144:ef7eb2e8f9f7 803 *
<> 144:ef7eb2e8f9f7 804 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 805 * @param start The start address of the desired flash memory to be verified.
<> 144:ef7eb2e8f9f7 806 * The start address does not need to be sector aligned but must be word-aligned.
<> 144:ef7eb2e8f9f7 807 * @param lengthInBytes The length, given in bytes (not words or long-words)
<> 144:ef7eb2e8f9f7 808 * to be verified. Must be word-aligned.
<> 144:ef7eb2e8f9f7 809 * @param margin Read margin choice
<> 144:ef7eb2e8f9f7 810 *
<> 144:ef7eb2e8f9f7 811 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 812 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 813 * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with specified baseline.
<> 144:ef7eb2e8f9f7 814 * @retval #kStatus_FLASH_AddressError Address is out of range.
<> 144:ef7eb2e8f9f7 815 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 816 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 817 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 818 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 819 */
<> 144:ef7eb2e8f9f7 820 status_t FLASH_VerifyErase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, flash_margin_value_t margin);
<> 144:ef7eb2e8f9f7 821
<> 144:ef7eb2e8f9f7 822 /*!
<> 144:ef7eb2e8f9f7 823 * @brief Verifies programming of desired flash area at specified margin level
<> 144:ef7eb2e8f9f7 824 *
<> 144:ef7eb2e8f9f7 825 * This function verifies the data programed in the flash memory using the
<> 144:ef7eb2e8f9f7 826 * Flash Program Check Command and compares it with expected data for a given
<> 144:ef7eb2e8f9f7 827 * flash area as determined by the start address and length.
<> 144:ef7eb2e8f9f7 828 *
<> 144:ef7eb2e8f9f7 829 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 830 * @param start The start address of the desired flash memory to be verified. Must be word-aligned.
<> 144:ef7eb2e8f9f7 831 * @param lengthInBytes The length, given in bytes (not words or long-words)
<> 144:ef7eb2e8f9f7 832 * to be verified. Must be word-aligned.
<> 144:ef7eb2e8f9f7 833 * @param expectedData Pointer to the expected data that is to be
<> 144:ef7eb2e8f9f7 834 * verified against.
<> 144:ef7eb2e8f9f7 835 * @param margin Read margin choice
<> 144:ef7eb2e8f9f7 836 * @param failedAddress Pointer to returned failing address.
<> 144:ef7eb2e8f9f7 837 * @param failedData Pointer to returned failing data. Some derivitives do
<> 144:ef7eb2e8f9f7 838 * not included failed data as part of the FCCOBx registers. In this
<> 144:ef7eb2e8f9f7 839 * case, zeros are returned upon failure.
<> 144:ef7eb2e8f9f7 840 *
<> 144:ef7eb2e8f9f7 841 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 842 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 843 * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with specified baseline.
<> 144:ef7eb2e8f9f7 844 * @retval #kStatus_FLASH_AddressError Address is out of range.
<> 144:ef7eb2e8f9f7 845 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 846 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 847 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 848 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 849 */
<> 144:ef7eb2e8f9f7 850 status_t FLASH_VerifyProgram(flash_config_t *config,
<> 144:ef7eb2e8f9f7 851 uint32_t start,
<> 144:ef7eb2e8f9f7 852 uint32_t lengthInBytes,
<> 144:ef7eb2e8f9f7 853 const uint32_t *expectedData,
<> 144:ef7eb2e8f9f7 854 flash_margin_value_t margin,
<> 144:ef7eb2e8f9f7 855 uint32_t *failedAddress,
<> 144:ef7eb2e8f9f7 856 uint32_t *failedData);
<> 144:ef7eb2e8f9f7 857
<> 144:ef7eb2e8f9f7 858 /*!
<> 144:ef7eb2e8f9f7 859 * @brief Verifies if the program flash executeonly segments have been erased to
<> 144:ef7eb2e8f9f7 860 * the specified read margin level
<> 144:ef7eb2e8f9f7 861 *
<> 144:ef7eb2e8f9f7 862 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 863 * @param margin Read margin choice
<> 144:ef7eb2e8f9f7 864 *
<> 144:ef7eb2e8f9f7 865 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 866 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 867 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 868 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 869 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 870 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 871 */
<> 144:ef7eb2e8f9f7 872 status_t FLASH_VerifyEraseAllExecuteOnlySegments(flash_config_t *config, flash_margin_value_t margin);
<> 144:ef7eb2e8f9f7 873
<> 144:ef7eb2e8f9f7 874 /*@}*/
<> 144:ef7eb2e8f9f7 875
<> 144:ef7eb2e8f9f7 876 /*!
<> 144:ef7eb2e8f9f7 877 * @name Protection
<> 144:ef7eb2e8f9f7 878 * @{
<> 144:ef7eb2e8f9f7 879 */
<> 144:ef7eb2e8f9f7 880
<> 144:ef7eb2e8f9f7 881 /*!
<> 144:ef7eb2e8f9f7 882 * @brief Returns the protection state of desired flash area via the pointer passed into the function
<> 144:ef7eb2e8f9f7 883 *
<> 144:ef7eb2e8f9f7 884 * This function retrieves the current Flash protect status for a given
<> 144:ef7eb2e8f9f7 885 * flash area as determined by the start address and length.
<> 144:ef7eb2e8f9f7 886 *
<> 144:ef7eb2e8f9f7 887 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 888 * @param start The start address of the desired flash memory to be checked. Must be word-aligned.
<> 144:ef7eb2e8f9f7 889 * @param lengthInBytes The length, given in bytes (not words or long-words)
<> 144:ef7eb2e8f9f7 890 * to be checked. Must be word-aligned.
<> 144:ef7eb2e8f9f7 891 * @param protection_state Pointer to the value returned for the current
<> 144:ef7eb2e8f9f7 892 * protection status code for the desired flash area.
<> 144:ef7eb2e8f9f7 893 *
<> 144:ef7eb2e8f9f7 894 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 895 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 896 * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with specified baseline.
<> 144:ef7eb2e8f9f7 897 * @retval #kStatus_FLASH_AddressError Address is out of range.
<> 144:ef7eb2e8f9f7 898 */
<> 144:ef7eb2e8f9f7 899 status_t FLASH_IsProtected(flash_config_t *config,
<> 144:ef7eb2e8f9f7 900 uint32_t start,
<> 144:ef7eb2e8f9f7 901 uint32_t lengthInBytes,
<> 144:ef7eb2e8f9f7 902 flash_protection_state_t *protection_state);
<> 144:ef7eb2e8f9f7 903
<> 144:ef7eb2e8f9f7 904 /*!
<> 144:ef7eb2e8f9f7 905 * @brief Returns the access state of desired flash area via the pointer passed into the function
<> 144:ef7eb2e8f9f7 906 *
<> 144:ef7eb2e8f9f7 907 * This function retrieves the current Flash access status for a given
<> 144:ef7eb2e8f9f7 908 * flash area as determined by the start address and length.
<> 144:ef7eb2e8f9f7 909 *
<> 144:ef7eb2e8f9f7 910 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 911 * @param start The start address of the desired flash memory to be checked. Must be word-aligned.
<> 144:ef7eb2e8f9f7 912 * @param lengthInBytes The length, given in bytes (not words or long-words)
<> 144:ef7eb2e8f9f7 913 * to be checked. Must be word-aligned.
<> 144:ef7eb2e8f9f7 914 * @param access_state Pointer to the value returned for the current
<> 144:ef7eb2e8f9f7 915 * access status code for the desired flash area.
<> 144:ef7eb2e8f9f7 916 *
<> 144:ef7eb2e8f9f7 917 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 918 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 919 * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with specified baseline.
<> 144:ef7eb2e8f9f7 920 * @retval #kStatus_FLASH_AddressError Address is out of range.
<> 144:ef7eb2e8f9f7 921 */
<> 144:ef7eb2e8f9f7 922 status_t FLASH_IsExecuteOnly(flash_config_t *config,
<> 144:ef7eb2e8f9f7 923 uint32_t start,
<> 144:ef7eb2e8f9f7 924 uint32_t lengthInBytes,
<> 144:ef7eb2e8f9f7 925 flash_execute_only_access_state_t *access_state);
<> 144:ef7eb2e8f9f7 926
<> 144:ef7eb2e8f9f7 927 /*@}*/
<> 144:ef7eb2e8f9f7 928
<> 144:ef7eb2e8f9f7 929 /*!
<> 144:ef7eb2e8f9f7 930 * @name Properties
<> 144:ef7eb2e8f9f7 931 * @{
<> 144:ef7eb2e8f9f7 932 */
<> 144:ef7eb2e8f9f7 933
<> 144:ef7eb2e8f9f7 934 /*!
<> 144:ef7eb2e8f9f7 935 * @brief Returns the desired flash property.
<> 144:ef7eb2e8f9f7 936 *
<> 144:ef7eb2e8f9f7 937 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 938 * @param whichProperty The desired property from the list of properties in
<> 144:ef7eb2e8f9f7 939 * enum flash_property_tag_t
<> 144:ef7eb2e8f9f7 940 * @param value Pointer to the value returned for the desired flash property
<> 144:ef7eb2e8f9f7 941 *
<> 144:ef7eb2e8f9f7 942 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 943 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 944 * @retval #kStatus_FLASH_UnknownProperty unknown property tag
<> 144:ef7eb2e8f9f7 945 */
<> 144:ef7eb2e8f9f7 946 status_t FLASH_GetProperty(flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value);
<> 144:ef7eb2e8f9f7 947
<> 144:ef7eb2e8f9f7 948 /*@}*/
<> 144:ef7eb2e8f9f7 949
<> 144:ef7eb2e8f9f7 950 /*!
<> 144:ef7eb2e8f9f7 951 * @name FlexRAM
<> 144:ef7eb2e8f9f7 952 * @{
<> 144:ef7eb2e8f9f7 953 */
<> 144:ef7eb2e8f9f7 954
<> 144:ef7eb2e8f9f7 955 /*!
<> 144:ef7eb2e8f9f7 956 * @brief Set FlexRAM Function command
<> 144:ef7eb2e8f9f7 957 *
<> 144:ef7eb2e8f9f7 958 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 959 * @param option The option used to set work mode of FlexRAM
<> 144:ef7eb2e8f9f7 960 *
<> 144:ef7eb2e8f9f7 961 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 962 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 963 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 964 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 965 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 966 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 967 */
<> 144:ef7eb2e8f9f7 968 #if defined(FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD) && FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD
<> 144:ef7eb2e8f9f7 969 status_t FLASH_SetFlexramFunction(flash_config_t *config, flash_flexram_function_option_t option);
<> 144:ef7eb2e8f9f7 970 #endif
<> 144:ef7eb2e8f9f7 971
<> 144:ef7eb2e8f9f7 972 /*@}*/
<> 144:ef7eb2e8f9f7 973
<> 144:ef7eb2e8f9f7 974 /*!
<> 144:ef7eb2e8f9f7 975 * @name Swap
<> 144:ef7eb2e8f9f7 976 * @{
<> 144:ef7eb2e8f9f7 977 */
<> 144:ef7eb2e8f9f7 978
<> 144:ef7eb2e8f9f7 979 /*!
<> 144:ef7eb2e8f9f7 980 * @brief Configure Swap function or Check the swap state of Flash Module
<> 144:ef7eb2e8f9f7 981 *
<> 144:ef7eb2e8f9f7 982 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 983 * @param address Address used to configure the flash swap function
<> 144:ef7eb2e8f9f7 984 * @param option The possible option used to configure Flash Swap function or check the flash swap status
<> 144:ef7eb2e8f9f7 985 * @param returnInfo Pointer to the data which is used to return the information of flash swap.
<> 144:ef7eb2e8f9f7 986 *
<> 144:ef7eb2e8f9f7 987 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 988 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 989 * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with specified baseline.
<> 144:ef7eb2e8f9f7 990 * @retval #kStatus_FLASH_SwapIndicatorAddressError Swap indicator address is invalid
<> 144:ef7eb2e8f9f7 991 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 992 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 993 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 994 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 995 */
<> 144:ef7eb2e8f9f7 996 #if defined(FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD) && FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD
<> 144:ef7eb2e8f9f7 997 status_t FLASH_SwapControl(flash_config_t *config,
<> 144:ef7eb2e8f9f7 998 uint32_t address,
<> 144:ef7eb2e8f9f7 999 flash_swap_control_option_t option,
<> 144:ef7eb2e8f9f7 1000 flash_swap_state_config_t *returnInfo);
<> 144:ef7eb2e8f9f7 1001 #endif
<> 144:ef7eb2e8f9f7 1002
<> 144:ef7eb2e8f9f7 1003 /*!
<> 144:ef7eb2e8f9f7 1004 * @brief Swap the lower half flash with the higher half flaock
<> 144:ef7eb2e8f9f7 1005 *
<> 144:ef7eb2e8f9f7 1006 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 1007 * @param address Address used to configure the flash swap function
<> 144:ef7eb2e8f9f7 1008 * @param option The possible option used to configure Flash Swap function or check the flash swap status
<> 144:ef7eb2e8f9f7 1009 *
<> 144:ef7eb2e8f9f7 1010 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 1011 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 1012 * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with specified baseline.
<> 144:ef7eb2e8f9f7 1013 * @retval #kStatus_FLASH_SwapIndicatorAddressError Swap indicator address is invalid
<> 144:ef7eb2e8f9f7 1014 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 1015 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 1016 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 1017 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 1018 * @retval #kStatus_FLASH_SwapSystemNotInUninitialized Swap system is not in uninitialzed state
<> 144:ef7eb2e8f9f7 1019 */
<> 144:ef7eb2e8f9f7 1020 #if defined(FSL_FEATURE_FLASH_HAS_PFLASH_BLOCK_SWAP) && FSL_FEATURE_FLASH_HAS_PFLASH_BLOCK_SWAP
<> 144:ef7eb2e8f9f7 1021 status_t FLASH_Swap(flash_config_t *config, uint32_t address, flash_swap_function_option_t option);
<> 144:ef7eb2e8f9f7 1022 #endif
<> 144:ef7eb2e8f9f7 1023
<> 144:ef7eb2e8f9f7 1024 /*!
<> 144:ef7eb2e8f9f7 1025 * @name FlexNVM
<> 144:ef7eb2e8f9f7 1026 * @{
<> 144:ef7eb2e8f9f7 1027 */
<> 144:ef7eb2e8f9f7 1028
<> 144:ef7eb2e8f9f7 1029 /*!
<> 144:ef7eb2e8f9f7 1030 * @brief Prepares the FlexNVM block for use as data flash, EEPROM backup, or a combination of both and initializes the
<> 144:ef7eb2e8f9f7 1031 * FlexRAM.
<> 144:ef7eb2e8f9f7 1032 *
<> 144:ef7eb2e8f9f7 1033 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 1034 * @param option The option used to set FlexRAM load behavior during reset.
<> 144:ef7eb2e8f9f7 1035 * @param eepromDataSizeCode Determines the amount of FlexRAM used in each of the available EEPROM subsystems.
<> 144:ef7eb2e8f9f7 1036 * @param flexnvmPartitionCode Specifies how to split the FlexNVM block between data flash memory and EEPROM backup
<> 144:ef7eb2e8f9f7 1037 * memory supporting EEPROM functions.
<> 144:ef7eb2e8f9f7 1038 *
<> 144:ef7eb2e8f9f7 1039 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 1040 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 1041 * @retval #kStatus_FLASH_ExecuteInRamFunctionNotReady Execute-in-ram function is not available.
<> 144:ef7eb2e8f9f7 1042 * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
<> 144:ef7eb2e8f9f7 1043 * @retval #kStatus_FLASH_ProtectionViolation The program/erase operation is requested to execute on protected areas.
<> 144:ef7eb2e8f9f7 1044 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 1045 */
<> 144:ef7eb2e8f9f7 1046 #if defined(FSL_FEATURE_FLASH_HAS_PROGRAM_PARTITION_CMD) && FSL_FEATURE_FLASH_HAS_PROGRAM_PARTITION_CMD
<> 144:ef7eb2e8f9f7 1047 status_t FLASH_ProgramPartition(flash_config_t *config,
<> 144:ef7eb2e8f9f7 1048 flash_partition_flexram_load_option_t option,
<> 144:ef7eb2e8f9f7 1049 uint32_t eepromDataSizeCode,
<> 144:ef7eb2e8f9f7 1050 uint32_t flexnvmPartitionCode);
<> 144:ef7eb2e8f9f7 1051 #endif
<> 144:ef7eb2e8f9f7 1052
<> 144:ef7eb2e8f9f7 1053 /*@}*/
<> 144:ef7eb2e8f9f7 1054
<> 144:ef7eb2e8f9f7 1055 /*!
<> 144:ef7eb2e8f9f7 1056 * @name Flash Protection Utilities
<> 144:ef7eb2e8f9f7 1057 * @{
<> 144:ef7eb2e8f9f7 1058 */
<> 144:ef7eb2e8f9f7 1059
<> 144:ef7eb2e8f9f7 1060 /*!
<> 144:ef7eb2e8f9f7 1061 * @brief Set PFLASH Protection to the intended protection status.
<> 144:ef7eb2e8f9f7 1062 *
<> 144:ef7eb2e8f9f7 1063 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 1064 * @param protectStatus The expected protect status user wants to set to PFlash protection register. Each bit is
<> 144:ef7eb2e8f9f7 1065 * corresponding to protection of 1/32 of the total PFlash. The least significant bit is corresponding to the lowest
<> 144:ef7eb2e8f9f7 1066 * address area of P-Flash. The most significant bit is corresponding to the highest address area of PFlash. There are
<> 144:ef7eb2e8f9f7 1067 * two possible cases as shown below:
<> 144:ef7eb2e8f9f7 1068 * 0: this area is protected.
<> 144:ef7eb2e8f9f7 1069 * 1: this area is unprotected.
<> 144:ef7eb2e8f9f7 1070 *
<> 144:ef7eb2e8f9f7 1071 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 1072 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 1073 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 1074 */
<> 144:ef7eb2e8f9f7 1075 status_t FLASH_PflashSetProtection(flash_config_t *config, uint32_t protectStatus);
<> 144:ef7eb2e8f9f7 1076
<> 144:ef7eb2e8f9f7 1077 /*!
<> 144:ef7eb2e8f9f7 1078 * @brief Get PFLASH Protection Status.
<> 144:ef7eb2e8f9f7 1079 *
<> 144:ef7eb2e8f9f7 1080 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 1081 * @param protectStatus Protect status returned by PFlash IP. Each bit is corresponding to protection of 1/32 of the
<> 144:ef7eb2e8f9f7 1082 * total PFlash. The least significant bit is corresponding to the lowest address area of PFlash. The most significant
<> 144:ef7eb2e8f9f7 1083 * bit is corresponding to the highest address area of PFlash. Thee are two possible cases as below:
<> 144:ef7eb2e8f9f7 1084 * 0: this area is protected.
<> 144:ef7eb2e8f9f7 1085 * 1: this area is unprotected.
<> 144:ef7eb2e8f9f7 1086 *
<> 144:ef7eb2e8f9f7 1087 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 1088 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 1089 */
<> 144:ef7eb2e8f9f7 1090 status_t FLASH_PflashGetProtection(flash_config_t *config, uint32_t *protectStatus);
<> 144:ef7eb2e8f9f7 1091
<> 144:ef7eb2e8f9f7 1092 /*!
<> 144:ef7eb2e8f9f7 1093 * @brief Set DFLASH Protection to the intended protection status.
<> 144:ef7eb2e8f9f7 1094 *
<> 144:ef7eb2e8f9f7 1095 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 1096 * @param protectStatus The expected protect status user wants to set to DFlash protection register. Each bit is
<> 144:ef7eb2e8f9f7 1097 * corresponding to protection of 1/8 of the total DFlash. The least significant bit is corresponding to the lowest
<> 144:ef7eb2e8f9f7 1098 * address area of DFlash. The most significant bit is corresponding to the highest address area of DFlash. There are
<> 144:ef7eb2e8f9f7 1099 * two possible cases as shown below:
<> 144:ef7eb2e8f9f7 1100 * 0: this area is protected.
<> 144:ef7eb2e8f9f7 1101 * 1: this area is unprotected.
<> 144:ef7eb2e8f9f7 1102 *
<> 144:ef7eb2e8f9f7 1103 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 1104 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 1105 * @retval #kStatus_FLASH_CommandNotSupported Flash api is not supported
<> 144:ef7eb2e8f9f7 1106 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 1107 */
<> 144:ef7eb2e8f9f7 1108 #if FLASH_SSD_IS_FLEXNVM_ENABLED
<> 144:ef7eb2e8f9f7 1109 status_t FLASH_DflashSetProtection(flash_config_t *config, uint8_t protectStatus);
<> 144:ef7eb2e8f9f7 1110 #endif
<> 144:ef7eb2e8f9f7 1111
<> 144:ef7eb2e8f9f7 1112 /*!
<> 144:ef7eb2e8f9f7 1113 * @brief Get DFLASH Protection Status.
<> 144:ef7eb2e8f9f7 1114 *
<> 144:ef7eb2e8f9f7 1115 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 1116 * @param protectStatus DFlash Protect status returned by PFlash IP. Each bit is corresponding to protection of 1/8 of
<> 144:ef7eb2e8f9f7 1117 * the total DFlash. The least significant bit is corresponding to the lowest address area of DFlash. The most
<> 144:ef7eb2e8f9f7 1118 * significant bit is corresponding to the highest address area of DFlash and so on. There are two possible cases as
<> 144:ef7eb2e8f9f7 1119 * below:
<> 144:ef7eb2e8f9f7 1120 * 0: this area is protected.
<> 144:ef7eb2e8f9f7 1121 * 1: this area is unprotected.
<> 144:ef7eb2e8f9f7 1122 *
<> 144:ef7eb2e8f9f7 1123 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 1124 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 1125 * @retval #kStatus_FLASH_CommandNotSupported Flash api is not supported
<> 144:ef7eb2e8f9f7 1126 */
<> 144:ef7eb2e8f9f7 1127 #if FLASH_SSD_IS_FLEXNVM_ENABLED
<> 144:ef7eb2e8f9f7 1128 status_t FLASH_DflashGetProtection(flash_config_t *config, uint8_t *protectStatus);
<> 144:ef7eb2e8f9f7 1129 #endif
<> 144:ef7eb2e8f9f7 1130
<> 144:ef7eb2e8f9f7 1131 /*!
<> 144:ef7eb2e8f9f7 1132 * @brief Set EEPROM Protection to the intended protection status.
<> 144:ef7eb2e8f9f7 1133 *
<> 144:ef7eb2e8f9f7 1134 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 1135 * @param protectStatus The expected protect status user wants to set to EEPROM protection register. Each bit is
<> 144:ef7eb2e8f9f7 1136 * corresponding to protection of 1/8 of the total EEPROM. The least significant bit is corresponding to the lowest
<> 144:ef7eb2e8f9f7 1137 * address area of EEPROM. The most significant bit is corresponding to the highest address area of EEPROM, and so on.
<> 144:ef7eb2e8f9f7 1138 * There are two possible cases as shown below:
<> 144:ef7eb2e8f9f7 1139 * 0: this area is protected.
<> 144:ef7eb2e8f9f7 1140 * 1: this area is unprotected.
<> 144:ef7eb2e8f9f7 1141 *
<> 144:ef7eb2e8f9f7 1142 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 1143 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 1144 * @retval #kStatus_FLASH_CommandNotSupported Flash api is not supported
<> 144:ef7eb2e8f9f7 1145 * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution.
<> 144:ef7eb2e8f9f7 1146 */
<> 144:ef7eb2e8f9f7 1147 #if FLASH_SSD_IS_FLEXNVM_ENABLED
<> 144:ef7eb2e8f9f7 1148 status_t FLASH_EepromSetProtection(flash_config_t *config, uint8_t protectStatus);
<> 144:ef7eb2e8f9f7 1149 #endif
<> 144:ef7eb2e8f9f7 1150
<> 144:ef7eb2e8f9f7 1151 /*!
<> 144:ef7eb2e8f9f7 1152 * @brief Get DFLASH Protection Status.
<> 144:ef7eb2e8f9f7 1153 *
<> 144:ef7eb2e8f9f7 1154 * @param config Pointer to storage for the driver runtime state.
<> 144:ef7eb2e8f9f7 1155 * @param protectStatus DFlash Protect status returned by PFlash IP. Each bit is corresponding to protection of 1/8 of
<> 144:ef7eb2e8f9f7 1156 * the total EEPROM. The least significant bit is corresponding to the lowest address area of EEPROM. The most
<> 144:ef7eb2e8f9f7 1157 * significant bit is corresponding to the highest address area of EEPROM. There are two possible cases as below:
<> 144:ef7eb2e8f9f7 1158 * 0: this area is protected.
<> 144:ef7eb2e8f9f7 1159 * 1: this area is unprotected.
<> 144:ef7eb2e8f9f7 1160 *
<> 144:ef7eb2e8f9f7 1161 * @retval #kStatus_FLASH_Success Api was executed successfully.
<> 144:ef7eb2e8f9f7 1162 * @retval #kStatus_FLASH_InvalidArgument Invalid argument is provided.
<> 144:ef7eb2e8f9f7 1163 * @retval #kStatus_FLASH_CommandNotSupported Flash api is not supported.
<> 144:ef7eb2e8f9f7 1164 */
<> 144:ef7eb2e8f9f7 1165 #if FLASH_SSD_IS_FLEXNVM_ENABLED
<> 144:ef7eb2e8f9f7 1166 status_t FLASH_EepromGetProtection(flash_config_t *config, uint8_t *protectStatus);
<> 144:ef7eb2e8f9f7 1167 #endif
<> 144:ef7eb2e8f9f7 1168
<> 144:ef7eb2e8f9f7 1169 /*@}*/
<> 144:ef7eb2e8f9f7 1170
<> 144:ef7eb2e8f9f7 1171 #if defined(__cplusplus)
<> 144:ef7eb2e8f9f7 1172 }
<> 144:ef7eb2e8f9f7 1173 #endif
<> 144:ef7eb2e8f9f7 1174
<> 144:ef7eb2e8f9f7 1175 /*! @}*/
<> 144:ef7eb2e8f9f7 1176
<> 144:ef7eb2e8f9f7 1177 #endif /* _FSL_FLASH_H_ */