...
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 | ||||
---|---|---|---|---|
|
1. F_Initialization
Anchor | ||||
---|---|---|---|---|
|
General Description
Initialize FPA after it has been successfully opened using Multi API-DLL Functions | F_OpenInstancesAndFPAs. F_Initialization performs the following tasks:
...
Select which FPA to initialize, using the function Multi API-DLL Functions | F_Set_FPA_index with desired parameter (0-all, 1-64 for individual FPA). After successful initialization, call Generic Functions | F_ConfigFileLoad to read settings from file, or configure settings manually using the function Generic Functions | F_Set_Config_Value_By_Name.
For backwards compatibility, F_nitialization 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.
Default config file used to perform initialization is config.ini (Use F_Use_Config_INI(FALSE) to disable automatic load of config.ini).
...
FALSE (0) : failed
TRUE (1) : succeeded
4 : Programming adapter not detected
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
2. F_Use_Config_INI
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.
...
FALSE (0) : failed
TRUE (1) : succeeded
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
3. F_Get_Config_Name_List
Anchor | ||||
---|---|---|---|---|
|
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 | ||
---|---|---|
| ||
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); |
...
FALSE (0) : failed name validation (CONFSEL_VALIDATE)
TRUE (1) : successful name validation (CONFSEL_VALIDATE)
any : actual parameter value, minimum and maximum bounds, and default value if not set by user/file (CONFSEL_VALUE, CONFSEL_MIN, CONFSEL_MAX, CONFSEL_DEFAULT)
-1 or 0xFFFFFFFF : name not found (avoid this by using CONFSEL_VALIDATE first)
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F LastStatus(avoid this by not using FPA index 0)to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range(avoid this by using F Check FPA index first)
Example
Use the example code below to read full configuration:
...
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 | ||
---|---|---|
| ||
INT_X F_Set_Config_Value_By_Name(char *name, unsigned int newValue); |
...
FALSE (0) : parameter name not found
TRUE (1) : name found and parameter value changed
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
6. F_Get_Device_Info
...
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64.
Output
INT_X : value dependent on input parameter
any : based on input parameter
-1 (0xFFFFFFFF) : invalid input parameter
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
Example
...
microcontroller index if input name was found and set, index is greater than or equal to zero (0)
-1 (0xFFFFFFFF) : name not found (avoid by getting list of proper names using F_Get_MCU_Name_list)
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
8. F_Search_MCU_Name
...
FALSE (0) : index parameter out of range
TRUE (1) : index parameter set correctly
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
Example
...
Code Block language cpp // return Type + Version // Type 0x1000 - Single FlashPro430 - Parallel Port type // 0x2000 - Single FlashPro430 - USB type // 0x3000 - Single GangPro430 - USB type // 0x4000 - Single FlashPro-CC - USB type // 0x5000 - Single GangPro-CC - USB type // 0xA000 - Single FlashPro2000- USB type // 0xB000 - Single GangPro2000 - USB type // 0xE000 - Single FlashPro-ARM - USB type // 0xF000 - Single GangPro-ARM - USB type // Version = 0x0FFF & version
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
15. F_ConfigFileLoad
Anchor | ||||
---|---|---|---|---|
|
...
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 | ||
---|---|---|
| ||
INT_X F_ConfigFileLoad( char * filename ); |
...
FALSE (0) : failed
TRUE (1) : succeeded
STATUS_OPEN_FILE_ERROR (535) : could not open file
STATUS_CORRUPT_CONFIG_ERROR (554) : malformed configuration file (missing header, etc.)
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
16. F_Power_Target
...
FALSE (0) : failed
TRUE (1) : succeeded
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
17. F_Reset_Target
...
FALSE (0) : failed
TRUE (1) : succeeded
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
18. F_Get_Targets_Vcc
...
value of zero or greater : voltage in millivolts
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
19. F_Get_Power_Results
Anchor | ||||
---|---|---|---|---|
|
...
FALSE (0) : failed - USB-FPA 6.1 adapter detected
TRUE (1) : succeeded - XStream-Iso, and XStreamPro-Iso adapter detected
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
Example
...
FALSE (0) : failed - USB-FPA 6.1 adapter detected
TRUE (1) : succeeded - XStream-Iso, and XStreamPro-Iso adapter detected
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
Example
...
FALSE (0) : failed - USB-FPA 6.1 adapter detected
TRUE (1) : succeeded - XStream-Iso, and XStreamPro-Iso adapter detectedFPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with F_OpenInstancesAndFPAs or index out of range
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
Example
...
FALSE (0) : failed - USB-FPA 6.1, or XStream-Iso adapter detected
TRUE (1) : succeeded - XStreamPro-Iso adapter detectedFPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with F_OpenInstancesAndFPAs or index out of rangeIso adapter detected
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
Example
...
FALSE (0) : failed - USB-FPA 6.1 adapter detected
TRUE (1) : succeeded - XStream-Iso, and XStreamPro-Iso adapter detected
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
Example
...
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
...
FALSE (0) : failed
TRUE (1) : succeeded
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
25. F_Get_Sector_Size
...
FALSE (0) : address out of range
positive number : actual sector size
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range