*/
#include <libusb.h>
+
+#include "fx2lafw.h"
#include "command.h"
#include "sigrok.h"
#include "sigrok-internal.h"
delay = SR_MHZ(30) / samplerate - 1;
}
- /* Note: sample_delay=0 is treated as sample_delay=256. */
- if (delay <= 0 || delay > 256) {
+ if (delay <= 0 || delay > MAX_SAMPLE_DELAY) {
sr_err("fx2lafw: Unable to sample at %" PRIu64 "Hz.",
samplerate);
return SR_ERR;
}
- cmd.sample_delay = delay;
+ cmd.sample_delay_h = (delay >> 8) & 0x00FF;
+ cmd.sample_delay_l = delay & 0x00FF;
/* Send the control message. */
ret = libusb_control_transfer(devhdl, LIBUSB_REQUEST_TYPE_VENDOR |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <glib.h>
+
#ifndef LIBSIGROK_HARDWARE_FX2LAFW_FX2LAFW_H
#define LIBSIGROK_HARDWARE_FX2LAFW_FX2LAFW_H
#define FX2LAFW_VERSION_MAJOR 1
#define FX2LAFW_VERSION_MINOR 0
+#define MAX_SAMPLE_DELAY (6*256) /* 6 delay states of up to 256 clock ticks*/
/* Software trigger implementation: positive values indicate trigger stage. */
#define TRIGGER_FIRED -1