libtiepie-hw 1.3.3
Loading...
Searching...
No Matches
Pointer array

Functions for handling arrays of pointers. More...

Collaboration diagram for Pointer array:

Functions

TIEPIE_HW_API tiepie_hw_pointerarray tiepie_hw_pointerarray_new (uint32_t length)
 Create a new pointer array.
 
TIEPIE_HW_API void tiepie_hw_pointerarray_set (tiepie_hw_pointerarray ptr, uint32_t index, void *value)
 Set a pointer at a specified index in a specified pointer array.
 
TIEPIE_HW_API void tiepie_hw_pointerarray_delete (tiepie_hw_pointerarray ptr)
 Delete an existing pointer array.
 

Detailed Description

Functions for handling arrays of pointers.

The function tiepie_hw_oscilloscope_get_data() uses a pointer to a buffer with pointers to buffers for the channel data. Not all programming/scripting languages can handle pointers to pointers properly. These functions can then be used to work around that issue.

Example
In pseudocode:
buffers = empty list/array
pointer_array = tiepie_hw_pointerarray_new(channel_count)
for i = 0 to channel_count - 1
buffers[ i ] = allocate buffer/array
tiepie_hw_pointerarray_set(pointer_array, i, pointer of buffers[ i ])
end
end
tiepie_hw_oscilloscope_get_data(handle, pointer_array, channel_count, ...)
TIEPIE_HW_API void tiepie_hw_pointerarray_set(tiepie_hw_pointerarray ptr, uint32_t index, void *value)
Set a pointer at a specified index in a specified pointer array.
TIEPIE_HW_API void tiepie_hw_pointerarray_delete(tiepie_hw_pointerarray ptr)
Delete an existing pointer array.
TIEPIE_HW_API tiepie_hw_pointerarray tiepie_hw_pointerarray_new(uint32_t length)
Create a new pointer array.
TIEPIE_HW_API tiepie_hw_bool tiepie_hw_oscilloscope_channel_get_enabled(tiepie_hw_handle handle, uint16_t ch)
Check whether a specified channel is currently enabled.
TIEPIE_HW_API uint64_t tiepie_hw_oscilloscope_get_data(tiepie_hw_handle handle, float **buffers, uint16_t channel_count, uint64_t start_index, uint64_t sample_count)
Get the measurement data for specified channels.
The data is now available in buffers.
See also
tiepie_hw_oscilloscope_get_data

Function Documentation

◆ tiepie_hw_pointerarray_new()

TIEPIE_HW_API tiepie_hw_pointerarray tiepie_hw_pointerarray_new ( uint32_t  length)

Create a new pointer array.

The pointer array is initialized with NULL pointers.

Parameters
[in]lengthThe requested length of the pointer array, 1 .. TIEPIE_HW_POINTER_ARRAY_MAX_LENGTH.
Returns
A pointer to the pointer array.
Status values
TIEPIE_HW_STATUS_INVALID_VALUE The requested length is invalid.
TIEPIE_HW_STATUS_UNSUCCESSFUL
TIEPIE_HW_STATUS_SUCCESS
Since
1.0

◆ tiepie_hw_pointerarray_set()

TIEPIE_HW_API void tiepie_hw_pointerarray_set ( tiepie_hw_pointerarray  ptr,
uint32_t  index,
void *  value 
)

Set a pointer at a specified index in a specified pointer array.

Parameters
[in]ptrA pointer identifying the pointer array.
[in]indexThe requested array index.
[in]valueThe pointer value to set.
Status values
TIEPIE_HW_STATUS_UNSUCCESSFUL The pointer to the array is invalid.
TIEPIE_HW_STATUS_SUCCESS
Since
1.0

◆ tiepie_hw_pointerarray_delete()

TIEPIE_HW_API void tiepie_hw_pointerarray_delete ( tiepie_hw_pointerarray  ptr)

Delete an existing pointer array.

Parameters
[in]ptrA pointer identifying the pointer array.
Status values
TIEPIE_HW_STATUS_SUCCESS
Since
1.0