IMPORTANT: When any function is trying to access the invalid FPA, then return value
from this function is -2 (FPA_INVALID_NO)
Note: When index ALL_ACTIVE_FPA (0) is used, then all data can be transferred from application to all active
FPA’s (API-DLLs). However, when the data is transferred from FPA (or API-DLLs) to the application, then
the FPA index CANNOT be ALL_ACTIVE_FPA (0). Index must select desired FPA. When the simultaneous
process is required eg. reading flash contents from all target devices, then the F_Copy_All_Flash_to_Buffer()
should be called after the F_Set_FPA_index( ALL_ACTIVE_FPA ). When finished, the contents of each
buffer (inside each API-DLLx) can be read using the F_Set_FPA_index( 1 ), F_Set_FPA_index( 2 ) ....., and
F_Get_Byte_from_Buffer(..). See below .
F_Set_FPA_index (ALL_ACTIVE_FPA); //select all available FPAs
F_Copy_All_Flash_to_Buffer(); //simultaneous process
for( fpa=1; fpa=fpa_max; fpa++ )
{
if( F_Set_FPA_index(fpa) == FPA_INVALID_NO ) continue;
for(addr = addr_min; addr <= addr_max; addr++)
{
data[addr][fpa-1] = F_Get_Byte_from_Buffer(addr);
}
}
F_Get_FPA_index
F_Get_FPA_index - Get current FPA index
Syntax:
BYTE MSPPRG_API F_Get_FPA_index ( void );
Return value:
current FPA index
F_Check_FPA_index
F_Check_FPA_index - Get current FPA index and check if index is valid.
Similar function to the F_Get_FPA_index, however, while the F_Get_FPA_index is returning
current FPA index ragardless if the index is valid or not, simply returning the value set by the
function F_Set_FPA_index(..). The Check_FPA_index will return -2 (minus two) FPA_INVALID_NO
if FPA is pointing not initialized FPA (dll instance).
44