]> sigrok.org Git - libsigrok.git/commitdiff
scpi-pps: Add more HMP4000 series devices
authorGerhard Sittig <redacted>
Tue, 25 Aug 2020 18:58:24 +0000 (20:58 +0200)
committerGerhard Sittig <redacted>
Tue, 25 Aug 2020 18:59:31 +0000 (20:59 +0200)
List both vendor names "HAMEG" and "ROHDE&SCHWARZ" in the scpi-pps
driver, either responses were seen for HMP4000 devices. Unfortunately
vendor names don't support regex matches, so they require individual
profile items. The items also "violate" the alpha sort order in the list
of profiles, but keeping the series' models together is more important.

Add a declaration for the HMP4030 device which re-uses the HMP4040 data
but open codes the smaller channel count. Ideally the .probe_channels()
routine would receive the scpi_pps item as a parameter, and could yield
model specific result data from common information for the series. The
implementation in this commit is the least intrusive approach until
something better becomes available.

This shall cover the whole HMP4000 series:
  https://www.rohde-schwarz.com/product/hmp4000

src/hardware/scpi-pps/profiles.c

index e86228f741b8dd790662cc3e394837449bda12dc..3787ec674cf65f51df06772bbecc964ca7d001ee 100644 (file)
@@ -1433,6 +1433,17 @@ SR_PRIV const struct scpi_pps pps_profiles[] = {
        },
 
        /* Hameg / Rohde&Schwarz HMP4000 series */
+       /* TODO Match on regex, pass scpi_pps item to .probe_channels(). */
+       { "HAMEG", "HMP4030", SCPI_DIALECT_HMP, 0,
+               ARRAY_AND_SIZE(rs_hmp4040_devopts),
+               ARRAY_AND_SIZE(rs_hmp4040_devopts_cg),
+               rs_hmp4040_ch, 3,
+               rs_hmp4040_cg, 3,
+               rs_hmp4040_cmd,
+               .probe_channels = NULL,
+               .init_acquisition = rs_hmp_init_acquisition,
+               .update_status = NULL,
+       },
        { "HAMEG", "HMP4040", SCPI_DIALECT_HMP, 0,
                ARRAY_AND_SIZE(rs_hmp4040_devopts),
                ARRAY_AND_SIZE(rs_hmp4040_devopts_cg),
@@ -1443,6 +1454,26 @@ SR_PRIV const struct scpi_pps pps_profiles[] = {
                .init_acquisition = rs_hmp_init_acquisition,
                .update_status = NULL,
        },
+       { "ROHDE&SCHWARZ", "HMP4030", SCPI_DIALECT_HMP, 0,
+               ARRAY_AND_SIZE(rs_hmp4040_devopts),
+               ARRAY_AND_SIZE(rs_hmp4040_devopts_cg),
+               rs_hmp4040_ch, 3,
+               rs_hmp4040_cg, 3,
+               rs_hmp4040_cmd,
+               .probe_channels = NULL,
+               .init_acquisition = rs_hmp_init_acquisition,
+               .update_status = NULL,
+       },
+       { "ROHDE&SCHWARZ", "HMP4040", SCPI_DIALECT_HMP, 0,
+               ARRAY_AND_SIZE(rs_hmp4040_devopts),
+               ARRAY_AND_SIZE(rs_hmp4040_devopts_cg),
+               ARRAY_AND_SIZE(rs_hmp4040_ch),
+               ARRAY_AND_SIZE(rs_hmp4040_cg),
+               rs_hmp4040_cmd,
+               .probe_channels = NULL,
+               .init_acquisition = rs_hmp_init_acquisition,
+               .update_status = NULL,
+       },
 };
 
 SR_PRIV unsigned int num_pps_profiles = ARRAY_SIZE(pps_profiles);