]> sigrok.org Git - libsigrok.git/blobdiff - hardware/hantek-dso/dso.h
hantek-dso: proper protocol implementation of trigger/samplerate setting
[libsigrok.git] / hardware / hantek-dso / dso.h
index 6e35a985859e53cfd7b272621431dd76f580356d..a0f5c5a1efdf70968e35c407204dc0d6b7044f88 100644 (file)
 
 #define DEFAULT_VOLTAGE            VOLTAGE_2V
 #define DEFAULT_FRAMESIZE          FRAMESIZE_SMALL
-#define DEFAULT_TIMEBASE           TIME_1ms
+#define DEFAULT_TIMEBASE           TIME_400us
 #define DEFAULT_TRIGGER_SOURCE     TRIGGER_CH1
 #define DEFAULT_COUPLING           COUPLING_AC
-#define DEFAULT_SELECTED_CHANNEL   SELECT_CH1CH2
-/* Halfway between min and max = 0V */
-#define DEFAULT_HORIZ_TRIGGERPOS   0x1400
-
+#define DEFAULT_HORIZ_TRIGGERPOS   0.5
 #define DEFAULT_VERT_OFFSET        0.5
 #define DEFAULT_VERT_TRIGGERPOS    0.0
 
@@ -118,15 +115,7 @@ enum trigger_slopes {
 enum trigger_sources {
        TRIGGER_CH2 = 0,
        TRIGGER_CH1,
-       TRIGGER_ALT,
        TRIGGER_EXT,
-       TRIGGER_EXT10
-};
-
-enum selected_channels {
-       SELECT_CH1 = 0,
-       SELECT_CH2,
-       SELECT_CH1CH2
 };
 
 enum capturestates {
@@ -169,6 +158,8 @@ struct context {
        struct dso_profile *profile;
        struct sr_usb_dev_inst *usb;
        void *cb_data;
+       uint64_t limit_frames;
+       uint64_t num_frames;
        /* We can't keep track of an FX2-based device after upgrading
         * the firmware (it re-enumerates into a different device address
         * after the upgrade) this is like a global lock. No device will open
@@ -192,14 +183,13 @@ struct context {
        float voffset_ch2;
        float voffset_trigger;
        uint16_t channel_levels[2][9][2];
-       int selected_channel;
        int framesize;
        gboolean filter_ch1;
        gboolean filter_ch2;
        gboolean filter_trigger;
        int triggerslope;
        int triggersource;
-       int triggerposition;
+       float triggerposition;
        int triggermode;
 };