]> sigrok.org Git - sigrok-firmware-fx2lafw.git/commitdiff
Support wide sampling
authorJoel Holdsworth <redacted>
Mon, 7 May 2012 14:58:04 +0000 (15:58 +0100)
committerJoel Holdsworth <redacted>
Mon, 7 May 2012 15:53:07 +0000 (16:53 +0100)
gpif-acquisition.c
include/command.h

index d8092c7d3727dbd4a1429a36f431ef246c85eaa3..b0d302b6261872853b2d32ea97c8e0985677f32d 100644 (file)
@@ -196,6 +196,14 @@ bool gpif_acquisition_start(const struct cmd_start_acquisition *cmd)
        /* Ensure GPIF is idle before reconfiguration. */
        while (!(GPIFTRIG & 0x80));
 
+       /* Configure the EP2 FIFO */
+       if(cmd->flags & CMD_START_FLAGS_SAMPLE_16BIT) {
+               EP2FIFOCFG = bmAUTOIN | bmWORDWIDE;
+       } else {
+               EP2FIFOCFG = bmAUTOIN;
+       }
+       SYNCDELAY();
+
        /* Set IFCONFIG to the correct clock source. */
        if (cmd->flags & CMD_START_FLAGS_CLK_48MHZ) {
                IFCONFIG = bmIFCLKSRC | bm3048MHZ | bmIFCLKOE | bmASYNC |
index ad5ea90be47050e2d299372d63c2c9d4099bd530..2f7d3abf7381e1f2055c67eb18ebbe2eefe8251c 100644 (file)
 #define CMD_START                      0xb1
 #define CMD_GET_REVID_VERSION          0xb2
 
+#define CMD_START_FLAGS_WIDE_POS       5
 #define CMD_START_FLAGS_CLK_SRC_POS    6
 
+#define CMD_START_FLAGS_SAMPLE_8BIT    (0 << CMD_START_FLAGS_WIDE_POS)
+#define CMD_START_FLAGS_SAMPLE_16BIT   (1 << CMD_START_FLAGS_WIDE_POS)
+
 #define CMD_START_FLAGS_CLK_30MHZ      (0 << CMD_START_FLAGS_CLK_SRC_POS)
 #define CMD_START_FLAGS_CLK_48MHZ      (1 << CMD_START_FLAGS_CLK_SRC_POS)