...
value of zero or greater : voltage in millivolts
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with F_OpenInstancesAndFPAs or index out of range
19. F_Get_Power_Results
Anchor | ||||
---|---|---|---|---|
|
General Description
Get Read detailed Voltage and Current measurement results based on General Configuration | Power Monitor. This function will query the adapter for the latest measurement sample and copy those results into the xs_adc structure.
This function is supported on all adapters (USB-FPA 6.1, only on XStream-Iso, and XStreamPro-Iso )adapters. The USB-FPA 6.1 adapter will return FALSE.
Syntax
Code Block | ||
---|---|---|
| ||
INT_X F_Get_TargetsPower_VccResults( void double *xs_adc); |
Input
none.
Select FPA to perform operation on using F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use F_LastStatus to get individual results).
Output
INT_X : returns target voltage in millivolts
...
value of zero or greater : voltage in millivolts
...
double *xs_adc : pointer to instance of XS_ADC and doubles array, i.e.
Code Block | ||
---|---|---|
| ||
XS_ADC xs_adc;
F_Get_Power_Results(xs_adc.members); |
Code Block | ||
---|---|---|
| ||
union XS_ADC
{
double members[ XS_ADC_NUM_MEMBERS ];
struct
{
double ExtVcc; //actual external Vcc value in V
double Vcc; //actual Vcc from programmer value in V
double Vpp; //actual Vpp for fuse blown from programmer value in V
double ExtVccMin; //external Vcc value in V - min value from the last read up to now
double ExtVccMax; //external Vcc value in V - max value from the last read up to now
double VccMin; //Vcc value in V - min value from the last read up to now
double VccMax; //Vcc value in V - max value from the last read up to now
double Icc_mA; //Icc value in mA - current value
double Icc_mA_av4; //Icc value in mA - average for last 4 read (interval ~ 10ms)
double Icc_mA_av16; //Icc value in mA - average for last 16 read (interval ~ 10ms)
double Icc_mA_min; //Icc value in mA - min value from the last read up to now
double Icc_mA_max; //Icc value in mA - max value from the last read up to now
double Temperature; //Temperature inside XStream in C deg
double Icc_mA_av64; //Icc value in mA - average for alpha 1/64
double Icc_mA_av; //Icc value in mA - average for defined alpha 1/N
} data;
}; |
Select FPA to perform operation on using F_Set_FPA_index, index 1 to 64.
Output
INT_X : result of operation
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 F_OpenInstancesAndFPAs or index out of range
Example
Insert excerpt | ||||
---|---|---|---|---|
|
20. F_Get_Last_Power_Results_data
General Description
This function is almost identical to F_Get_Power_Results
except that the adapter is not queried. The value returned is simply the last value saved in memory from the last F_Get_Power_Results
call.
This function is supported only on XStream-Iso, and XStreamPro-Iso adapters. The USB-FPA 6.1 adapter will return FALSE.
Syntax
Code Block | ||
---|---|---|
| ||
INT_X F_Get_Last_Power_Results_data(double *xs_adc); |
Input
double *xs_adc : pointer to instance of XS_ADC and doubles array, i.e.
Code Block | ||
---|---|---|
| ||
XS_ADC xs_adc;
F_Get_Last_Power_Results_data(xs_adc.members);
union XS_ADC
{
double members[ XS_ADC_NUM_MEMBERS ];
struct
{
double ExtVcc; //actual external Vcc value in V
double Vcc; //actual Vcc from programmer value in V
double Vpp; //actual Vpp for fuse blown from programmer value in V
double ExtVccMin; //external Vcc value in V - min value from the last read up to now
double ExtVccMax; //external Vcc value in V - max value from the last read up to now
double VccMin; //Vcc value in V - min value from the last read up to now
double VccMax; //Vcc value in V - max value from the last read up to now
double Icc_mA; //Icc value in mA - current value
double Icc_mA_av4; //Icc value in mA - average for last 4 read (interval ~ 10ms)
double Icc_mA_av16; //Icc value in mA - average for last 16 read (interval ~ 10ms)
double Icc_mA_min; //Icc value in mA - min value from the last read up to now
double Icc_mA_max; //Icc value in mA - max value from the last read up to now
double Temperature; //Temperature inside XStream in C deg
double Icc_mA_av64; //Icc value in mA - average for alpha 1/64
double Icc_mA_av; //Icc value in mA - average for defined alpha 1/N
} data;
}; |
Select FPA to perform operation on using F_Set_FPA_index, index 1 to 64.
Output
INT_X : result of operation
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 F_OpenInstancesAndFPAs or index out of range
Example
21. F_XS_Clr_ADC_av_history
General Description
Clear values accumulated in measurement history. Useful for resetting long running averages.
This function is supported only on XStream-Iso, and XStreamPro-Iso adapters. The USB-FPA 6.1 adapter will return FALSE.
Syntax
Code Block | ||
---|---|---|
| ||
INT_X F_XS_Clr_ADC_av_history(); |
Input
none.
Select FPA to perform operation on using F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use F_LastStatus to get individual results).
Output
INT_X : result of operation
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 F_OpenInstancesAndFPAs or index out of range
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F_LastStatus
Example
22. F_XS_Update_HW_State
General Description
Set pull-up resistor mode and current measurement sensitivity.
This function is supported only on the XStreamPro-Iso adapter. The USB-FPA 6.1 and XStream-Iso adapter will return FALSE.
Syntax
Code Block | ||
---|---|---|
| ||
INT_X F_XS_Update_HW_State(BYTE mode, INT_X data); |
Input
BYTE mode : set, or clear flag
MODE_XS_IO_SET_FLAGS (0x12) - set flag chosen in data
MODE_XS_IO_CLR_FLAGS (0x13) - clear flag chosen in data
INT_X data : bit-wise OR of bits to affect (set or clear)
IO_PULLUP_EN (1) - change pull-up resistor mode, disable for current measurement
FORCE_ICC_LOW_SENSITIVITY (2) - Low Sensitivity only (20uA - 200mA)
FORCE_ICC_HI_SENSITIVITY (4) - Hi Sensitivity only (50nA - 0.6mA)
NOTE: If FORCE_ICC_LOW_SENSITIVITY and FORCE_ICC_HI_SENSITIVITY flags are cleared then adapter is in Automatic (50nA - 200mA) mode. If both flags are set, adapter will default to Low Sensitivity mode.
Automatic mode is generally preferred, but in automatic mode, around 5 samples will be lost if current fluctuations cause the adapter to switch from Hi-to-Low, or Low-to-Hi mode. If the user is only interested in measuring small currents, then setting to Hi Sensitivity is preferred. In Hi Sensitivity mode samples above 0.6mA will saturate at that value. In Low Sensitivity mode samples below 20uA will be noise.
Select FPA to perform operation on using F_Set_FPA_index, index 1 to 64.
Output
INT_X : result of operation
FALSE (0) : failed - USB-FPA 6.1, or XStream-Iso adapter detected
TRUE (1) : succeeded - XStreamPro-Iso adapter detected
FPA_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 F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with F_OpenInstancesAndFPAs or index out of range
DLL_OUTSIDE_CALLONE(return, INT_X, Get_Power_Results, double *, xs_adc)
DLL_OUTSIDE_CALLONE(return, INT_X, Get_Last_Power_Results_data, double *, xs_adc)
DLL_OUTSIDE_CALLONE(return, INT_X, XS_Current_zeroing, int, state, char *, txt )
DLL_OUTSIDE_CALLONE(return, INT_X, XS_Update_HW_State, BYTE, mode, INT_X, data )
DLL_OUTSIDE_CALLALL(return, INT_X, XS_Clr_ADC_av_history )
...
refer to F_LastStatus
Example
23. F_XS_Current_zeroing
General Description
Calibration function that can be used to improve the results of Current measurement. No targets should be connected to the adapter.
This function is supported only on XStream-Iso, and XStreamPro-Iso adapters. The USB-FPA 6.1 adapter will return FALSE.
Syntax
Code Block | ||
---|---|---|
| ||
INT_X F_XS_Current_zeroing( int state, char *txt ); |
Input
int state: calibration steps, from 0 to 100 (inclusive)
char *txt : comment related to currently executing part of zeroing procedure - the same as it is displayed in GUI
Select FPA to perform operation on using F_Set_FPA_index, index 1 to 64.
Output
INT_X : result of operation
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 F_OpenInstancesAndFPAs or index out of range
Example
Insert excerpt | ||||
---|---|---|---|---|
|
24. F_Set_fpa_io_state
General Description
Set state of the Reset, Vcc and JTAG lines after programming is finished.
Syntax
Code Block | ||
---|---|---|
| ||
INT_X F_Set_fpa_io_state( BYTE jtag, BYTE reset, BYTE VccOn ); |
Input
BYTE jtag : set JTAG lines (TMS, TCK, TDI)
...
Select FPA to perform operation on using F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
TRUE (1) : succeeded
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with F_OpenInstancesAndFPAs or index out of range
...
25. F_Get_Sector_Size
General Description
Will return the segment/sector size for memory region that contains given address. This function will access the FPA’s meta-data for the target device specified in configuration options. No communication with target device actually takes place.
Syntax
Code Block | ||
---|---|---|
| ||
INT_X F_Get_Sector_Size( INT_X address ); |
Input
INT X address : address contained by segment/sector
...
Select FPA to perform operation on using F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use F_LastStatus to get individual results).
Output
INT_X : result of operation
...