libtiepie-hw  1.1.10

Functions to control the clock source of the oscilloscope. More...

Collaboration diagram for Source:

Functions

TIEPIE_HW_API uint32_t tiepie_hw_oscilloscope_get_clock_sources (tiepie_hw_handle handle)
 Get the supported clock sources of the specified oscilloscope. More...
 
TIEPIE_HW_API uint32_t tiepie_hw_oscilloscope_get_clock_source (tiepie_hw_handle handle)
 Get the currently selected clock source of the specified oscilloscope. More...
 
TIEPIE_HW_API uint32_t tiepie_hw_oscilloscope_set_clock_source (tiepie_hw_handle handle, uint32_t value)
 Set the clock source of the specified oscilloscope. More...
 
TIEPIE_HW_API uint32_t tiepie_hw_oscilloscope_get_clock_source_frequencies (tiepie_hw_handle handle, double *list, uint32_t length)
 Get an array with the supported clock source frequencies of the specified oscilloscope. More...
 
TIEPIE_HW_API double tiepie_hw_oscilloscope_get_clock_source_frequency (tiepie_hw_handle handle)
 Get the current clock source frequency of the specified oscilloscope. More...
 
TIEPIE_HW_API double tiepie_hw_oscilloscope_set_clock_source_frequency (tiepie_hw_handle handle, double value)
 Set the clock source frequency of the specified oscilloscope. More...
 

Detailed Description

Functions to control the clock source of the oscilloscope.

Oscilloscopes can support multiple clock sources, use tiepie_hw_oscilloscope_get_clock_sources() to determine the available clock sources for an oscilloscope.

When an oscilloscope supports selecting an external clock source, refer to the instrument manual for the location of the external clock input and the specifications of the required external clock signal.

Depending on the instrument, an external clock input can support multiple input frequencies. Use tiepie_hw_oscilloscope_get_clock_source_frequencies() to determine which frequencies are supported.

By default the clock source is set to: Internal (TIEPIE_HW_CS_INTERNAL).

Function Documentation

◆ tiepie_hw_oscilloscope_get_clock_sources()

TIEPIE_HW_API uint32_t tiepie_hw_oscilloscope_get_clock_sources ( tiepie_hw_handle  handle)

Get the supported clock sources of the specified oscilloscope.

Parameters
[in]handleA device handle identifying the oscilloscope.
Returns
The supported clock sources, a set of OR-ed TIEPIE_HW_CS_* values, or 0 when unsuccessful.
Status values
TIEPIE_HW_STATUS_INVALID_HANDLE The handle is not a valid oscilloscope handle.
TIEPIE_HW_STATUS_OBJECT_GONE
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED
TIEPIE_HW_STATUS_SUCCESS
See also
tiepie_hw_oscilloscope_get_clock_source
tiepie_hw_oscilloscope_set_clock_source
tiepie_hw_oscilloscope_get_clock_source_frequencies
tiepie_hw_oscilloscope_get_clock_source_frequency
tiepie_hw_oscilloscope_set_clock_source_frequency
Since
1.0

◆ tiepie_hw_oscilloscope_get_clock_source()

TIEPIE_HW_API uint32_t tiepie_hw_oscilloscope_get_clock_source ( tiepie_hw_handle  handle)

Get the currently selected clock source of the specified oscilloscope.

Parameters
[in]handleA device handle identifying the oscilloscope.
Returns
The current clock source, a TIEPIE_HW_CS_* value, or 0 when unsuccessful.
Status values
TIEPIE_HW_STATUS_INVALID_HANDLE The handle is not a valid oscilloscope handle.
TIEPIE_HW_STATUS_OBJECT_GONE
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED
TIEPIE_HW_STATUS_SUCCESS
See also
tiepie_hw_oscilloscope_get_clock_sources
tiepie_hw_oscilloscope_set_clock_source
tiepie_hw_oscilloscope_get_clock_source_frequencies
tiepie_hw_oscilloscope_get_clock_source_frequency
tiepie_hw_oscilloscope_set_clock_source_frequency
Since
1.0

◆ tiepie_hw_oscilloscope_set_clock_source()

TIEPIE_HW_API uint32_t tiepie_hw_oscilloscope_set_clock_source ( tiepie_hw_handle  handle,
uint32_t  value 
)

Set the clock source of the specified oscilloscope.

Parameters
[in]handleA device handle identifying the oscilloscope.
[in]valueThe requested clock source, a TIEPIE_HW_CS_* value.
Returns
The actually set clock source, a TIEPIE_HW_CS_* value, or 0 when unsuccessful.
Status values
TIEPIE_HW_STATUS_INVALID_VALUE
TIEPIE_HW_STATUS_INVALID_HANDLE The handle is not a valid oscilloscope handle.
TIEPIE_HW_STATUS_OBJECT_GONE
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED
TIEPIE_HW_STATUS_SUCCESS
See also
tiepie_hw_oscilloscope_get_clock_sources
tiepie_hw_oscilloscope_get_clock_source
tiepie_hw_oscilloscope_get_clock_source_frequencies
tiepie_hw_oscilloscope_get_clock_source_frequency
tiepie_hw_oscilloscope_set_clock_source_frequency
Since
1.0

