]> sigrok.org Git - libsigrok.git/commitdiff
fx2lafw: Add support for AX analog channel probing
authorJoel Holdsworth <redacted>
Sun, 24 Apr 2016 18:35:07 +0000 (20:35 +0200)
committerUwe Hermann <redacted>
Wed, 27 Apr 2016 20:29:16 +0000 (22:29 +0200)
src/hardware/fx2lafw/api.c
src/hardware/fx2lafw/protocol.h

index 076c6a2e721e7da73ddce08fce17948868a4ef96..024680364209804725fa5fd45e8aba2b4a7903aa 100644 (file)
@@ -30,7 +30,7 @@ static const struct fx2lafw_profile supported_fx2[] = {
         */
        { 0x08a9, 0x0014, "CWAV", "USBee AX", NULL,
                "fx2lafw-cwav-usbeeax.fw",
-               0, NULL, NULL},
+               DEV_CAPS_AX_ANALOG, NULL, NULL},
        /*
         * CWAV USBee DX
         * XZL-Studio DX
@@ -138,6 +138,10 @@ static const char *channel_names[] = {
        "8", "9", "10", "11", "12", "13", "14", "15",
 };
 
+static const char *ax_channel_names[] = {
+       "A0",
+};
+
 static const int32_t soft_trigger_matches[] = {
        SR_TRIGGER_ZERO,
        SR_TRIGGER_ONE,
@@ -204,7 +208,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        struct libusb_device_descriptor des;
        libusb_device **devlist;
        struct libusb_device_handle *hdl;
-       int num_logic_channels, ret, i, j;
+       int ret, i, j;
+       int num_logic_channels = 0, num_analog_channels = 0;
        const char *conn;
        char manufacturer[64], product[64], serial_num[64], connection_id[64];
 
@@ -309,10 +314,16 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
                /* Fill in channellist according to this device's profile. */
                num_logic_channels = prof->dev_caps & DEV_CAPS_16BIT ? 16 : 8;
+               num_analog_channels = prof->dev_caps & DEV_CAPS_AX_ANALOG ? 1 : 0;
+
                for (j = 0; j < num_logic_channels; j++)
                        sr_channel_new(sdi, j, SR_CHANNEL_LOGIC, TRUE,
                                        channel_names[j]);
 
+               for (j = 0; j < num_analog_channels; j++)
+                       sr_channel_new(sdi, j, SR_CHANNEL_ANALOG, TRUE,
+                                       ax_channel_names[j]);
+
                devc = fx2lafw_dev_new();
                devc->profile = prof;
                devc->sample_wide = (prof->dev_caps & DEV_CAPS_16BIT) != 0;
index 487e5db19444ed42c70f3e20d31dcea9c175f16a..f1a93f99ecd560488336bc2887c8109065240e69 100644 (file)
 #define MAX_SAMPLE_DELAY       (6 * 256)
 
 #define DEV_CAPS_16BIT_POS     0
+#define DEV_CAPS_AX_ANALOG_POS 1
 
 #define DEV_CAPS_16BIT         (1 << DEV_CAPS_16BIT_POS)
+#define DEV_CAPS_AX_ANALOG     (1 << DEV_CAPS_AX_ANALOG_POS)
 
 #define DSLOGIC_FPGA_FIRMWARE "dreamsourcelab-dslogic-fpga.fw"
 #define DSCOPE_FPGA_FIRMWARE "dreamsourcelab-dscope-fpga.fw"