Versions Compared

Key

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

...

Code Block
languagecpp
std::stringstream msg;
msg << "INIT: " << (i) << ": Get_FPA_Label, SN=" << inst.x.SN << "\r\n";
msg << "INIT:   HW ID=" << (int)inst.x.hardware_ID << ", HW sub-ID=" << (int)inst.x.hardware_SubID << "\r\n";
msg << "INIT:   Full Access=" << (int)inst.x.full_access << ", Interface Type=" << (int)inst.x.Interface_Type << "\r\n";
msg << "INIT:   Access Key=" << (int)inst.x.Valid_access_key << "\r\n";
msg << "INIT:   HW PN=" << inst.x.adapter_hardware_PN << "\r\n";
msg << "INIT:   Adapter Desc=" << inst.x.adapter_description;

12. F_Get_FPA_List

General Description

This function will print the metadata about all avaialble FPAs that are connected to the computer, up to a maximum of 64 adapters.

Syntax

Code Block
languagecpp
INT_X  MSPPRG_API	F_Get_FPA_List( ALL_FPA_LIST * FPA_List );

Input

ALL_FPA_LIST *FPA_List: pointer to array of ALL_FPA_LIST structs, i.e.

Code Block
languagecpp
#define MAX_ID_DESC		 15
#define MAX_ACCESS_DESC	 32
typedef struct
{
	UINT32  active;
	UINT32  SN;
	UINT32  CommType;
	UINT32  HW_ID;
	UINT32  HW_rev;
	char  text[MAX_ID_DESC+1];
	char  access_text[MAX_ACCESS_DESC+1];
} ALL_FPA_LIST;

//i.e.: 
ALL_FPA_LIST FPA_List[MAX_USB_DEV_NUMBER];
//F_Get_FPA_List(FPA_List);
INT_X  MSPPRG_API	F_Get_FPA_List( ALL_FPA_LIST * FPA_List );	// FPA_List -> size MAX_USB_DEV_NUMBER

Output

INT X : number of active adapters

13. F_GetProgressBar

General Description

Get internal progress counter value for operations done inside Encapsulated Functions . When used in conjunction with F_GetLastOpCode it allows the user application to keep track of progress in the same way that the FlashPro-ARM/GangPro-ARM GUI does.

...

This function is thread-safe, therefore it can be called while the Multi API-DLL is busy, for example running F_AutoProgram. Intended usage is to call an encapsulated function with one thread, and repeatedly call this function and F_GetLastOpCode with another thread. When simultaneously programming using multiple FPAs (fpa index set to 0 (ALL FPAs), the thread monitoring progress can iterate different input parameters (fpa=1, fpa=2, fpa=3, etc.) to monitor the progress of each FPA individually. This function cannot be called with parameter 0 (ALL FPAs).

Syntax

Code Block
languagecpp
INT_X	MSPPRG_API F_GetProgressBar(  BYTE  fpa  );

Input

BYTE fpa : desired FPA index, 1 to 64.

Output

INT X : progress indicator

...

Example

Refer to GetLastOpCode.

...

14. F_GetLastOpCode

General Description

Read internal opcode value for sub-operations done inside Encapsulated Functions. When used in conjunction with F_GetProgressBar it allows the user application to keep track of progress in the same way that the FlashPro-ARM/GangPro-ARM GUI does.

...

This function is thread-safe, therefore it can be called while the Multi API-DLL is busy, for example running F_AutoProgram. Intended usage is to call an encapsulated function with one thread, and repeatedly call this function and F_GetProgressBar with another thread. When simultaneously programming using multiple FPAs (fpa index set to 0 (ALL FPAs), the thread monitoring progress can iterate different input parameters (fpa=1, fpa=2, fpa=3, etc.) to monitor the progress of each FPA individually. This function cannot be called with parameter 0 (ALL FPAs).

Syntax

Code Block
languagecpp
INT_X	MSPPRG_API F_GetLastOpCode( BYTE fpa );

Input

BYTE fpa : desired FPA index, 1 to 64.

Output

INT X : opcode of currently running sub-operation

...

Code Block
languagecpp
void UpdateProgress(BYTE fpa, INT_X &progValue, INT_X &lastOpCode, CString &opCodeUpdate)
{
  if(fpa == 0)
  {
    //invalid index
    return;
  }
  progValue = F_GetProgressBar(fpa);
  lastOpCode = F_GetLastOpCode(fpa);
  opCodeUpdate = "Unknown";
  switch(lastOpCode)
  {
    case PROG_OPCODE_VERIFY_ACCESS:
      opCodeUpdate = "Verify Access To MCU";
      break;
    case PROG_OPCODE_FLASH_ERASE:
      opCodeUpdate = "Flash Erase";
      break;
    case PROG_OPCODE_FLASH_BLANK_CHECK:
      opCodeUpdate = "Flash Blank Check";
      break;
    case PROG_OPCODE_FLASH_SELECTED_BLANK_CHECK:
      opCodeUpdate = "Selected Memory Blank Check";
      break;
    case PROG_OPCODE_FLASH_WRITE:
      opCodeUpdate = "Flash Write";
      break;
    case PROG_OPCODE_FLASH_VERIFY:
      opCodeUpdate = "Flash Verify";
      break;
    case PROG_OPCODE_FLASH_READ:
      opCodeUpdate = "Flash Read";
      break;
    case PROG_OPCODE_LOCK_MCU:
      opCodeUpdate = "Lock MCU";
      break;
    case PROG_OPCODE_UNLOCK_MCU:
      opCodeUpdate = "Unlock MCU";
      break;
    case PROG_OPCODE_START_APP:
      opCodeUpdate = "Start Application";
      break;
  }  
}

...

15. F_Trace_ON

General Description

Activate tracing for subsequent calls to the Multi API-DLL. Log is saved in DLLtrace.txt located in the Multi API-DLL directory. When activated, records all API-DLL function calls from the application software invoked via the Multi API-DLL. The DLLtrace.txt is overwritten for each new session.

Syntax

Code Block
languagecpp
void F_Trace_ON( void );

Input

none.

Output

none.

...

16. F_Trace_OFF

General Description

Disable tracing.

Syntax

Code Block
languagecpp
void F_Trace_OFF( void );

Input

none.

Output

none.