Skip to content

Commit 4f43f4d

Browse files
zeldinzougloub
authored andcommitted
fx2lafw: Support faster sampling rates on FX3
1 parent 4645cb8 commit 4f43f4d

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/hardware/fx2lafw/api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ static const uint64_t samplerates[] = {
164164
SR_MHZ(8),
165165
SR_MHZ(12),
166166
SR_MHZ(16),
167+
SR_MHZ(32),
167168
SR_MHZ(24),
168-
SR_MHZ(48),
169169
};
170170

171171
static gboolean is_plausible(const struct libusb_device_descriptor *des)

src/hardware/fx2lafw/protocol.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,16 @@ static int command_start_acquisition(const struct sr_dev_inst *sdi)
9898

9999
delay = 0;
100100
cmd.flags = cmd.sample_delay_h = cmd.sample_delay_l = 0;
101-
if ((SR_MHZ(48) % samplerate) == 0) {
101+
102+
if ((devc->profile->dev_caps & DEV_CAPS_FX3) &&
103+
(SR_MHZ(192) % samplerate) == 0) {
104+
cmd.flags = CMD_START_FLAGS_CLK_192MHZ;
105+
delay = SR_MHZ(192) / samplerate - 1;
106+
if (delay > 0xffff)
107+
delay = 0;
108+
}
109+
110+
if (delay == 0 && (SR_MHZ(48) % samplerate) == 0) {
102111
cmd.flags = CMD_START_FLAGS_CLK_48MHZ;
103112
delay = SR_MHZ(48) / samplerate - 1;
104113
if (delay > MAX_SAMPLE_DELAY)

src/hardware/fx2lafw/protocol.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272

7373
#define CMD_START_FLAGS_CLK_30MHZ (0 << CMD_START_FLAGS_CLK_SRC_POS)
7474
#define CMD_START_FLAGS_CLK_48MHZ (1 << CMD_START_FLAGS_CLK_SRC_POS)
75+
#define CMD_START_FLAGS_CLK_192MHZ (2 << CMD_START_FLAGS_CLK_SRC_POS)
7576

7677
struct fx2lafw_profile {
7778
uint16_t vid;

0 commit comments

Comments
 (0)