00001 00006 #ifndef _LIBTIEPIE_H_ 00007 #define _LIBTIEPIE_H_ 00008 00009 #include <stdint.h> 00010 00011 #ifdef __cplusplus 00012 extern "C" 00013 { 00014 #endif 00015 00023 #define CM_INTERNAL 0 00024 #define CM_EXTERNAL 1 00025 00026 00033 #define CTN_COUPLING_COUNT 5 00034 00035 00040 #define CTB_DCV 0 00041 #define CTB_ACV 1 00042 #define CTB_DCA 2 00043 #define CTB_ACA 3 00044 #define CTB_OHM 4 00045 00046 00052 #define CT_UNKNOWN 0x0000000000000000 00053 00054 #define CT_DCV ( 1 << CTB_DCV ) 00055 #define CT_ACV ( 1 << CTB_ACV ) 00056 #define CT_DCA ( 1 << CTB_DCA ) 00057 #define CT_ACA ( 1 << CTB_ACA ) 00058 #define CT_OHM ( 1 << CTB_OHM ) 00059 00060 00066 #define CTM_V ( CT_DCV | CT_ACV ) 00067 #define CTM_A ( CT_DCA | CT_ACA ) 00068 #define CTM_OHM ( CT_OHM ) 00069 00070 00079 #define FM_UNKNOWN 0x00000000 00080 #define FM_DDS 0x00000001 00081 #define FM_LINEAR 0x00000002 00082 00083 00090 #define MMN_MEASUREMODE_COUNT 2 00091 00092 00097 #define MM_BLOCK 0 00098 #define MM_STREAM 1 00099 00100 00107 #define STN_TYPE_COUNT 6 00108 00109 00114 #define ST_UNKNOWN 0x0000000000000000 00115 00116 #define ST_SINE 0x0000000000000001 00117 #define ST_TRIANGLE 0x0000000000000002 00118 #define ST_SQUARE 0x0000000000000004 00119 #define ST_DC 0x0000000000000008 00120 #define ST_NOISE 0x0000000000000010 00121 #define ST_ARBITRARY 0x0000000000000020 00122 00123 00130 #define TKN_KIND_COUNT 4 00131 00132 00137 #define TK_UNKNOWN 0x0000000000000000 00138 00139 #define TK_RISING 0x0000000000000001 00140 #define TK_FALLING 0x0000000000000002 00141 #define TK_INWINDOW 0x0000000000000004 00142 #define TK_OUTWINDOW 0x0000000000000008 00143 00144 00153 #define TO_INFINITY -1 00154 00155 00164 #define TS_NONE 0x0000000000000000ULL 00165 00166 #define TS_CH1 0x0000000000000001ULL 00167 #define TS_CH2 0x0000000000000002ULL 00168 #define TS_CH3 0x0000000000000004ULL 00169 #define TS_CH4 0x0000000000000008ULL 00170 #define TS_CH5 0x0000000000000010ULL 00171 #define TS_CH6 0x0000000000000020ULL 00172 #define TS_CH7 0x0000000000000040ULL 00173 #define TS_CH8 0x0000000000000080ULL 00174 #define TS_CH9 0x0000000000000100ULL 00175 #define TS_CH10 0x0000000000000200ULL 00176 #define TS_CH11 0x0000000000000400ULL 00177 #define TS_CH12 0x0000000000000800ULL 00178 #define TS_CH13 0x0000000000001000ULL 00179 #define TS_CH14 0x0000000000002000ULL 00180 #define TS_CH15 0x0000000000004000ULL 00181 #define TS_CH16 0x0000000000008000ULL 00182 #define TS_CH17 0x0000000000010000ULL 00183 #define TS_CH18 0x0000000000020000ULL 00184 #define TS_CH19 0x0000000000040000ULL 00185 #define TS_CH20 0x0000000000080000ULL 00186 #define TS_CH21 0x0000000000100000ULL 00187 #define TS_CH22 0x0000000000200000ULL 00188 #define TS_CH23 0x0000000000400000ULL 00189 #define TS_CH24 0x0000000000800000ULL 00190 #define TS_CH25 0x0000000001000000ULL 00191 #define TS_CH26 0x0000000002000000ULL 00192 #define TS_CH27 0x0000000004000000ULL 00193 #define TS_CH28 0x0000000008000000ULL 00194 #define TS_CH29 0x0000000010000000ULL 00195 #define TS_CH30 0x0000000020000000ULL 00196 #define TS_CH31 0x0000000040000000ULL 00197 #define TS_CH32 0x0000000080000000ULL 00198 00199 #define TS_GENSTOP 0x0400000000000000ULL 00200 #define TS_GENNEW 0x0800000000000000ULL 00201 #define TS_GENSTART 0x1000000000000000ULL 00202 #define TS_EXT2 0x2000000000000000ULL 00203 #define TS_EXTANALOG 0x4000000000000000ULL 00204 #define TS_EXT 0x8000000000000000ULL 00205 00206 00210 #define TSN_CHANNEL_COUNT 32 00211 00212 00217 #define TSM_NONE 0x0000000000000000ULL 00218 #define TSM_ALL 0xFFFFFFFFFFFFFFFFULL 00219 #define TSM_CHANNELS ( ( 1ULL << TSN_CHANNEL_COUNT ) - 1 ) 00220 #define TSM_NONCHANNELS ( TSM_ALL - TSM_CHANNELS ) 00221 #define TSM_GENALL ( TS_GENSTART | TS_GENNEW | TS_GENSTOP ) 00222 00223 00232 #define TPDEVICEHANDLE_INVALID 0 00233 00234 00244 #define LIBTIEPIESTATUS_SUCCESS 0 00245 #define LIBTIEPIESTATUS_VALUE_CLIPPED 1 00246 #define LIBTIEPIESTATUS_VALUE_MODIFIED 2 00247 #define LIBTIEPIESTATUS_UNSUCCESSFUL -1 00248 #define LIBTIEPIESTATUS_NOT_SUPPORTED -2 00249 #define LIBTIEPIESTATUS_INVALID_HANDLE -3 00250 #define LIBTIEPIESTATUS_INVALID_VALUE -4 00251 #define LIBTIEPIESTATUS_INVALID_CHANNEL -5 00252 #define LIBTIEPIESTATUS_INVALID_TRIGGER_SOURCE -6 00253 00254 00260 #define ID_HS3 0x2001 00261 #define ID_HS4 0x2002 00262 #define ID_HS4D 0x2003 00263 00264 00271 typedef int32_t LibTiePieStatus_t; 00272 typedef uint32_t TpDeviceHandle_t; 00273 typedef uint64_t TpVersion_t; 00274 typedef uint32_t TpDate_t; 00275 typedef uint8_t bool8_t; 00276 00288 void UpdateDeviceLists(); 00289 00296 TpDeviceHandle_t OpenGenerator( uint32_t dwId ); 00297 00303 uint32_t GetGeneratorCount(); 00304 00311 TpDeviceHandle_t OpenOscilloscope( uint32_t dwId ); 00312 00318 uint32_t GetOscilloscopeCount(); 00319 00325 void CloseDevice( TpDeviceHandle_t hDevice ); 00326 00337 TpVersion_t GetVersion(); 00338 00345 LibTiePieStatus_t GetLastStatus(); 00346 00357 TpDate_t GetCalibrationDate( TpDeviceHandle_t hDevice ); 00358 00365 uint32_t GetSerialNumber( TpDeviceHandle_t hDevice ); 00366 00381 uint16_t ScpGetChannelCount( TpDeviceHandle_t hDevice ); 00382 00390 bool8_t ScpChGetAutoRanging( TpDeviceHandle_t hDevice , uint16_t wCh ); 00391 00400 bool8_t ScpChSetAutoRanging( TpDeviceHandle_t hDevice , uint16_t wCh , bool8_t bEnable ); 00401 00410 uint64_t ScpChGetCouplings( TpDeviceHandle_t hDevice , uint16_t wCh ); 00411 00420 uint64_t ScpChGetCoupling( TpDeviceHandle_t hDevice , uint16_t wCh ); 00421 00431 uint64_t ScpChSetCoupling( TpDeviceHandle_t hDevice , uint16_t wCh , uint64_t qwCoupling ); 00432 00440 bool8_t ScpChGetEnabled( TpDeviceHandle_t hDevice , uint16_t wCh ); 00441 00451 bool8_t ScpChSetEnabled( TpDeviceHandle_t hDevice , uint16_t wCh , bool8_t bEnable ); 00452 00460 double ScpChGetProbeGain( TpDeviceHandle_t hDevice , uint16_t wCh ); 00461 00470 double ScpChSetProbeGain( TpDeviceHandle_t hDevice , uint16_t wCh , double dProbeGain ); 00471 00481 uint32_t ScpChGetRanges( TpDeviceHandle_t hDevice , uint16_t wCh , double *pList , uint32_t dwLength ); 00482 00490 double ScpChGetRange( TpDeviceHandle_t hDevice , uint16_t wCh ); 00491 00500 double ScpChSetRange( TpDeviceHandle_t hDevice , uint16_t wCh , double dRange ); 00501 00515 void ScpStart( TpDeviceHandle_t hDevice , int64_t iMeasurmentCount ); 00516 00524 void ScpStop( TpDeviceHandle_t hDevice , int64_t iMeasurmentCount ); 00525 00531 void ScpForceTrigger( TpDeviceHandle_t hDevice ); 00532 00539 bool8_t ScpIsReady( TpDeviceHandle_t hDevice ); 00540 00547 bool8_t ScpIsRunning( TpDeviceHandle_t hDevice ); 00548 00555 bool8_t ScpIsTriggered( TpDeviceHandle_t hDevice ); 00556 00563 uint32_t ScpGetMeasureMode( TpDeviceHandle_t hDevice ); 00564 00573 uint32_t ScpSetMeasureMode( TpDeviceHandle_t hDevice , uint32_t dwMeasureMode ); 00574 00582 double ScpChGetDataValueMin( TpDeviceHandle_t hDevice , uint16_t wCh ); 00583 00591 double ScpChGetDataValueMax( TpDeviceHandle_t hDevice , uint16_t wCh ); 00592 00602 uint64_t ScpChGetData( TpDeviceHandle_t hDevice , uint16_t wCh , float *pBuffer , uint64_t qwSampleCount ); 00603 00613 uint64_t ScpChGetDataRaw8( TpDeviceHandle_t hDevice , uint16_t wCh , uint8_t *pBuffer , uint64_t qwSampleCount ); 00614 00625 uint64_t ScpChGetDataRaw16( TpDeviceHandle_t hDevice , uint16_t wCh , uint16_t *pBuffer , uint64_t qwSampleCount ); 00626 00641 uint32_t ScpGetResolutions( TpDeviceHandle_t hDevice , uint8_t *pList , uint32_t dwLength ); 00642 00649 uint8_t ScpGetResolution( TpDeviceHandle_t hDevice ); 00650 00659 uint8_t ScpSetResolution( TpDeviceHandle_t hDevice , uint8_t byResolution ); 00660 00674 uint32_t ScpGetClockSource( TpDeviceHandle_t hDevice ); 00675 00685 uint32_t ScpSetClockSource( TpDeviceHandle_t hDevice , uint32_t dwClockSource ); 00686 00693 uint64_t ScpGetPreSampleCount( TpDeviceHandle_t hDevice ); 00694 00702 uint64_t ScpSetPreSampleCount( TpDeviceHandle_t hDevice , uint64_t qwPreSampleCount ); 00703 00710 uint64_t ScpGetRecordLengthMax( TpDeviceHandle_t hDevice ); 00711 00718 uint64_t ScpGetRecordLength( TpDeviceHandle_t hDevice ); 00719 00727 uint64_t ScpSetRecordLength( TpDeviceHandle_t hDevice , uint64_t qwRecordLength ); 00728 00735 double ScpGetSampleFrequencyMax( TpDeviceHandle_t hDevice ); 00736 00743 double ScpGetSampleFrequency( TpDeviceHandle_t hDevice ); 00744 00752 double ScpSetSampleFrequency( TpDeviceHandle_t hDevice , double dSampleFrequency ); 00753 00767 double ScpGetTriggerTimeOut( TpDeviceHandle_t hDevice ); 00768 00778 double ScpSetTriggerTimeOut( TpDeviceHandle_t hDevice , double dTimeout ); 00779 00787 uint64_t ScpGetTriggerSources( TpDeviceHandle_t hDevice ); 00788 00796 uint64_t ScpGetTriggerSourceOR( TpDeviceHandle_t hDevice ); 00797 00806 uint64_t ScpSetTriggerSourceOR( TpDeviceHandle_t hDevice , uint64_t qwTriggerSourceMask ); 00807 00815 uint64_t ScpGetTriggerSourceAND( TpDeviceHandle_t hDevice ); 00816 00825 uint64_t ScpSetTriggerSourceAND( TpDeviceHandle_t hDevice , uint64_t qwTriggerSourceMask ); 00826 00838 uint64_t ScpGetTriggerKinds( TpDeviceHandle_t hDevice , uint64_t qwTriggerSourceMask ); 00839 00848 uint64_t ScpGetTriggerKind( TpDeviceHandle_t hDevice , uint64_t qwTriggerSource ); 00849 00859 uint64_t ScpSetTriggerKind( TpDeviceHandle_t hDevice , uint64_t qwTriggerSource , uint64_t qwTriggerKind ); 00860 00868 double ScpGetTriggerLevel( TpDeviceHandle_t hDevice , uint64_t qwTriggerSource ); 00869 00878 double ScpSetTriggerLevel( TpDeviceHandle_t hDevice , uint64_t qwTriggerSource , double dLevel ); 00879 00887 double ScpGetTriggerHysteresis( TpDeviceHandle_t hDevice , uint64_t qwTriggerSource ); 00888 00897 double ScpSetTriggerHysteresis( TpDeviceHandle_t hDevice , uint64_t qwTriggerSource , double dHysteresis ); 00898 00907 uint64_t ScpChGetTriggerKinds( TpDeviceHandle_t hDevice , uint16_t wCh ); 00908 00917 uint64_t ScpChGetTriggerKind( TpDeviceHandle_t hDevice , uint16_t wCh ); 00918 00928 uint64_t ScpChSetTriggerKind( TpDeviceHandle_t hDevice , uint16_t wCh , uint64_t qwTriggerKind ); 00929 00937 double ScpChGetTriggerLevel( TpDeviceHandle_t hDevice , uint16_t wCh ); 00938 00947 double ScpChSetTriggerLevel( TpDeviceHandle_t hDevice , uint16_t wCh , double dLevel ); 00948 00956 double ScpChGetTriggerHysteresis( TpDeviceHandle_t hDevice , uint16_t wCh ); 00957 00966 double ScpChSetTriggerHysteresis( TpDeviceHandle_t hDevice , uint16_t wCh , double dHysteresis ); 00967 00983 bool8_t GenGetOutputOn( TpDeviceHandle_t hDevice ); 00984 00992 bool8_t GenSetOutputOn( TpDeviceHandle_t hDevice , bool8_t bOutputOn ); 00993 01000 void GenStart( TpDeviceHandle_t hDevice , int64_t iBurstCount ); 01001 01007 void GenStop( TpDeviceHandle_t hDevice ); 01008 01016 uint32_t GenGetMode( TpDeviceHandle_t hDevice ); 01017 01027 uint32_t GenSetMode( TpDeviceHandle_t hDevice , uint32_t dwMode ); 01028 01036 uint32_t GenGetSignalTypes( TpDeviceHandle_t hDevice ); 01037 01045 uint32_t GenGetSignalType( TpDeviceHandle_t hDevice ); 01046 01055 uint32_t GenSetSignalType( TpDeviceHandle_t hDevice , uint32_t dwSignalType ); 01056 01063 double GenGetAmplitudeMax( TpDeviceHandle_t hDevice ); 01064 01071 double GenGetAmplitude( TpDeviceHandle_t hDevice ); 01072 01080 double GenSetAmplitude( TpDeviceHandle_t hDevice , double dAmplitude ); 01081 01088 double GenGetFrequencyMin( TpDeviceHandle_t hDevice ); 01089 01096 double GenGetFrequencyMax( TpDeviceHandle_t hDevice ); 01097 01104 double GenGetFrequency( TpDeviceHandle_t hDevice ); 01105 01113 double GenSetFrequency( TpDeviceHandle_t hDevice , double dFrequency ); 01114 01121 double GenGetOffsetMin( TpDeviceHandle_t hDevice ); 01122 01129 double GenGetOffsetMax( TpDeviceHandle_t hDevice ); 01130 01137 double GenGetOffset( TpDeviceHandle_t hDevice ); 01138 01146 double GenSetOffset( TpDeviceHandle_t hDevice , double dOffset ); 01147 01154 double GenGetSymmetry( TpDeviceHandle_t hDevice ); 01155 01163 double GenSetSymmetry( TpDeviceHandle_t hDevice , double dSymmetry ); 01164 01178 uint64_t GenGetTriggerSources( TpDeviceHandle_t hDevice ); 01179 01187 uint64_t GenGetTriggerSourceAND( TpDeviceHandle_t hDevice ); 01188 01197 uint64_t GenSetTriggerSourceAND( TpDeviceHandle_t hDevice , uint64_t qwTriggerSourceMask ); 01198 01206 uint64_t GenGetTriggerSourceOR( TpDeviceHandle_t hDevice ); 01207 01216 uint64_t GenSetTriggerSourceOR( TpDeviceHandle_t hDevice , uint64_t qwTriggerSourceMask ); 01217 01230 uint64_t GenGetDataSizeMax( TpDeviceHandle_t hDevice ); 01231 01238 uint64_t GenGetDataSize( TpDeviceHandle_t hDevice ); 01239 01247 void GenFillMemory( TpDeviceHandle_t hDevice , float *pBuffer , uint64_t qwSampleCount ); 01248 01256 void GenFillMemoryRaw16( TpDeviceHandle_t hDevice , uint16_t *pBuffer , uint64_t qwSampleCount ); 01257 01264 #ifdef __cplusplus 01265 } 01266 #endif 01267 01268 #endif // _LIBTIEPIE_H_