X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhameg-hmo%2Fprotocol.c;h=97eb77aaac5ddce714e3d43ec1db41ad2767a790;hb=65a6794ea1fef5064e7d47403a7bbbed76c3058b;hp=d4c938f746d5670db7f1fe605641c1b8bccb6d23;hpb=2d224dbae735e5d3ea39cbafcd6d280cbd112c31;p=libsigrok.git diff --git a/src/hardware/hameg-hmo/protocol.c b/src/hardware/hameg-hmo/protocol.c index d4c938f7..97eb77aa 100644 --- a/src/hardware/hameg-hmo/protocol.c +++ b/src/hardware/hameg-hmo/protocol.c @@ -31,7 +31,8 @@ static const char *hameg_scpi_dialect[] = { [SCPI_CMD_SET_COUPLING] = ":CHAN%d:COUP %s", [SCPI_CMD_GET_SAMPLE_RATE] = ":ACQ:SRAT?", [SCPI_CMD_GET_SAMPLE_RATE_LIVE] = ":%s:DATA:POINTS?", - [SCPI_CMD_GET_ANALOG_DATA] = ":FORM REAL,32;:CHAN%d:DATA?", + [SCPI_CMD_GET_ANALOG_DATA] = ":FORM:BORD %s;" \ + ":FORM REAL,32;:CHAN%d:DATA?", [SCPI_CMD_GET_VERTICAL_DIV] = ":CHAN%d:SCAL?", [SCPI_CMD_SET_VERTICAL_DIV] = ":CHAN%d:SCAL %s", [SCPI_CMD_GET_DIG_POD_STATE] = ":POD%d:STAT?", @@ -123,6 +124,35 @@ static const char *hmo_compact4_trigger_sources[] = { NULL, }; +static const char *hmo_compact4_dig16_trigger_sources[] = { + "CH1", + "CH2", + "CH3", + "CH4", + "LINE", + "EXT", + "PATT", + "BUS1", + "BUS2", + "D0", + "D1", + "D2", + "D3", + "D4", + "D5", + "D6", + "D7", + "D8", + "D9", + "D10", + "D11", + "D12", + "D13", + "D14", + "D15", + NULL, +}; + static const uint64_t hmo_timebases[][2] = { /* nanoseconds */ { 2, 1000000000 }, @@ -242,9 +272,7 @@ static const struct scope_config scope_models[] = { .scpi_dialect = &hameg_scpi_dialect, }, { - /* HMO2524/3034/3044/3054 support 16 digital channels but they're not supported yet. */ - .name = {"HMO724", "HMO1024", "HMO1524", "HMO2024", "HMO2524", - "HMO3034", "HMO3044", "HMO3054", NULL}, + .name = {"HMO724", "HMO1024", "HMO1524", "HMO2024", NULL}, .analog_channels = 4, .digital_channels = 8, .digital_pods = 1, @@ -271,6 +299,36 @@ static const struct scope_config scope_models[] = { .num_xdivs = 12, .num_ydivs = 8, + .scpi_dialect = &hameg_scpi_dialect, + }, + { + .name = {"HMO2524", "HMO3034", "HMO3044", "HMO3054", NULL}, + .analog_channels = 4, + .digital_channels = 16, + .digital_pods = 2, + + .analog_names = &scope_analog_channel_names, + .digital_names = &scope_digital_channel_names, + + .devopts = &hmo_devopts, + .num_devopts = ARRAY_SIZE(hmo_devopts), + + .analog_devopts = &hmo_analog_devopts, + .num_analog_devopts = ARRAY_SIZE(hmo_analog_devopts), + + .coupling_options = &hmo_coupling_options, + .trigger_sources = &hmo_compact4_dig16_trigger_sources, + .trigger_slopes = &scope_trigger_slopes, + + .timebases = &hmo_timebases, + .num_timebases = ARRAY_SIZE(hmo_timebases), + + .vdivs = &hmo_vdivs, + .num_vdivs = ARRAY_SIZE(hmo_vdivs), + + .num_xdivs = 12, + .num_ydivs = 8, + .scpi_dialect = &hameg_scpi_dialect, }, }; @@ -764,7 +822,11 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data) encoding.unitsize = sizeof(float); encoding.is_signed = TRUE; encoding.is_float = TRUE; +#ifdef WORDS_BIGENDIAN + encoding.is_bigendian = TRUE; +#else encoding.is_bigendian = FALSE; +#endif /* TODO: Use proper 'digits' value for this device (and its modes). */ encoding.digits = 2; encoding.is_digits_decimal = FALSE;