MKMxxZxxACxx5 Bare Metal Software Drivers  R4.1.6
Reference Manual
FTFA API Specification

Overview

This section describes functions and macros of the driver's API.

Macros

#define FTFA_WriteArray(pDst, pSrc, size)
 Writes array into flash memory. More...
 
#define FTFA_ReadArray(pSrc, pDst, size)
 Reads array from flash memory. More...
 
#define FTFA_WriteW32(pDst, val)
 Write long word into flash memory. More...
 
#define FTFA_EraseSector(pDst)
 Erases all bytes in the 1 KB sector. More...
 
#define FTFA_ReadIFR(addr)
 Reads four bytes from Flash Information Row (IFR). More...
 

Macro Definition Documentation

#define FTFA_WriteArray (   pDst,
  pSrc,
  size 
)

This function writes array into flash memory starting at address specified by pDst parameter.

Parameters
pDstPointer to the starting address of the flash memory. The supplied address must be longword aligned.
pSrcPointer to the source array in RAM to be written. The supplied address must be longword aligned.
sizeSize of the array in number of bytes (must be aligned to long words).
Returns
number of bytes written into flash memory.
Note
Implemented as a function call.
Warning
Re-programming of existing 0s to 0 is not allowed as this overstresses the device. This function executes from RAM.
See also
FTFA_WriteW32, FTFA_EraseSector, FTFA_ReadArray
#define FTFA_ReadArray (   pSrc,
  pDst,
  size 
)

This function reads array from flash memory starting at address specified by pSrc parameter.

Parameters
pSrcPointer to the starting of the flash memory. The supplied address must be longword aligned.
pDstPointer to the destination array in RAM. The supplied address must be longword aligned.
sizeSize of the array in number of bytes (must be aligned to long words).
Returns
number of bytes read from flash memory.
Note
Implemented as a function call. You can use also memcpy() function.
See also
FTFA_WriteArray
#define FTFA_WriteW32 (   pDst,
  val 
)

This function writes long word into flash memory starting at address specified by pDst parameter.

Parameters
pDstPointer to the starting address of the flash memory. The supplied address must be longword aligned.
valuint32 value to be written into flash memory.
Returns
number of bytes written into flash memory.
Note
Implemented as a function call.
Warning
This function executes from RAM.
See also
FTFA_WriteArray, FTFA_EraseSector
#define FTFA_EraseSector (   pDst)

This function erases all bytes in the 1 KB sector of the flash memory starting at address in the flash sector to be erased.

Parameters
pDstPointer to the starting address of the flash memory. The supplied address must be longword aligned.
Note
Implemented as a function call.
Warning
Use erase operation to restore bits from '0' to '1'; bits cannot be programmed from a '0' to a '1'. This function executes from RAM.
See also
FTFA_WriteW32, FTFA_WriteArray
#define FTFA_ReadIFR (   addr)

This function reads four bytes from Flash Information Row (IFR) starting at address specified by addr parameter.

Parameters
addrLongword aligned address in range 0x00 to 0xFF hexadecimal.
Returns
uint32 four bytes.
Note
Implemented as a function call.