PicoDeviceStructs.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /****************************************************************************
  2. *
  3. * Filename: PicoDeviceStructs.h
  4. * Copyright: Pico Technology Limited 2016 - 2022
  5. * Description:
  6. *
  7. * This header defines structs used by various Picoscope driver API calls,
  8. * defining how to pack/unpack bytes to communicate with a connected scope.
  9. *
  10. ****************************************************************************/
  11. #ifndef __PICODEVICESTRUCTS_H__
  12. #define __PICODEVICESTRUCTS_H__
  13. #define DIGITAL_PORT_SERIAL_LENGTH 10
  14. #define DIGITAL_PORT_CALIBRATION_DATE_LENGTH 8
  15. #include <stdint.h>
  16. #include "PicoConnectProbes.h"
  17. #include "PicoDeviceEnums.h"
  18. #include "PicoStatus.h"
  19. #pragma pack(push,1)
  20. typedef struct tPicoTriggerInfo
  21. {
  22. PICO_STATUS status;
  23. uint64_t segmentIndex;
  24. uint64_t triggerIndex;
  25. double triggerTime;
  26. PICO_TIME_UNITS timeUnits;
  27. uint64_t missedTriggers;
  28. uint64_t timeStampCounter;
  29. } PICO_TRIGGER_INFO;
  30. typedef struct tPicoTriggerChannelProperties
  31. {
  32. int16_t thresholdUpper;
  33. uint16_t thresholdUpperHysteresis;
  34. int16_t thresholdLower;
  35. uint16_t thresholdLowerHysteresis;
  36. PICO_CHANNEL channel;
  37. } PICO_TRIGGER_CHANNEL_PROPERTIES;
  38. typedef struct tPicoCondition
  39. {
  40. PICO_CHANNEL source;
  41. PICO_TRIGGER_STATE condition;
  42. } PICO_CONDITION;
  43. typedef struct tPicoDirection
  44. {
  45. PICO_CHANNEL channel;
  46. PICO_THRESHOLD_DIRECTION direction;
  47. PICO_THRESHOLD_MODE thresholdMode;
  48. } PICO_DIRECTION;
  49. typedef struct tPicoUserProbeInteractions
  50. {
  51. uint16_t connected_;
  52. PICO_CHANNEL channel_;
  53. uint16_t enabled_;
  54. PicoConnectProbe probeName_;
  55. uint8_t requiresPower_;
  56. uint8_t isPowered_;
  57. PICO_STATUS status_;
  58. PICO_CONNECT_PROBE_RANGE probeOff_;
  59. PICO_CONNECT_PROBE_RANGE rangeFirst_;
  60. PICO_CONNECT_PROBE_RANGE rangeLast_;
  61. PICO_CONNECT_PROBE_RANGE rangeCurrent_;
  62. PICO_COUPLING couplingFirst_;
  63. PICO_COUPLING couplingLast_;
  64. PICO_COUPLING couplingCurrent_;
  65. PICO_BANDWIDTH_LIMITER_FLAGS filterFlags_;
  66. PICO_BANDWIDTH_LIMITER_FLAGS filterCurrent_;
  67. PICO_BANDWIDTH_LIMITER defaultFilter_;
  68. } PICO_USER_PROBE_INTERACTIONS;
  69. typedef struct tPicoDataBuffers
  70. {
  71. PICO_CHANNEL channel_;
  72. uint64_t waveform_;
  73. PICO_RATIO_MODE downSampleRatioMode_;
  74. PICO_READ_SELECTION read_;
  75. PICO_POINTER bufferMax_;
  76. PICO_POINTER bufferMin_;
  77. PICO_DATA_TYPE dataType_;
  78. uint32_t nDistributionPoints_;
  79. } PICO_DATA_BUFFERS;
  80. typedef struct tPicoStreamingDataInfo
  81. {
  82. // in
  83. PICO_CHANNEL channel_;
  84. PICO_RATIO_MODE mode_;
  85. PICO_DATA_TYPE type_;
  86. int32_t noOfSamples_;
  87. uint64_t bufferIndex_;
  88. int32_t startIndex_;
  89. int16_t overflow_;
  90. } PICO_STREAMING_DATA_INFO;
  91. typedef struct tPicoStreamingDataTriggerInfo
  92. {
  93. uint64_t triggerAt_;
  94. int16_t triggered_;
  95. int16_t autoStop_;
  96. } PICO_STREAMING_DATA_TRIGGER_INFO;
  97. typedef struct tPicoScalingFactors
  98. {
  99. PICO_CHANNEL channel;
  100. PICO_CONNECT_PROBE_RANGE range;
  101. int16_t offset;
  102. double scalingFactor;
  103. } PICO_SCALING_FACTORS_VALUES;
  104. typedef struct tProbeApp
  105. {
  106. int32_t id_;
  107. int32_t appMajorVersion_;
  108. int32_t appMinorVersion_;
  109. } PROBE_APP;
  110. typedef struct tDigitalChannelDirections
  111. {
  112. PICO_PORT_DIGITAL_CHANNEL channel;
  113. PICO_DIGITAL_DIRECTION direction;
  114. } PICO_DIGITAL_CHANNEL_DIRECTIONS;
  115. typedef struct tPicoDigitalPortInteractions
  116. {
  117. uint16_t connected_;
  118. PICO_CHANNEL channel_;
  119. PICO_DIGITAL_PORT digitalPortName_;
  120. PICO_STATUS status_;
  121. int8_t serial_[DIGITAL_PORT_SERIAL_LENGTH];
  122. int8_t calibrationDate_[DIGITAL_PORT_CALIBRATION_DATE_LENGTH];
  123. } PICO_DIGITAL_PORT_INTERACTIONS;
  124. typedef struct tPicoChannelOvervoltageTripped
  125. {
  126. PICO_CHANNEL channel_;
  127. uint8_t tripped_;
  128. } PICO_CHANNEL_OVERVOLTAGE_TRIPPED;
  129. #pragma pack(pop)
  130. #endif