X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhameg-hmo%2Fprotocol.h;h=a9f69c682eb1ee6591ad1045b3e4bf25aa76b45a;hb=4fa4db2c7983235fff5891127f5f4648a3762172;hp=b251bc823b3aadfe147af3070c7a2637d5bfb3ec;hpb=e06875b2ce47e128922d63f09ca4e9b3d8105722;p=libsigrok.git diff --git a/src/hardware/hameg-hmo/protocol.h b/src/hardware/hameg-hmo/protocol.h index b251bc82..a9f69c68 100644 --- a/src/hardware/hameg-hmo/protocol.h +++ b/src/hardware/hameg-hmo/protocol.h @@ -29,7 +29,9 @@ #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 struct scope_config { @@ -44,16 +46,23 @@ struct scope_config { const uint32_t (*devopts)[]; const uint8_t num_devopts; - const uint32_t (*analog_devopts)[]; - const uint8_t num_analog_devopts; + 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 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; @@ -77,20 +86,28 @@ 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; + uint64_t sample_rate; }; -/** Private, per-device-instance driver context. */ struct dev_context { const void *model_config; void *model_state; @@ -100,8 +117,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;