]> sigrok.org Git - libsigrok.git/commitdiff
rigol-dg: Announce counter channels for dg1000z only
authorRalf <redacted>
Fri, 23 Oct 2020 18:15:12 +0000 (20:15 +0200)
committerSoeren Apel <redacted>
Sat, 28 Sep 2024 22:00:17 +0000 (00:00 +0200)
src/hardware/rigol-dg/api.c
src/hardware/rigol-dg/protocol.h

index f9a90e6892ee0abce65b98683033be209ccfe502..37679cd6a5b18686465a8412078d18c3f63b48eb 100644 (file)
@@ -290,72 +290,84 @@ static const struct device_spec device_models[] = {
                ARRAY_AND_SIZE(dg1000z_devopts_cg),
                ARRAY_AND_SIZE(dg811_channels),
                cmdset_dg1000z,
+               TRUE,
        },
        { "Rigol Technologies", "DG812",
                ARRAY_AND_SIZE(dg1000z_devopts),
                ARRAY_AND_SIZE(dg1000z_devopts_cg),
                ARRAY_AND_SIZE(dg812_channels),
                cmdset_dg1000z,
+               TRUE,
        },
        { "Rigol Technologies", "DG821",
                ARRAY_AND_SIZE(dg1000z_devopts),
                ARRAY_AND_SIZE(dg1000z_devopts_cg),
                ARRAY_AND_SIZE(dg821_channels),
                cmdset_dg1000z,
+               TRUE,
        },
        { "Rigol Technologies", "DG822",
                ARRAY_AND_SIZE(dg1000z_devopts),
                ARRAY_AND_SIZE(dg1000z_devopts_cg),
                ARRAY_AND_SIZE(dg822_channels),
                cmdset_dg1000z,
+               TRUE,
        },
        { "Rigol Technologies", "DG831",
                ARRAY_AND_SIZE(dg1000z_devopts),
                ARRAY_AND_SIZE(dg1000z_devopts_cg),
                ARRAY_AND_SIZE(dg831_channels),
                cmdset_dg1000z,
+               TRUE,
        },
        { "Rigol Technologies", "DG832",
                ARRAY_AND_SIZE(dg1000z_devopts),
                ARRAY_AND_SIZE(dg1000z_devopts_cg),
                ARRAY_AND_SIZE(dg832_channels),
                cmdset_dg1000z,
+               TRUE,
        },
        { "Rigol Technologies", "DG952",
                ARRAY_AND_SIZE(dg1000z_devopts),
                ARRAY_AND_SIZE(dg1000z_devopts_cg),
                ARRAY_AND_SIZE(dg952_channels),
                cmdset_dg1000z,
+               TRUE,
        },
        { "Rigol Technologies", "DG972",
                ARRAY_AND_SIZE(dg1000z_devopts),
                ARRAY_AND_SIZE(dg1000z_devopts_cg),
                ARRAY_AND_SIZE(dg972_channels),
                cmdset_dg1000z,
+               TRUE,
        },
        { "Rigol Technologies", "DG992",
                ARRAY_AND_SIZE(dg1000z_devopts),
                ARRAY_AND_SIZE(dg1000z_devopts_cg),
                ARRAY_AND_SIZE(dg992_channels),
                cmdset_dg1000z,
+               TRUE,
        },
        { "Rigol Technologies", "DG1022Z",
                ARRAY_AND_SIZE(dg1000z_devopts),
                ARRAY_AND_SIZE(dg1000z_devopts_cg),
                ARRAY_AND_SIZE(dg1022z_channels),
                cmdset_dg1000z,
+               TRUE,
        },
        { "Rigol Technologies", "DG1032Z",
                ARRAY_AND_SIZE(dg1000z_devopts),
                ARRAY_AND_SIZE(dg1000z_devopts_cg),
                ARRAY_AND_SIZE(dg1032z_channels),
                cmdset_dg1000z,
+               TRUE,
        },
        { "Rigol Technologies", "DG1062Z",
                ARRAY_AND_SIZE(dg1000z_devopts),
                ARRAY_AND_SIZE(dg1000z_devopts_cg),
                ARRAY_AND_SIZE(dg1062z_channels),
                cmdset_dg1000z,
+               TRUE,
        },
        /* MSO5000 devices*/
        { "Rigol Technologies", "MSO5354",
@@ -363,36 +375,42 @@ static const struct device_spec device_models[] = {
                ARRAY_AND_SIZE(mso5000_devopts_cg),
                ARRAY_AND_SIZE(mso5000_channels),
                cmdset_mso5000,
+               FALSE,
        },
        { "Rigol Technologies", "MSO5204",
                ARRAY_AND_SIZE(mso5000_devopts),
                ARRAY_AND_SIZE(mso5000_devopts_cg),
                ARRAY_AND_SIZE(mso5000_channels),
                cmdset_mso5000,
+               FALSE,
        },
        { "Rigol Technologies", "MSO5104",
                ARRAY_AND_SIZE(mso5000_devopts),
                ARRAY_AND_SIZE(mso5000_devopts_cg),
                ARRAY_AND_SIZE(mso5000_channels),
                cmdset_mso5000,
+               FALSE,
        },
        { "Rigol Technologies", "MSO5102",
                ARRAY_AND_SIZE(mso5000_devopts),
                ARRAY_AND_SIZE(mso5000_devopts_cg),
                ARRAY_AND_SIZE(mso5000_channels),
                cmdset_mso5000,
+               FALSE,
        },
        { "Rigol Technologies", "MSO5074",
                ARRAY_AND_SIZE(mso5000_devopts),
                ARRAY_AND_SIZE(mso5000_devopts_cg),
                ARRAY_AND_SIZE(mso5000_channels),
                cmdset_mso5000,
+               FALSE,
        },
        { "Rigol Technologies", "MSO5072",
                ARRAY_AND_SIZE(mso5000_devopts),
                ARRAY_AND_SIZE(mso5000_devopts_cg),
                ARRAY_AND_SIZE(mso5000_channels),
                cmdset_mso5000,
+               FALSE,
        },
 };
 
