LibTiePie  0.4.2
Library for interfacing TiePie engineering instruments
 All Files Functions Typedefs Groups Pages
Resolution

This section contains all resolution related functions. More...

Functions

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

Detailed 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.

By default the resolution is set to: 12 bits for the Handyscope HS5.

Function Documentation

uint8_t ScpGetResolution ( TpDeviceHandle_t  hDevice)

Get the current resolution.

Parameters
hDeviceA device handle.
Returns
The current resolution, in bits.
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.

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 );
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.
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.
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.