]> sigrok.org Git - libsigrok.git/blobdiff - sigrok.h
MinGW: Quickfix to make serial.c/ols.c compile.
[libsigrok.git] / sigrok.h
index 4373fcb497266c6663e64e059923fef8373daae7..496f1c6c997891a7dc05f2bae67edae997aff92d 100644 (file)
--- a/sigrok.h
+++ b/sigrok.h
@@ -60,6 +60,8 @@
 #define MHZ(n) ((n) * 1000000)
 #define GHZ(n) ((n) * 1000000000)
 
+#define HZ_TO_NS(n) (1000000000 / (n))
+
 #ifndef ARRAY_SIZE
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
 #endif
@@ -113,7 +115,8 @@ struct datafeed_header {
        struct timeval starttime;
        uint64_t samplerate;
        int protocol_id;
-       int num_probes;
+       int num_analog_probes;
+       int num_logic_probes;
 };
 
 
@@ -190,8 +193,14 @@ struct device {
        struct datastore *datastore;
 };
 
+enum {
+       PROBE_TYPE_LOGIC,
+       PROBE_TYPE_ANALOG,
+};
+
 struct probe {
        int index;
+       int type;
        gboolean enabled;
        char *name;
        char *trigger;
@@ -202,13 +211,14 @@ extern GSList *devices;
 
 /* Hardware plugin capabilities */
 enum {
-       HWCAP_DUMMY,            /* Used to terminate lists */
+       HWCAP_DUMMY,             /* Used to terminate lists */
        HWCAP_LOGIC_ANALYZER,
-       HWCAP_SAMPLERATE,       /* Change samplerate */
-       HWCAP_PROBECONFIG,      /* Configure probe mask */
-       HWCAP_CAPTURE_RATIO,    /* Set pre/post-trigger capture ratio */
-       HWCAP_LIMIT_MSEC,       /* Set a time limit for sample acquisition */
-       HWCAP_LIMIT_SAMPLES,    /* Set a limit on number of samples */
+       HWCAP_SAMPLERATE,        /* Change samplerate */
+       HWCAP_PROBECONFIG,       /* Configure probe mask */
+       HWCAP_CAPTURE_RATIO,     /* Set pre/post-trigger capture ratio */
+       HWCAP_LIMIT_MSEC,        /* Set a time limit for sample acquisition */
+       HWCAP_LIMIT_SAMPLES,     /* Set a limit on number of samples */
+       HWCAP_CONTINUOUS,
 };
 
 struct hwcap_option {