X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhameg-hmo%2Fprotocol.h;h=af77c6da7e6dc09a0d2486a33809ce5881857270;hb=HEAD;hp=8620dedc632ed55d760c98299e88673e635d7ffe;hpb=d779dcacb70ffcfed190612e39a3ac5df62b31e0;p=libsigrok.git diff --git a/src/hardware/hameg-hmo/protocol.h b/src/hardware/hameg-hmo/protocol.h index 8620dedc..af77c6da 100644 --- a/src/hardware/hameg-hmo/protocol.h +++ b/src/hardware/hameg-hmo/protocol.h @@ -28,17 +28,19 @@ #define LOG_PREFIX "hameg-hmo" -#define MAX_INSTRUMENT_VERSIONS 10 -#define MAX_COMMAND_SIZE 48 -#define MAX_ANALOG_CHANNEL_COUNT 4 -#define MAX_DIGITAL_CHANNEL_COUNT 16 -#define MAX_DIGITAL_GROUP_COUNT 2 +#define DIGITAL_CHANNELS_PER_POD 8 + +#define MAX_INSTRUMENT_VERSIONS 10 +#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 { const char *name[MAX_INSTRUMENT_VERSIONS]; const uint8_t analog_channels; const uint8_t digital_channels; - const uint8_t digital_pods; + uint8_t digital_pods; const char *(*analog_names)[]; const char *(*digital_names)[]; @@ -49,9 +51,16 @@ 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; @@ -64,8 +73,8 @@ struct scope_config { const uint64_t (*vdivs)[][2]; const uint8_t num_vdivs; - const uint8_t num_xdivs; - const uint8_t num_ydivs; + unsigned int num_xdivs; + const unsigned int num_ydivs; const char *(*scpi_dialect)[]; }; @@ -80,16 +89,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[MAX_ANALOG_CHANNEL_COUNT + MAX_DIGITAL_CHANNEL_COUNT + 1]; + + gboolean high_resolution; + gboolean peak_detection; + uint64_t sample_rate; };