9 #if ( defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L ) || ( defined( __GNUC__ ) && defined( __cplusplus ) )
11 #elif defined( _MSC_VER )
17 typedef INT8_T int8_t;
18 typedef INT16_T int16_t;
19 typedef INT32_T int32_t;
20 typedef INT64_T int64_t;
22 typedef UINT8_T uint8_t;
23 typedef UINT16_T uint16_t;
24 typedef UINT32_T uint32_t;
25 typedef UINT64_T uint64_t;
29 #if defined( _WIN32 ) || defined( _WIN64 ) || defined( __WIN32__ ) || defined( __TOS_WIN__ ) || defined( __WINDOWS__ )
30 #ifndef HAVE_WINDOWS_H
31 #define HAVE_WINDOWS_H
65 #define CK_UNKNOWN 0x0000000000000000
67 #define CK_DCV ( 1 << CKB_DCV )
68 #define CK_ACV ( 1 << CKB_ACV )
69 #define CK_DCA ( 1 << CKB_DCA )
70 #define CK_ACA ( 1 << CKB_ACA )
71 #define CK_OHM ( 1 << CKB_OHM )
79 #define CKM_V ( CK_DCV | CK_ACV )
80 #define CKM_A ( CK_DCA | CK_ACA )
81 #define CKM_OHM ( CK_OHM )
83 #define CKM_ASYMMETRICRANGE ( CKM_OHM )
84 #define CKM_SYMMETRICRANGE ( CKM_V | CKM_A )
110 #define CO_SAMPLE ( 1 << COB_SAMPLE )
111 #define CO_10MHZ ( 1 << COB_10MHZ )
127 #define CSB_EXTERNAL 0
128 #define CSB_INTERNAL 1
136 #define CS_EXTERNAL ( 1 << CSB_EXTERNAL )
137 #define CS_INTERNAL ( 1 << CSB_INTERNAL )
153 #define FMB_SIGNALFREQUENCY 0
154 #define FMB_SAMPLEFREQUENCY 1
162 #define FM_UNKNOWN 0x00000000
164 #define FM_SIGNALFREQUENCY ( 1 << FMB_SIGNALFREQUENCY )
165 #define FM_SAMPLEFREQUENCY ( 1 << FMB_SAMPLEFREQUENCY )
190 #define MM_UNKNOWN 0x00000000
192 #define MM_STREAM ( 1 << MMB_STREAM )
193 #define MM_BLOCK ( 1 << MMB_BLOCK )
210 #define STB_TRIANGLE 1
214 #define STB_ARBITRARY 5
222 #define ST_UNKNOWN 0x0000000000000000
224 #define ST_SINE ( 1 << STB_SINE )
225 #define ST_TRIANGLE ( 1 << STB_TRIANGLE )
226 #define ST_SQUARE ( 1 << STB_SQUARE )
227 #define ST_DC ( 1 << STB_DC )
228 #define ST_NOISE ( 1 << STB_NOISE )
229 #define ST_ARBITRARY ( 1 << STB_ARBITRARY )
237 #define STM_AMPLITUDE ( ST_SINE | ST_TRIANGLE | ST_SQUARE | ST_NOISE | ST_ARBITRARY )
238 #define STM_OFFSET ( ST_SINE | ST_TRIANGLE | ST_SQUARE | ST_DC | ST_NOISE | ST_ARBITRARY )
239 #define STM_FREQUENCY ( ST_SINE | ST_TRIANGLE | ST_SQUARE | ST_ARBITRARY )
240 #define STM_PHASE ( ST_SINE | ST_TRIANGLE | ST_SQUARE | ST_ARBITRARY )
241 #define STM_SYMMETRY ( ST_SINE | ST_TRIANGLE | ST_SQUARE )
252 #define TH_ALLPRESAMPLES 0xffffffffffffffff
269 #define TKB_FALLING 1
270 #define TKB_INWINDOW 2
271 #define TKB_OUTWINDOW 3
273 #define TKB_DROPINWINDOW 5
274 #define TKB_DROPOUTWINDOW 6
282 #define TK_UNKNOWN 0x0000000000000000ULL
284 #define TK_RISING ( 1ULL << TKB_RISING )
285 #define TK_FALLING ( 1ULL << TKB_FALLING )
286 #define TK_INWINDOW ( 1ULL << TKB_INWINDOW )
287 #define TK_OUTWINDOW ( 1ULL << TKB_OUTWINDOW )
288 #define TK_EDGE ( 1ULL << TKB_EDGE )
289 #define TK_DROPINWINDOW ( 1ULL << TKB_DROPINWINDOW )
290 #define TK_DROPOUTWINDOW ( 1ULL << TKB_DROPOUTWINDOW )
298 #define TKM_NONE 0x0000000000000000ULL
299 #define TKM_EDGE ( TK_RISING | TK_FALLING | TK_EDGE )
300 #define TKM_WINDOW ( TK_INWINDOW | TK_OUTWINDOW | TK_DROPINWINDOW | TK_DROPOUTWINDOW )
301 #define TKM_ALL ( ( 1ULL << TKN_COUNT ) - 1 )
312 #define TO_INFINITY -1
323 #define TS_NONE 0x0000000000000000ULL
325 #define TS_CH1 0x0000000000000001ULL
326 #define TS_CH2 0x0000000000000002ULL
327 #define TS_CH3 0x0000000000000004ULL
328 #define TS_CH4 0x0000000000000008ULL
329 #define TS_CH5 0x0000000000000010ULL
330 #define TS_CH6 0x0000000000000020ULL
331 #define TS_CH7 0x0000000000000040ULL
332 #define TS_CH8 0x0000000000000080ULL
333 #define TS_CH9 0x0000000000000100ULL
334 #define TS_CH10 0x0000000000000200ULL
335 #define TS_CH11 0x0000000000000400ULL
336 #define TS_CH12 0x0000000000000800ULL
337 #define TS_CH13 0x0000000000001000ULL
338 #define TS_CH14 0x0000000000002000ULL
339 #define TS_CH15 0x0000000000004000ULL
340 #define TS_CH16 0x0000000000008000ULL
341 #define TS_CH17 0x0000000000010000ULL
342 #define TS_CH18 0x0000000000020000ULL
343 #define TS_CH19 0x0000000000040000ULL
344 #define TS_CH20 0x0000000000080000ULL
345 #define TS_CH21 0x0000000000100000ULL
346 #define TS_CH22 0x0000000000200000ULL
347 #define TS_CH23 0x0000000000400000ULL
348 #define TS_CH24 0x0000000000800000ULL
349 #define TS_CH25 0x0000000001000000ULL
350 #define TS_CH26 0x0000000002000000ULL
351 #define TS_CH27 0x0000000004000000ULL
352 #define TS_CH28 0x0000000008000000ULL
353 #define TS_CH29 0x0000000010000000ULL
354 #define TS_CH30 0x0000000020000000ULL
355 #define TS_CH31 0x0000000040000000ULL
356 #define TS_CH32 0x0000000080000000ULL
358 #define TS_GENSTOP 0x0400000000000000ULL
359 #define TS_GENNEW 0x0800000000000000ULL
360 #define TS_GENSTART 0x1000000000000000ULL
361 #define TS_EXT2 0x2000000000000000ULL
362 #define TS_EXTANALOG 0x4000000000000000ULL
363 #define TS_EXT 0x8000000000000000ULL
369 #define TSN_CHANNEL_COUNT 32
376 #define TSM_NONE 0x0000000000000000ULL
377 #define TSM_ALL 0xFFFFFFFFFFFFFFFFULL
378 #define TSM_CHANNELS ( ( 1ULL << TSN_CHANNEL_COUNT ) - 1 )
379 #define TSM_NONCHANNELS ( TSM_ALL - TSM_CHANNELS )
380 #define TSM_GENALL ( TS_GENSTART | TS_GENNEW | TS_GENSTOP )
483 #define TPDEVICEHANDLE_INVALID 0
491 #define DEVICETYPE_OSCILLOSCOPE 0x00000001
492 #define DEVICETYPE_GENERATOR 0x00000002
493 #define DEVICETYPE_I2CHOST 0x00000004
501 #define IDKIND_DEVICEID 0x00000001
502 #define IDKIND_INDEX 0x00000002
503 #define IDKIND_SERIALNUMBER 0x00000004
515 #define LIBTIEPIESTATUS_SUCCESS 0
516 #define LIBTIEPIESTATUS_VALUE_CLIPPED 1
517 #define LIBTIEPIESTATUS_VALUE_MODIFIED 2
518 #define LIBTIEPIESTATUS_UNSUCCESSFUL -1
519 #define LIBTIEPIESTATUS_NOT_SUPPORTED -2
520 #define LIBTIEPIESTATUS_INVALID_HANDLE -3
521 #define LIBTIEPIESTATUS_INVALID_VALUE -4
522 #define LIBTIEPIESTATUS_INVALID_CHANNEL -5
523 #define LIBTIEPIESTATUS_INVALID_TRIGGER_SOURCE -6
524 #define LIBTIEPIESTATUS_INVALID_DEVICE_TYPE -7
525 #define LIBTIEPIESTATUS_INVALID_DEVICE_INDEX -8
526 #define LIBTIEPIESTATUS_INVALID_DEVICE_ID -9
527 #define LIBTIEPIESTATUS_INVALID_DEVICE_SERIALNUMBER -10
528 #define LIBTIEPIESTATUS_DEVICE_GONE -11
529 #define LIBTIEPIESTATUS_INTERNAL_ADDRESS -12
530 #define LIBTIEPIESTATUS_NOT_CONTROLLABLE -13
531 #define LIBTIEPIESTATUS_BIT_ERROR -14
532 #define LIBTIEPIESTATUS_NO_ACKNOWLEDGE -15
540 #define CONNECTORTYPE_UNKNOWN 0x00000000
542 #define CONNECTORTYPE_BNC 0x00000001
543 #define CONNECTORTYPE_BANANA 0x00000002
544 #define CONNECTORTYPE_POWERPLUG 0x00000004
546 #define CONNECTORTYPE_MASK ( CONNECTORTYPE_BNC | CONNECTORTYPE_BANANA | CONNECTORTYPE_POWERPLUG )
554 #define DATARAWTYPE_UNKNOWN 0x00000000
556 #define DATARAWTYPE_INT8 0x00000001
557 #define DATARAWTYPE_INT16 0x00000002
558 #define DATARAWTYPE_INT32 0x00000004
559 #define DATARAWTYPE_INT64 0x00000008
561 #define DATARAWTYPE_UINT8 0x00000010
562 #define DATARAWTYPE_UINT16 0x00000020
563 #define DATARAWTYPE_UINT32 0x00000040
564 #define DATARAWTYPE_UINT64 0x00000080
566 #define DATARAWTYPE_FLOAT32 0x00000100
567 #define DATARAWTYPE_FLOAT64 0x00000200
575 #define IDM_DEVICEID 0x80000000
576 #define IDM_ALL 0xffffffff
599 #define ID_HS3 ( IDM_DEVICEID | ( 1 << IDB_HS3 ) )
600 #define ID_HS4 ( IDM_DEVICEID | ( 1 << IDB_HS4 ) )
601 #define ID_HS4D ( IDM_DEVICEID | ( 1 << IDB_HS4D ) )
602 #define ID_HS805 ( IDM_DEVICEID | ( 1 << IDB_HS805 ) )
603 #define ID_HP3 ( IDM_DEVICEID | ( 1 << IDB_HP3 ) )
604 #define ID_HS5 ( IDM_DEVICEID | ( 1 << IDB_HS5 ) )
605 #define ID_HL0516 ( IDM_DEVICEID | ( 1 << IDB_HL0516 ) )
606 #define ID_PA1 ( IDM_DEVICEID | ( 1 << IDB_PA1 ) )
614 #define BOOL8_FALSE 0
623 #define LIBTIEPIE_TRISTATE_UNDEFINED 0
624 #define LIBTIEPIE_TRISTATE_FALSE 1
625 #define LIBTIEPIE_TRISTATE_TRUE 2
647 #define TPVERSION_MAJOR( x ) ( x >> 48 )
648 #define TPVERSION_MINOR( x ) ( ( x >> 32 ) & 0xffff )
649 #define TPVERSION_RELEASE( x ) ( ( x >> 16 ) & 0xffff )
650 #define TPVERSION_BUILD( x ) ( x & 0xffff )
652 #define TPDATE_YEAR( x ) ( x >> 16 )
653 #define TPDATE_MONTH( x ) ( ( x >> 8 ) & 0xff )
654 #define TPDATE_DAY( x ) ( x & 0xff )
660 #ifdef HAVE_WINDOWS_H
667 #define WM_LIBTIEPIE ( WM_USER + 1337 )
669 #define WM_LIBTIEPIE_LST_DEVICEADDED ( WM_LIBTIEPIE + 2 )
670 #define WM_LIBTIEPIE_LST_DEVICEREMOVED ( WM_LIBTIEPIE + 3 )
672 #define WM_LIBTIEPIE_DEV_REMOVED ( WM_LIBTIEPIE + 4 )
674 #define WM_LIBTIEPIE_SCP_DATAREADY ( WM_LIBTIEPIE + 0 )
675 #define WM_LIBTIEPIE_SCP_DATAOVERFLOW ( WM_LIBTIEPIE + 1 )
676 #define WM_LIBTIEPIE_SCP_CONNECTIONTESTCOMPLETED ( WM_LIBTIEPIE + 7 )
678 #define WM_LIBTIEPIE_GEN_BURSTCOMPLETED ( WM_LIBTIEPIE + 5 )
679 #define WM_LIBTIEPIE_GEN_CONTROLLABLECHANGED ( WM_LIBTIEPIE + 6 )
733 uint32_t
LibGetConfig( uint8_t* pBuffer , uint32_t dwBufferLength );
823 uint32_t
LstGetDeviceName( uint32_t dwIdKind , uint32_t dwId ,
char* pBuffer , uint32_t dwBufferLength );
844 uint32_t
LstGetDeviceNameShort( uint32_t dwIdKind , uint32_t dwId ,
char* pBuffer , uint32_t dwBufferLength );
891 TpDeviceHandle_t
LstOpenDevice( uint32_t dwIdKind , uint32_t dwId , uint32_t dwDeviceType );
929 TpDeviceHandle_t
LstOpenI2CHost( uint32_t dwIdKind , uint32_t dwId );
953 void LstUpdate( uint32_t dwDeviceIdMask );
978 #ifdef HAVE_WINDOWS_H
1036 void DevClose( TpDeviceHandle_t hDevice );
1132 uint32_t
DevGetType( TpDeviceHandle_t hDevice );
1152 uint32_t
DevGetName( TpDeviceHandle_t hDevice ,
char* pBuffer , uint32_t dwBufferLength );
1172 uint32_t
DevGetNameShort( TpDeviceHandle_t hDevice ,
char* pBuffer , uint32_t dwBufferLength );
1190 #ifdef HAVE_WINDOWS_H
1210 void DevSetMessageRemoved( TpDeviceHandle_t hDevice , HWND hWnd , WPARAM wParam , LPARAM lParam );
1252 uint32_t
ScpGetSharedChannelGroup( TpDeviceHandle_t hDevice , uint32_t dwGroupIndex , uint16_t* pChannelNumbers , uint32_t dwLength );
1308 uint64_t
ScpChSetCoupling( TpDeviceHandle_t hDevice , uint16_t wCh , uint64_t qwCoupling );
1327 bool8_t
ScpChSetEnabled( TpDeviceHandle_t hDevice , uint16_t wCh , bool8_t bEnable );
1355 double ScpChSetProbeGain( TpDeviceHandle_t hDevice , uint16_t wCh ,
double dProbeGain );
1378 uint32_t
ScpChGetRanges( TpDeviceHandle_t hDevice , uint16_t wCh ,
double* pList , uint32_t dwLength );
1391 uint32_t
ScpChGetRangesEx( TpDeviceHandle_t hDevice , uint16_t wCh , uint64_t qwCoupling ,
double* pList , uint32_t dwLength );
1400 double ScpChGetRange( TpDeviceHandle_t hDevice , uint16_t wCh );
1419 double ScpChSetRange( TpDeviceHandle_t hDevice , uint16_t wCh ,
double dRange );
1439 uint64_t
ScpGetData( TpDeviceHandle_t hDevice ,
float** pBuffers , uint16_t wChannelCount , uint64_t qwStartIndex , uint64_t qwSampleCount );
1450 uint64_t
ScpGetData1Ch( TpDeviceHandle_t hDevice ,
float* pBufferCh1 , uint64_t qwStartIndex , uint64_t qwSampleCount );
1462 uint64_t
ScpGetData2Ch( TpDeviceHandle_t hDevice ,
float* pBufferCh1 ,
float* pBufferCh2 , uint64_t qwStartIndex , uint64_t qwSampleCount );
1475 uint64_t
ScpGetData3Ch( TpDeviceHandle_t hDevice ,
float *pBufferCh1 ,
float* pBufferCh2 ,
float* pBufferCh3 , uint64_t qwStartIndex , uint64_t qwSampleCount );
1489 uint64_t
ScpGetData4Ch( TpDeviceHandle_t hDevice ,
float* pBufferCh1 ,
float* pBufferCh2 ,
float* pBufferCh3 ,
float* pBufferCh4 , uint64_t qwStartIndex , uint64_t qwSampleCount );
1501 uint64_t
ScpGetDataRaw( TpDeviceHandle_t hDevice ,
void** pBuffers , uint16_t wChannelCount , uint64_t qwStartIndex , uint64_t qwSampleCount );
1512 uint64_t
ScpGetDataRaw1Ch( TpDeviceHandle_t hDevice ,
void* pBufferCh1 , uint64_t qwStartIndex , uint64_t qwSampleCount );
1524 uint64_t
ScpGetDataRaw2Ch( TpDeviceHandle_t hDevice ,
void* pBufferCh1 ,
void* pBufferCh2 , uint64_t qwStartIndex , uint64_t qwSampleCount );
1537 uint64_t
ScpGetDataRaw3Ch( TpDeviceHandle_t hDevice ,
void* pBufferCh1 ,
void* pBufferCh2 ,
void* pBufferCh3 , uint64_t qwStartIndex , uint64_t qwSampleCount );
1551 uint64_t
ScpGetDataRaw4Ch( TpDeviceHandle_t hDevice ,
void* pBufferCh1 ,
void* pBufferCh2 ,
void* pBufferCh3 ,
void* pBufferCh4 , uint64_t qwStartIndex , uint64_t qwSampleCount );
1625 void ScpChGetDataRawValueRange( TpDeviceHandle_t hDevice , uint16_t wCh , int64_t* pMin , int64_t* pZero , int64_t* pMax );
1698 #ifdef HAVE_WINDOWS_H
1776 bool8_t
ScpStart( TpDeviceHandle_t hDevice );
1783 void ScpStop( TpDeviceHandle_t hDevice );
1847 uint32_t
ScpSetMeasureMode( TpDeviceHandle_t hDevice , uint32_t dwMeasureMode );
1865 uint32_t
ScpGetResolutions( TpDeviceHandle_t hDevice , uint8_t *pList , uint32_t dwLength );
1882 uint8_t
ScpSetResolution( TpDeviceHandle_t hDevice , uint8_t byResolution );
1932 uint32_t
ScpSetClockSource( TpDeviceHandle_t hDevice , uint32_t dwClockSource );
1957 uint32_t
ScpSetClockOutput( TpDeviceHandle_t hDevice , uint32_t dwClockOutput );
2072 uint64_t
ScpVerifyRecordLengthEx( TpDeviceHandle_t hDevice , uint64_t qwRecordLength , uint32_t dwMeasureMode , uint8_t byResolution , uint64_t qwActiveChannelMask );
2118 double ScpVerifySampleFrequencyEx( TpDeviceHandle_t hDevice ,
double dSampleFrequency , uint32_t dwMeasureMode , uint8_t byResolution , uint64_t qwActiveChannelMask );
2215 uint64_t
ScpGetTriggerKinds( TpDeviceHandle_t hDevice , uint64_t qwTriggerSourceMask );
2228 uint64_t
ScpGetTriggerKindsEx( TpDeviceHandle_t hDevice , uint64_t qwTriggerSourceMask , uint32_t dwMeasureMode );
2237 uint64_t
ScpGetTriggerKind( TpDeviceHandle_t hDevice , uint64_t qwTriggerSource );
2248 uint64_t
ScpSetTriggerKind( TpDeviceHandle_t hDevice , uint64_t qwTriggerSource , uint64_t qwTriggerKind );
2258 double ScpGetTriggerLevel( TpDeviceHandle_t hDevice , uint64_t qwTriggerSource , uint32_t dwIndex );
2269 double ScpSetTriggerLevel( TpDeviceHandle_t hDevice , uint64_t qwTriggerSource , uint32_t dwIndex ,
double dLevel );
2290 double ScpSetTriggerHysteresis( TpDeviceHandle_t hDevice , uint64_t qwTriggerSource , uint32_t dwIndex ,
double dHysteresis );
2328 uint64_t
ScpChSetTriggerKind( TpDeviceHandle_t hDevice , uint16_t wCh , uint64_t qwTriggerKind );
2349 double ScpChSetTriggerLevel( TpDeviceHandle_t hDevice , uint16_t wCh , uint32_t dwIndex ,
double dLevel );
2441 uint16_t
ScpGetConnectionTestData( TpDeviceHandle_t hDevice , LibTiePieTriState_t* pBuffer , uint16_t wChannelCount );
2509 bool8_t
GenSetOutputOn( TpDeviceHandle_t hDevice , bool8_t bOutputOn );
2516 void GenStart( TpDeviceHandle_t hDevice );
2523 void GenStop( TpDeviceHandle_t hDevice );
2556 uint64_t
GenSetBurstCount( TpDeviceHandle_t hDevice , uint64_t qwBurstCount );
2573 uint32_t
GenGetModesEx( TpDeviceHandle_t hDevice , uint32_t dwSignalType );
2581 uint32_t
GenGetMode( TpDeviceHandle_t hDevice );
2590 uint32_t
GenSetMode( TpDeviceHandle_t hDevice , uint32_t dwMode );
2615 uint32_t
GenSetSignalType( TpDeviceHandle_t hDevice , uint32_t dwSignalType );
2648 double GenSetAmplitude( TpDeviceHandle_t hDevice ,
double dAmplitude );
2667 void GenGetFrequencyMinMax( TpDeviceHandle_t hDevice , uint32_t dwMode ,
double* pMin ,
double* pMax );
2700 double GenSetFrequency( TpDeviceHandle_t hDevice ,
double dFrequency );
2752 double GenSetOffset( TpDeviceHandle_t hDevice ,
double dOffset );
2778 double GenSetPhase( TpDeviceHandle_t hDevice ,
double dPhase );
2787 double GenVerifyPhase( TpDeviceHandle_t hDevice ,
double dPhase );
2804 double GenSetSymmetry( TpDeviceHandle_t hDevice ,
double dSymmetry );
2841 #ifdef HAVE_WINDOWS_H
2930 uint32_t
GenGetRanges( TpDeviceHandle_t hDevice ,
double* pList , uint32_t dwLength );
2956 double GenSetRange( TpDeviceHandle_t hDevice ,
double dRange );
3056 void GenSetData( TpDeviceHandle_t hDevice ,
float* pBuffer , uint64_t qwSampleCount );
3065 void GenSetDataRaw( TpDeviceHandle_t hDevice ,
void* pBuffer , uint64_t qwSampleCount );
3086 bool8_t
I2CRead( TpDeviceHandle_t hDevice , uint16_t wAddress ,
void* pBuffer , uint32_t dwSize , bool8_t bStop );
3096 bool8_t
I2CReadByte( TpDeviceHandle_t hDevice , uint16_t wAddress , uint8_t* pValue );
3106 bool8_t
I2CReadWord( TpDeviceHandle_t hDevice , uint16_t wAddress , uint16_t* pValue );
3118 bool8_t
I2CWrite( TpDeviceHandle_t hDevice , uint16_t wAddress ,
void* pBuffer , uint32_t dwSize , bool8_t bStop );
3128 bool8_t
I2CWriteByte( TpDeviceHandle_t hDevice , uint16_t wAddress , uint8_t byValue );
3139 bool8_t
I2CWriteByteByte( TpDeviceHandle_t hDevice , uint16_t wAddress , uint8_t byValue1 , uint8_t byValue2 );
3150 bool8_t
I2CWriteByteWord( TpDeviceHandle_t hDevice , uint16_t wAddress , uint8_t byValue1 , uint16_t wValue2 );
3160 bool8_t
I2CWriteWord( TpDeviceHandle_t hDevice , uint16_t wAddress , uint16_t wValue );
3185 double I2CSetSpeed( TpDeviceHandle_t hDevice ,
double dSpeed );
3194 double I2CVerifySpeed( TpDeviceHandle_t hDevice ,
double dSpeed );