From: Joel Holdsworth Date: Mon, 7 May 2012 14:58:04 +0000 (+0100) Subject: Support wide sampling X-Git-Tag: sigrok-firmware-fx2lafw-0.1.0~22 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=daf6d940fca76d60e236f492ef95885966553bcf;p=sigrok-firmware-fx2lafw.git Support wide sampling --- diff --git a/gpif-acquisition.c b/gpif-acquisition.c index d8092c7d..b0d302b6 100644 --- a/gpif-acquisition.c +++ b/gpif-acquisition.c @@ -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 | diff --git a/include/command.h b/include/command.h index ad5ea90b..2f7d3abf 100644 --- a/include/command.h +++ b/include/command.h @@ -25,8 +25,12 @@ #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)