int delay = 0, ret;
/* Compute the sample rate. */
+ if(samplewide && samplerate > MAX_16BIT_SAMPLE_RATE) {
+ sr_err("fx2lafw: Unable to sample at %" PRIu64 "Hz "
+ "when collecting 16-bit samples.", samplerate);
+ return SR_ERR;
+ }
+
if ((SR_MHZ(48) % samplerate) == 0) {
cmd.flags = CMD_START_FLAGS_CLK_48MHZ;
delay = SR_MHZ(48) / samplerate - 1;
#define FX2LAFW_REQUIRED_VERSION_MAJOR 1
+#define MAX_8BIT_SAMPLE_RATE SR_MHZ(24)
+#define MAX_16BIT_SAMPLE_RATE SR_MHZ(12)
+
/* 6 delay states of up to 256 clock ticks */
#define MAX_SAMPLE_DELAY (6 * 256)