LibTiePie  0.4.5
Library for interfacing TiePie engineering instruments
 All Files Functions Typedefs Macros Modules Pages
Resolution

Description

This section contains all resolution related functions.

The resolution determines how accurate the amplitude of a signal can be measured. The higher the resolution, the more accurate the input signal can be reconstructed.

Devices can support multiple resolutions, use ScpGetResolutions() to determine the available resolutions for a device.

Besides native hardware resolutions, also enhanced resolutions can be available for a device. Use ScpIsResolutionEnhanced() to determine whether the current resolution is a native hardware resolution or an enhanced resolution.

The resolution can be set manually, but can also be set automatically, based on the selected sample frequency. Use ScpGetAutoResolutionModes() to determine the available auto resolution modes. Possible auto resolution modes are:

Changing the sample frequency may change the resolution if auto resolution mode is AR_NATIVEONLY or AR_ALL.

Manually setting a resolution will set auto resolution mode to AR_DISABLED.

By default the auto resolution mode is set to AR_NATIVEONLY for the Handyscope HS5.

Functions

uint32_t ScpGetAutoResolutionModes (TpDeviceHandle_t hDevice)
 Get the supported auto resolution modes. More...
 
uint32_t ScpGetAutoResolutionMode (TpDeviceHandle_t hDevice)
 Get the current auto resolution mode. More...
 
uint32_t ScpSetAutoResolutionMode (TpDeviceHandle_t hDevice, uint32_t dwAutoResolutionMode)
 Set the auto resolution mode. More...
 
uint32_t ScpGetResolutions (TpDeviceHandle_t hDevice, uint8_t *pList, uint32_t dwLength)
 Get an array with the supported resolutions of the specified device. More...
 
uint8_t ScpGetResolution (TpDeviceHandle_t hDevice)
 Get the current resolution. More...
 
uint8_t ScpSetResolution (TpDeviceHandle_t hDevice, uint8_t byResolution)
 Set the resolution. More...
 
bool8_t ScpIsResolutionEnhanced (TpDeviceHandle_t hDevice)
 Check whether the currently selected resolution is enhanced or a native resolution of the hardware. More...
 

Function Documentation

uint32_t ScpGetAutoResolutionModes ( TpDeviceHandle_t  hDevice)

Get the supported auto resolution modes.

Parameters
hDeviceA device handle.
Returns
The supported auto resolution modes, a set of OR-ed AR_* values.
Since
0.4.3
uint32_t ScpGetAutoResolutionMode ( TpDeviceHandle_t  hDevice)

Get the current auto resolution mode.

Parameters
hDeviceA device handle.
Returns
The currently selected auto resolution mode, a AR_* value.
Since
0.4.3
uint32_t ScpSetAutoResolutionMode ( TpDeviceHandle_t  hDevice,
uint32_t  dwAutoResolutionMode 
)

Set the auto resolution mode.

Parameters
hDeviceA device handle.
dwAutoResolutionModeThe required auto resolution mode, a AR_* value.
Returns
The actually set auto resolution mode, a AR_* value.
Since
0.4.3
uint32_t ScpGetResolutions ( TpDeviceHandle_t  hDevice,
uint8_t *  pList,
uint32_t  dwLength 
)

Get an array with the supported resolutions of the specified device.

The caller must assure that the array is available and that enough memory is allocated.

Parameters
hDeviceA device handle.
pListPointer to array to contain the supported resolutions, or NULL.
dwLengthNumber of elements in array.
Returns
Total number of supported resolutions.
Example
uint8_t byResolutionCount = ScpGetResolutions( hDevice , NULL , 0 );
uint8_t* pResolutions = malloc( sizeof( uint8_t ) * byResolutionCount );
byResolutionCount = ScpGetResolutions( hDevice , pResolutions , byResolutionCount );
printf( "ScpGetResolutions:\n" );
for( i = 0 ; i < byResolutionCount ; i++ )
printf( "- %u bits\n" , pResolutions[ i ] );
free( pResolutions );
Since
0.4.0
uint8_t ScpGetResolution ( TpDeviceHandle_t  hDevice)

Get the current resolution.

Parameters
hDeviceA device handle.
Returns
The current resolution, in bits.
Since
0.4.0
uint8_t ScpSetResolution ( TpDeviceHandle_t  hDevice,
uint8_t  byResolution 
)

Set the resolution.

Parameters
hDeviceA device handle.
byResolutionThe required resolution, in bits.
Returns
The actually set resolution, in bits.
Remarks
Changing the resolution may affect the sample frequency and/or record length.
Setting the resolution will set auto resolution mode to AR_DISABLED.
Since
0.4.0
bool8_t ScpIsResolutionEnhanced ( TpDeviceHandle_t  hDevice)

Check whether the currently selected resolution is enhanced or a native resolution of the hardware.

Parameters
hDeviceA device handle.
Returns
BOOL8_TRUE if the current resolution is enhanced, BOOL8_FALSE otherwise.
Since
0.4.0