@@ -479,11 +497,13 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
                cg->channels = g_slist_append(cg->channels, ch);
        }
 
-       /* Create channels for the frequency counter output. */
-       ch = sr_channel_new(sdi, ch_idx++, SR_CHANNEL_ANALOG, TRUE, "FREQ1");
-       ch = sr_channel_new(sdi, ch_idx++, SR_CHANNEL_ANALOG, TRUE, "PERIOD1");
-       ch = sr_channel_new(sdi, ch_idx++, SR_CHANNEL_ANALOG, TRUE, "DUTY1");
-       ch = sr_channel_new(sdi, ch_idx++, SR_CHANNEL_ANALOG, TRUE, "WIDTH1");
+       if (device->has_counter) {
+               /* Create channels for the frequency counter output. */
+               ch = sr_channel_new(sdi, ch_idx++, SR_CHANNEL_ANALOG, TRUE, "FREQ1");
+               ch = sr_channel_new(sdi, ch_idx++, SR_CHANNEL_ANALOG, TRUE, "PERIOD1");
+               ch = sr_channel_new(sdi, ch_idx++, SR_CHANNEL_ANALOG, TRUE, "DUTY1");
+               ch = sr_channel_new(sdi, ch_idx++, SR_CHANNEL_ANALOG, TRUE, "WIDTH1");
+       }
 
        /* Put device back to "local" mode, in case only a scan was done... */
        command = sr_scpi_cmd_get(devc->cmdset, PSG_CMD_SETUP_LOCAL);
index 02e1acdcf08881a6017a889c84fa3ed719258610..9093aa52cd0809eeb0340564bd497fa936711834 100644 (file)
@@ -124,6 +124,7 @@ struct device_spec {
        const struct channel_spec *channels;
        const uint32_t num_channels;
        const struct scpi_command *cmdset;
+       const gboolean has_counter;
 };
 
 struct dev_context {