Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Generic functions read and write the API-DLL’s configuration, access status messages and can instruct the FPA to power or reset the target device. The functions described in this section require that each FPA already be opened using Multi API-DLL Functions | F_OpenInstancesAndFPAs.

After the following functions have been used to configure each FPA correctly for its target device, use Data Buffer Functions to determine what code should be written during programming. Finally, Encapsulated Functions can perform the process of programming, writing, erasing, verifying, etc., according to the aforementioned settings.

Table of Contents
minLevel1
maxLevel2

1. F_Initialization
Anchor
F_Initialization
F_Initialization

General Description

Initialize FPA after it has been successfully opened using Multi API-DLL Functions | F_OpenInstancesAndFPAs. F_Initialization performs the following tasks:

...

For backwards compatibility, F_Initialization will call F_OpenInstancesAndFPAs(*# *) if no instances are currently opened, and perform initialization on FPA 1. If Multi API-DLL Functions | F_OpenInstancesAndFPAs was already invoked successfully then initialization is performed on the selected FPA index from the function Multi API-DLL Functions | F_Set_FPA_index.

...

General Description

Configure Generic Functions | F_Initialization to use (default) or skip config.ini file. When skipping config.ini it is necessary to use Generic Functions | F_ConfigFileLoad or Generic Functions | F_Set_Config_Value_By_Name functions to configure the adapter.

...

3. F_Get_Config_Name_List
Anchor
F_Get_Config_Name_List
F_Get_Config_Name_List

General Description

Iterate over configuration parameter names, starting from index 0. Increase index until return is null character. Will return a pointer to a character array with name of parameter or null character once index is too high.

Requires the target FPA to be opened using Multi API-DLL Functions | F_OpenInstancesAndFPAs and initialized using Generic Functions | F_Initialization.

Syntax

Code Block
languagecpp
char * F_Get_Config_Name_List( INT_X index );

...

Access the current FPA’s configuration. Use Generic Functions | F_Get_Config_Name_List to get configuration parameter names, then use them as input to this function. Select input type to validate name, and get current, minimum, maximum, and default values.

Because normal return values from this function can be any value, from 0 to 0xFFFFFFFF, it is important to pick a correct fpa index (use Multi API-DLL Functions | F_Check_FPA_index to validate) and validate the configuration parameter name first (using CONFSEL_VALIDATE), before retrieving the current, minimum, maximum or default values. Unless all FPAs are to be configured identically, avoid using FPA index 0 to prevent confusion in results (when results don’t match using FPA index 0 (all FPAs) the result is simply FPA_UNMATCHED_RESULTS (-1)).

Requires the target FPA to be opened using Multi API-DLL Functions | F_OpenInstancesAndFPAs and initialized using Generic Functions | F_Initialization.

Syntax

Code Block
unsigned int  F_Get_Config_Value_By_Name(char  *name,  INT_X  type);

...

Set the current FPA’s configuration. Use Generic Functions | F_Get_Config_Name_List to get configuration parameter names, then use them as input to this function. New value for configuration parameter will be trimmed by minimum and maximum values allowed for this parameter. If not initialized, this parameter will have a default value. Double check parameters after configuration using F_Get_Config_Value_By_Name.

Requires the target FPA to be opened using Multi API-DLL Functions | F_OpenInstancesAndFPAs and initialized using Generic Functions | F_Initialization.

Syntax

Code Block
languagecpp
INT_X F_Set_Config_Value_By_Name(char *name, unsigned int newValue);

...

Modify programmer’s configuration according to data taken from specified configuration file. This setup will override previous values and leave omitted parameters untouched. When loaded for the first time, unspecified configuration parameters take on default values as given by Generic Functions | F_Get_Config_Value_By_Name. When calling this function multiple times with different configuration files, make sure to specify all relevant configuration parameters.

A configuration file can be created using the FlashPro-ARM/GangPro-ARM GUI software, or use the functions Generic Functions | F_Get_Config_Name_List, Generic Functions | F_Get_Config_Value_By_Name to extract a list of configuration names and values. The Generic Functions | F_Set_Config_Value_By_Name function can be used to set configuration parameters instead of Generic Functions | F_ConfigFileLoad.

Requires the target FPA to be opened using Multi API-DLL Functions | F_OpenInstancesAndFPAs and initialized using Generic Functions | F_Initialization.

Syntax

Code Block
languagecpp
INT_X F_ConfigFileLoad( char * filename );

...

BYTE reset : set reset line

  • DEFAULT_RESET_LO (0) : reset line set to GND

  • DEFAULT_RESET_HI (1) : reset line set to Vcc

  • DEFAULT_RESET_3ST (2) : reset line to tri-state

BYTE VccOn : set Vcc line from adapter

...