1 /*
2  * Copyright 2018-2021 NXP
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  *
7  */
8 
9 #ifndef __FSL_IAP_H_
10 #define __FSL_IAP_H_
11 
12 #include "fsl_common.h"
13 /*!
14  * @addtogroup flash_driver
15  * @{
16  */
17 
18 /*! @file */
19 
20 /*******************************************************************************
21  * Definitions
22  ******************************************************************************/
23 /*!
24  * @name Flash version
25  * @{
26  */
27 /*! @brief Constructs the version number for drivers. */
28 #if !defined(MAKE_VERSION)
29 #define MAKE_VERSION(major, minor, bugfix) (((major) << 16) | ((minor) << 8) | (bugfix))
30 #endif
31 
32 /*! @brief Flash driver version for SDK*/
33 #define FSL_FLASH_DRIVER_VERSION (MAKE_VERSION(2, 1, 4)) /*!< Version 2.1.4. */
34 
35 /*! @brief Flash driver version for ROM*/
36 enum _flash_driver_version_constants
37 {
38     kFLASH_DriverVersionName   = 'F', /*!< Flash driver version name.*/
39     kFLASH_DriverVersionMajor  = 2,   /*!< Major flash driver version.*/
40     kFLASH_DriverVersionMinor  = 1,   /*!< Minor flash driver version.*/
41     kFLASH_DriverVersionBugfix = 3    /*!< Bugfix for flash driver version.*/
42 };
43 
44 /*@}*/
45 
46 /*!
47  * @name Flash configuration
48  * @{
49  */
50 /*! @brief Flash IP Type. */
51 #if !defined(FSL_FEATURE_FLASH_IP_IS_C040HD_ATFC)
52 #define FSL_FEATURE_FLASH_IP_IS_C040HD_ATFC (1)
53 #endif
54 #if !defined(FSL_FEATURE_FLASH_IP_IS_C040HD_FC)
55 #define FSL_FEATURE_FLASH_IP_IS_C040HD_FC (0)
56 #endif
57 
58 /*!
59  * @name Flash status
60  * @{
61  */
62 /*! @brief Flash driver status group. */
63 #if defined(kStatusGroup_FlashDriver)
64 #define kStatusGroupGeneric     kStatusGroup_Generic
65 #define kStatusGroupFlashDriver kStatusGroup_FlashDriver
66 #elif defined(kStatusGroup_FLASHIAP)
67 #define kStatusGroupGeneric     kStatusGroup_Generic
68 #define kStatusGroupFlashDriver kStatusGroup_FLASH
69 #else
70 #define kStatusGroupGeneric     0
71 #define kStatusGroupFlashDriver 1
72 #endif
73 
74 /*! @brief Constructs a status code value from a group and a code number. */
75 #if !defined(MAKE_STATUS)
76 #define MAKE_STATUS(group, code) ((((group)*100) + (code)))
77 #endif
78 
79 /*!
80  * @brief Flash driver status codes.
81  */
82 enum _flash_status
83 {
84     kStatus_FLASH_Success         = MAKE_STATUS(kStatusGroupGeneric, 0),     /*!< API is executed successfully*/
85     kStatus_FLASH_InvalidArgument = MAKE_STATUS(kStatusGroupGeneric, 4),     /*!< Invalid argument*/
86     kStatus_FLASH_SizeError       = MAKE_STATUS(kStatusGroupFlashDriver, 0), /*!< Error size*/
87     kStatus_FLASH_AlignmentError =
88         MAKE_STATUS(kStatusGroupFlashDriver, 1), /*!< Parameter is not aligned with the specified baseline*/
89     kStatus_FLASH_AddressError = MAKE_STATUS(kStatusGroupFlashDriver, 2), /*!< Address is out of range */
90     kStatus_FLASH_AccessError =
91         MAKE_STATUS(kStatusGroupFlashDriver, 3), /*!< Invalid instruction codes and out-of bound addresses */
92     kStatus_FLASH_ProtectionViolation = MAKE_STATUS(
93         kStatusGroupFlashDriver, 4), /*!< The program/erase operation is requested to execute on protected areas */
94     kStatus_FLASH_CommandFailure =
95         MAKE_STATUS(kStatusGroupFlashDriver, 5), /*!< Run-time error during command execution. */
96     kStatus_FLASH_UnknownProperty = MAKE_STATUS(kStatusGroupFlashDriver, 6), /*!< Unknown property.*/
97     kStatus_FLASH_EraseKeyError   = MAKE_STATUS(kStatusGroupFlashDriver, 7), /*!< API erase key is invalid.*/
98     kStatus_FLASH_RegionExecuteOnly =
99         MAKE_STATUS(kStatusGroupFlashDriver, 8), /*!< The current region is execute-only.*/
100     kStatus_FLASH_ExecuteInRamFunctionNotReady =
101         MAKE_STATUS(kStatusGroupFlashDriver, 9), /*!< Execute-in-RAM function is not available.*/
102 
103     kStatus_FLASH_CommandNotSupported = MAKE_STATUS(kStatusGroupFlashDriver, 11), /*!< Flash API is not supported.*/
104     kStatus_FLASH_ReadOnlyProperty = MAKE_STATUS(kStatusGroupFlashDriver, 12), /*!< The flash property is read-only.*/
105     kStatus_FLASH_InvalidPropertyValue =
106         MAKE_STATUS(kStatusGroupFlashDriver, 13), /*!< The flash property value is out of range.*/
107     kStatus_FLASH_InvalidSpeculationOption =
108         MAKE_STATUS(kStatusGroupFlashDriver, 14), /*!< The option of flash prefetch speculation is invalid.*/
109     kStatus_FLASH_EccError = MAKE_STATUS(kStatusGroupFlashDriver,
110                                          0x10), /*!< A correctable or uncorrectable error during command execution. */
111     kStatus_FLASH_CompareError =
112         MAKE_STATUS(kStatusGroupFlashDriver, 0x11), /*!< Destination and source memory contents do not match. */
113     kStatus_FLASH_RegulationLoss = MAKE_STATUS(kStatusGroupFlashDriver, 0x12), /*!< A loss of regulation during read. */
114     kStatus_FLASH_InvalidWaitStateCycles =
115         MAKE_STATUS(kStatusGroupFlashDriver, 0x13), /*!< The wait state cycle set to r/w mode is invalid. */
116 
117     kStatus_FLASH_OutOfDateCfpaPage =
118         MAKE_STATUS(kStatusGroupFlashDriver, 0x20), /*!< CFPA page version is out of date. */
119     kStatus_FLASH_BlankIfrPageData = MAKE_STATUS(kStatusGroupFlashDriver, 0x21), /*!< Blank page cannnot be read. */
120     kStatus_FLASH_EncryptedRegionsEraseNotDoneAtOnce =
121         MAKE_STATUS(kStatusGroupFlashDriver, 0x22), /*!< Encrypted flash subregions are not erased at once. */
122     kStatus_FLASH_ProgramVerificationNotAllowed = MAKE_STATUS(
123         kStatusGroupFlashDriver, 0x23), /*!< Program verification is not allowed when the encryption is enabled. */
124     kStatus_FLASH_HashCheckError =
125         MAKE_STATUS(kStatusGroupFlashDriver, 0x24), /*!< Hash check of page data is failed. */
126     kStatus_FLASH_SealedFfrRegion      = MAKE_STATUS(kStatusGroupFlashDriver, 0x25), /*!< The FFR region is sealed. */
127     kStatus_FLASH_FfrRegionWriteBroken = MAKE_STATUS(
128         kStatusGroupFlashDriver, 0x26), /*!< The FFR Spec region is not allowed to be written discontinuously. */
129     kStatus_FLASH_NmpaAccessNotAllowed =
130         MAKE_STATUS(kStatusGroupFlashDriver, 0x27), /*!< The NMPA region is not allowed to be read/written/erased. */
131     kStatus_FLASH_CmpaCfgDirectEraseNotAllowed =
132         MAKE_STATUS(kStatusGroupFlashDriver, 0x28), /*!< The CMPA Cfg region is not allowed to be erased directly. */
133     kStatus_FLASH_FfrBankIsLocked = MAKE_STATUS(kStatusGroupFlashDriver, 0x29), /*!< The FFR bank region is locked. */
134 };
135 /*@}*/
136 
137 /*!
138  * @name Flash API key
139  * @{
140  */
141 /*! @brief Constructs the four character code for the Flash driver API key. */
142 #if !defined(FOUR_CHAR_CODE)
143 #define FOUR_CHAR_CODE(a, b, c, d) (((d) << 24) | ((c) << 16) | ((b) << 8) | ((a)))
144 #endif
145 
146 /*!
147  * @brief Enumeration for Flash driver API keys.
148  *
149  * @note The resulting value is built with a byte order such that the string
150  * being readable in expected order when viewed in a hex editor, if the value
151  * is treated as a 32-bit little endian value.
152  */
153 enum _flash_driver_api_keys
154 {
155     kFLASH_ApiEraseKey = FOUR_CHAR_CODE('l', 'f', 'e', 'k') /*!< Key value used to validate all flash erase APIs.*/
156 };
157 /*@}*/
158 
159 /*!
160  * @brief Enumeration for various flash properties.
161  */
162 typedef enum _flash_property_tag
163 {
164     kFLASH_PropertyPflashSectorSize    = 0x00U, /*!< Pflash sector size property.*/
165     kFLASH_PropertyPflashTotalSize     = 0x01U, /*!< Pflash total size property.*/
166     kFLASH_PropertyPflashBlockSize     = 0x02U, /*!< Pflash block size property.*/
167     kFLASH_PropertyPflashBlockCount    = 0x03U, /*!< Pflash block count property.*/
168     kFLASH_PropertyPflashBlockBaseAddr = 0x04U, /*!< Pflash block base address property.*/
169 
170     kFLASH_PropertyPflashPageSize   = 0x30U, /*!< Pflash page size property.*/
171     kFLASH_PropertyPflashSystemFreq = 0x31U, /*!< System Frequency System Frequency.*/
172 
173     kFLASH_PropertyFfrSectorSize    = 0x40U, /*!< FFR sector size property.*/
174     kFLASH_PropertyFfrTotalSize     = 0x41U, /*!< FFR total size property.*/
175     kFLASH_PropertyFfrBlockBaseAddr = 0x42U, /*!< FFR block base address property.*/
176     kFLASH_PropertyFfrPageSize      = 0x43U, /*!< FFR page size property.*/
177 } flash_property_tag_t;
178 
179 /*!
180  * @brief Enumeration for flash max pages to erase.
181  */
182 enum _flash_max_erase_page_value
183 {
184     kFLASH_MaxPagesToErase = 100U /*!< The max value in pages to erase. */
185 };
186 
187 /*!
188  * @brief Enumeration for flash alignment property.
189  */
190 enum _flash_alignment_property
191 {
192     kFLASH_AlignementUnitVerifyErase = 4,       /*!< The alignment unit in bytes used for verify erase operation.*/
193     kFLASH_AlignementUnitProgram     = 512,     /*!< The alignment unit in bytes used for program operation.*/
194     /*kFLASH_AlignementUnitVerifyProgram = 4,*/ /*!< The alignment unit in bytes used for verify program operation.*/
195     kFLASH_AlignementUnitSingleWordRead = 16    /*!< The alignment unit in bytes used for SingleWordRead command.*/
196 };
197 
198 /*!
199  * @brief Enumeration for flash read ecc option
200  */
201 enum _flash_read_ecc_option
202 {
203     kFLASH_ReadWithEccOn  = 0, /*! ECC is on */
204     kFLASH_ReadWithEccOff = 1, /*! ECC is off */
205 };
206 
207 /* set flash Controller timing before flash init */
208 enum _flash_freq_tag
209 {
210     kSysToFlashFreq_lowInMHz     = 12u,
211     kSysToFlashFreq_defaultInMHz = 96u,
212 };
213 
214 /*!
215  * @brief Enumeration for flash read margin option
216  */
217 enum _flash_read_margin_option
218 {
219     kFLASH_ReadMarginNormal                = 0, /*!< Normal read */
220     kFLASH_ReadMarginVsProgram             = 1, /*!< Margin vs. program */
221     kFLASH_ReadMarginVsErase               = 2, /*!< Margin vs. erase */
222     kFLASH_ReadMarginIllegalBitCombination = 3  /*!< Illegal bit combination */
223 };
224 
225 /*!
226  * @brief Enumeration for flash read dmacc option
227  */
228 enum _flash_read_dmacc_option
229 {
230     kFLASH_ReadDmaccDisabled = 0, /*!< Memory word */
231     kFLASH_ReadDmaccEnabled  = 1, /*!< DMACC word */
232 };
233 
234 /*!
235  * @brief Enumeration for flash ramp control option
236  */
237 enum _flash_ramp_control_option
238 {
239     kFLASH_RampControlDivisionFactorReserved = 0, /*!< Reserved */
240     kFLASH_RampControlDivisionFactor256      = 1, /*!< clk48mhz / 256 = 187.5KHz */
241     kFLASH_RampControlDivisionFactor128      = 2, /*!< clk48mhz / 128 = 375KHz */
242     kFLASH_RampControlDivisionFactor64       = 3  /*!< clk48mhz / 64 = 750KHz */
243 };
244 
245 /*! @brief Flash ECC log info. */
246 typedef struct _flash_ecc_log
247 {
248     uint32_t firstEccEventAddress;
249     uint32_t eccErrorCount;
250     uint32_t eccCorrectionCount;
251     uint32_t reserved;
252 } flash_ecc_log_t;
253 
254 /*! @brief Flash controller paramter config. */
255 typedef struct _flash_mode_config
256 {
257     uint32_t sysFreqInMHz;
258     /* ReadSingleWord parameter. */
259     struct
260     {
261         uint8_t readWithEccOff : 1;
262         uint8_t readMarginLevel : 2;
263         uint8_t readDmaccWord : 1;
264         uint8_t reserved0 : 4;
265         uint8_t reserved1[3];
266     } readSingleWord;
267     /* SetWriteMode parameter. */
268     struct
269     {
270         uint8_t programRampControl;
271         uint8_t eraseRampControl;
272         uint8_t reserved[2];
273     } setWriteMode;
274     /* SetReadMode parameter. */
275     struct
276     {
277         uint16_t readInterfaceTimingTrim;
278         uint16_t readControllerTimingTrim;
279         uint8_t readWaitStates;
280         uint8_t reserved[3];
281     } setReadMode;
282 } flash_mode_config_t;
283 
284 /*! @brief Flash controller paramter config. */
285 typedef struct _flash_ffr_config
286 {
287     uint32_t ffrBlockBase;
288     uint32_t ffrTotalSize;
289     uint32_t ffrPageSize;
290     uint32_t cfpaPageVersion;
291     uint32_t cfpaPageOffset;
292 } flash_ffr_config_t;
293 
294 /*! @brief Flash driver state information.
295  *
296  * An instance of this structure is allocated by the user of the flash driver and
297  * passed into each of the driver APIs.
298  */
299 typedef struct _flash_config
300 {
301     uint32_t PFlashBlockBase;  /*!< A base address of the first PFlash block */
302     uint32_t PFlashTotalSize;  /*!< The size of the combined PFlash block. */
303     uint32_t PFlashBlockCount; /*!< A number of PFlash blocks. */
304     uint32_t PFlashPageSize;   /*!< The size in bytes of a page of PFlash. */
305     uint32_t PFlashSectorSize; /*!< The size in bytes of a sector of PFlash. */
306     flash_ffr_config_t ffrConfig;
307     flash_mode_config_t modeConfig;
308 } flash_config_t;
309 
310 /*******************************************************************************
311  * API
312  ******************************************************************************/
313 
314 #if defined(__cplusplus)
315 extern "C" {
316 #endif
317 
318 /*!
319  * @name Initialization
320  * @{
321  */
322 
323 /*!
324  * @brief Initializes the global flash properties structure members.
325  *
326  * This function checks and initializes the Flash module for the other Flash APIs.
327  *
328  * @param config Pointer to the storage for the driver runtime state.
329  *
330  * @retval #kStatus_FLASH_Success API was executed successfully.
331  * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided.
332  * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution.
333  * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported.
334  * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution.
335  */
336 status_t FLASH_Init(flash_config_t *config);
337 
338 /*@}*/
339 
340 /*!
341  * @name Erasing
342  * @{
343  */
344 
345 /*!
346  * @brief Erases the flash sectors encompassed by parameters passed into function.
347  *
348  * This function erases the appropriate number of flash sectors based on the
349  * desired start address and length.
350  *
351  * @param config The pointer to the storage for the driver runtime state.
352  * @param start The start address of the desired flash memory to be erased.
353  *              The start address need to be 512bytes-aligned.
354  * @param lengthInBytes The length, given in bytes (not words or long-words)
355  *                      to be erased. Must be 512bytes-aligned.
356  * @param key The value used to validate all flash erase APIs.
357  *
358  * @retval #kStatus_FLASH_Success API was executed successfully;
359  *         the appropriate number of flash sectors based on the desired
360  *         start address and length were erased successfully.
361  * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided.
362  * @retval #kStatus_FLASH_AlignmentError The parameter is not aligned with the specified baseline.
363  * @retval #kStatus_FLASH_AddressError The address is out of range.
364  * @retval #kStatus_FLASH_EraseKeyError The API erase key is invalid.
365  * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution.
366  * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported.
367  * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution.
368  */
369 status_t FLASH_Erase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key);
370 
371 /*@}*/
372 
373 /*!
374  * @name Programming
375  * @{
376  */
377 
378 /*!
379  * @brief Programs flash with data at locations passed in through parameters.
380  *
381  * This function programs the flash memory with the desired data for a given
382  * flash area as determined by the start address and the length.
383  *
384  * @param config A pointer to the storage for the driver runtime state.
385  * @param start The start address of the desired flash memory to be programmed. Must be
386  *              512bytes-aligned.
387  * @param src A pointer to the source buffer of data that is to be programmed
388  *            into the flash.
389  * @param lengthInBytes The length, given in bytes (not words or long-words),
390  *                      to be programmed. Must be 512bytes-aligned.
391  *
392  * @retval #kStatus_FLASH_Success API was executed successfully; the desired data were programed successfully
393  *         into flash based on desired start address and length.
394  * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided.
395  * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline.
396  * @retval #kStatus_FLASH_AddressError Address is out of range.
397  * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
398  * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution.
399  * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution.
400  * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported.
401  * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution.
402  */
403 status_t FLASH_Program(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes);
404 
405 /*@}*/
406 
407 /*!
408  * @brief Reads flash at locations passed in through parameters.
409  *
410  * This function read the flash memory from a given flash area as determined
411  * by the start address and the length.
412  *
413  * @param config A pointer to the storage for the driver runtime state.
414  * @param start The start address of the desired flash memory to be read.
415  * @param dest A pointer to the dest buffer of data that is to be read
416  *            from the flash.
417  * @param lengthInBytes The length, given in bytes (not words or long-words),
418  *                      to be read.
419  *
420  * @retval #kStatus_FLASH_Success API was executed successfully.
421  * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided.
422  * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline.
423  * @retval #kStatus_FLASH_AddressError Address is out of range.
424  * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
425  * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution.
426  * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution.
427  * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported.
428  * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution.
429  */
430 status_t FLASH_Read(flash_config_t *config, uint32_t start, uint8_t *dest, uint32_t lengthInBytes);
431 
432 /*!
433  * @name Verification
434  * @{
435  */
436 
437 /*!
438  * @brief Verifies an erasure of the desired flash area at a specified margin level.
439  *
440  * This function checks the appropriate number of flash sectors based on
441  * the desired start address and length to check whether the flash is erased
442  * to the specified read margin level.
443  *
444  * @param config A pointer to the storage for the driver runtime state.
445  * @param start The start address of the desired flash memory to be verified.
446  *        The start address need to be 512bytes-aligned.
447  * @param lengthInBytes The length, given in bytes (not words or long-words),
448  *        to be verified. Must be 512bytes-aligned.
449  *
450  * @retval #kStatus_FLASH_Success API was executed successfully; the specified FLASH region has been erased.
451  * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided.
452  * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with specified baseline.
453  * @retval #kStatus_FLASH_AddressError Address is out of range.
454  * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
455  * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution.
456  * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution.
457  * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported.
458  * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution.
459  */
460 status_t FLASH_VerifyErase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes);
461 
462 /*!
463  * @brief Verifies programming of the desired flash area at a specified margin level.
464  *
465  * This function verifies the data programed in the flash memory using the
466  * Flash Program Check Command and compares it to the expected data for a given
467  * flash area as determined by the start address and length.
468  *
469  * @param config A pointer to the storage for the driver runtime state.
470  * @param start The start address of the desired flash memory to be verified. need be 512bytes-aligned.
471  * @param lengthInBytes The length, given in bytes (not words or long-words),
472  *        to be verified. need be 512bytes-aligned.
473  * @param expectedData A pointer to the expected data that is to be
474  *        verified against.
475  * @param failedAddress A pointer to the returned failing address.
476  * @param failedData A pointer to the returned failing data.  Some derivatives do
477  *        not include failed data as part of the FCCOBx registers.  In this
478  *        case, zeros are returned upon failure.
479  *
480  * @retval #kStatus_FLASH_Success API was executed successfully;
481  *         the desired data have been successfully programed into specified FLASH region.
482  *
483  * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided.
484  * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with specified baseline.
485  * @retval #kStatus_FLASH_AddressError Address is out of range.
486  * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses.
487  * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution.
488  * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution.
489  * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported.
490  * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution.
491  */
492 status_t FLASH_VerifyProgram(flash_config_t *config,
493                              uint32_t start,
494                              uint32_t lengthInBytes,
495                              const uint8_t *expectedData,
496                              uint32_t *failedAddress,
497                              uint32_t *failedData);
498 
499 /*@}*/
500 
501 /*!
502  * @name Properties
503  * @{
504  */
505 
506 /*!
507  * @brief Returns the desired flash property.
508  *
509  * @param config A pointer to the storage for the driver runtime state.
510  * @param whichProperty The desired property from the list of properties in
511  *        enum flash_property_tag_t
512  * @param value A pointer to the value returned for the desired flash property.
513  *
514  * @retval #kStatus_FLASH_Success API was executed successfully; the flash property was stored to value.
515  * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided.
516  * @retval #kStatus_FLASH_UnknownProperty An unknown property tag.
517  */
518 status_t FLASH_GetProperty(flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value);
519 
520 /*@}*/
521 
522 #ifdef __cplusplus
523 }
524 #endif
525 
526 /*@}*/
527 
528 #endif /* __FLASH_FLASH_H_ */
529