]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/hameg-hmo/protocol.h
hameg-hmo: Remove duplicate function call.
[libsigrok.git] / src / hardware / hameg-hmo / protocol.h
index 037b2426fcda6829e92d552c2df06e3865dbbdf9..30efc8626ab9fb94da75a63fd33200a82204668a 100644 (file)
@@ -29,7 +29,7 @@
 #define LOG_PREFIX "hameg-hmo"
 
 #define MAX_INSTRUMENT_VERSIONS 10
-#define MAX_COMMAND_SIZE 48
+#define MAX_COMMAND_SIZE 128
 #define MAX_ANALOG_CHANNEL_COUNT 4
 #define MAX_DIGITAL_CHANNEL_COUNT 16
 #define MAX_DIGITAL_GROUP_COUNT        2
@@ -49,13 +49,21 @@ struct scope_config {
        const uint32_t (*devopts_cg_analog)[];
        const uint8_t num_devopts_cg_analog;
 
+       const uint32_t (*devopts_cg_digital)[];
+       const uint8_t num_devopts_cg_digital;
+
        const char *(*coupling_options)[];
        const uint8_t num_coupling_options;
 
+       const char *(*logic_threshold)[];
+       const uint8_t num_logic_threshold;
+       const gboolean logic_threshold_for_pod;
+
        const char *(*trigger_sources)[];
        const uint8_t num_trigger_sources;
 
        const char *(*trigger_slopes)[];
+       const uint8_t num_trigger_slopes;
 
        const uint64_t (*timebases)[][2];
        const uint8_t num_timebases;
@@ -79,16 +87,25 @@ struct analog_channel_state {
        char probe_unit;
 };
 
+struct digital_pod_state {
+       gboolean state;
+
+       int threshold;
+       float user_threshold;
+};
+
 struct scope_state {
        struct analog_channel_state *analog_channels;
        gboolean *digital_channels;
-       gboolean *digital_pods;
+       struct digital_pod_state *digital_pods;
 
        int timebase;
        float horiz_triggerpos;
 
        int trigger_source;
        int trigger_slope;
+       char trigger_pattern[MAX_ANALOG_CHANNEL_COUNT + MAX_DIGITAL_CHANNEL_COUNT];
+
        uint64_t sample_rate;
 };
 
@@ -101,8 +118,10 @@ struct dev_context {
 
        GSList *enabled_channels;
        GSList *current_channel;
+       uint64_t num_samples;
        uint64_t num_frames;
 
+       uint64_t samples_limit;
        uint64_t frame_limit;
 
        size_t pod_count;