◆ tiepie_hw_oscilloscope_get_clock_source_frequencies()

TIEPIE_HW_API uint32_t tiepie_hw_oscilloscope_get_clock_source_frequencies ( tiepie_hw_handle  handle,
double *  list,
uint32_t  length 
)

Get an array with the supported clock source frequencies of the specified oscilloscope.

The caller must assure that enough memory is allocated. This function is only available when the clock source is set to TIEPIE_HW_CS_EXTERNAL.

Parameters
[in]handleA device handle identifying the oscilloscope.
[out]listA pointer to an array for the clock source frequencies, or NULL.
[in]lengthThe number of elements in the array.
Returns
Total number of supported clock source frequencies, or 0 when unsuccessful.
Status values
TIEPIE_HW_STATUS_NOT_SUPPORTED The oscilloscope does not support external clock or the clock source is not set to TIEPIE_HW_CS_EXTERNAL.
TIEPIE_HW_STATUS_INVALID_HANDLE The handle is not a valid oscilloscope handle.
TIEPIE_HW_STATUS_OBJECT_GONE
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED
TIEPIE_HW_STATUS_SUCCESS
Example
uint32_t length = tiepie_hw_oscilloscope_get_clock_source_frequencies(h_device, NULL, 0);
double* Frequencies = malloc(sizeof(double) * Length);
Length = tiepie_hw_oscilloscope_get_clock_source_frequencies(h_device, Frequencies, Length);
for(i = 0 ; i < Length ; i++)
{
printf("%f\n", Frequencies[ i ]);
}
free(p_frequencies);
TIEPIE_HW_API uint32_t tiepie_hw_oscilloscope_get_clock_source_frequencies(tiepie_hw_handle handle, double *list, uint32_t length)
Get an array with the supported clock source frequencies of the specified oscilloscope.
See also
tiepie_hw_oscilloscope_get_clock_sources
tiepie_hw_oscilloscope_get_clock_source
tiepie_hw_oscilloscope_set_clock_source
tiepie_hw_oscilloscope_get_clock_source_frequency
tiepie_hw_oscilloscope_set_clock_source_frequency
Since
1.0

◆ tiepie_hw_oscilloscope_get_clock_source_frequency()

TIEPIE_HW_API double tiepie_hw_oscilloscope_get_clock_source_frequency ( tiepie_hw_handle  handle)

Get the current clock source frequency of the specified oscilloscope.

This function is only available when the clock source is set to TIEPIE_HW_CS_EXTERNAL.

Parameters
[in]handleA device handle identifying the oscilloscope.
Returns
The current clock source frequency in Hz, or 0 when unsuccessful.
Status values
TIEPIE_HW_STATUS_NOT_SUPPORTED The oscilloscope does not support external clock or the clock source is not set to TIEPIE_HW_CS_EXTERNAL.
TIEPIE_HW_STATUS_INVALID_HANDLE The handle is not a valid oscilloscope handle.
TIEPIE_HW_STATUS_OBJECT_GONE
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED
TIEPIE_HW_STATUS_SUCCESS
See also
tiepie_hw_oscilloscope_get_clock_sources
tiepie_hw_oscilloscope_get_clock_source
tiepie_hw_oscilloscope_set_clock_source
tiepie_hw_oscilloscope_get_clock_source_frequencies
tiepie_hw_oscilloscope_set_clock_source_frequency
Since
1.0

◆ tiepie_hw_oscilloscope_set_clock_source_frequency()

TIEPIE_HW_API double tiepie_hw_oscilloscope_set_clock_source_frequency ( tiepie_hw_handle  handle,
double  value 
)

Set the clock source frequency of the specified oscilloscope.

This function is only available when the clock source is set to TIEPIE_HW_CS_EXTERNAL.

Parameters
[in]handleA device handle identifying the oscilloscope.
[in]valueThe required clock source frequency in Hz.
Returns
The actually set clock source frequency in Hz, or 0 when unsuccessful.
Status values
TIEPIE_HW_STATUS_VALUE_CLIPPED The requested clock source frequency is outside the valid range and clipped to the closest limit.
TIEPIE_HW_STATUS_VALUE_MODIFIED The requested clock source frequency is within the valid range but not available. The closest valid value is set.
TIEPIE_HW_STATUS_INVALID_VALUE
TIEPIE_HW_STATUS_NOT_SUPPORTED The oscilloscope does not support external clock or the clock source is not set to TIEPIE_HW_CS_EXTERNAL.
TIEPIE_HW_STATUS_INVALID_HANDLE The handle is not a valid oscilloscope handle.
TIEPIE_HW_STATUS_OBJECT_GONE
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED
TIEPIE_HW_STATUS_SUCCESS
See also
tiepie_hw_oscilloscope_get_clock_sources
tiepie_hw_oscilloscope_get_clock_source
tiepie_hw_oscilloscope_set_clock_source
tiepie_hw_oscilloscope_get_clock_source_frequencies
tiepie_hw_oscilloscope_get_clock_source_frequency
Since
1.0