2012-03-01 20:34:20 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the sigrok project.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2012-03-25 13:21:56 +00:00
|
|
|
#ifndef LIBSIGROK_HARDWARE_FX2LAFW_COMMAND_H
|
|
|
|
#define LIBSIGROK_HARDWARE_FX2LAFW_COMMAND_H
|
|
|
|
|
2012-05-31 20:46:28 +00:00
|
|
|
#include <glib.h>
|
2012-07-04 22:55:07 +00:00
|
|
|
#include "libsigrok.h"
|
2012-03-25 13:23:31 +00:00
|
|
|
|
2012-03-01 20:34:20 +00:00
|
|
|
/* Protocol commands */
|
2012-03-25 13:20:55 +00:00
|
|
|
#define CMD_GET_FW_VERSION 0xb0
|
|
|
|
#define CMD_START 0xb1
|
2012-05-06 17:54:46 +00:00
|
|
|
#define CMD_GET_REVID_VERSION 0xb2
|
2012-03-01 20:34:20 +00:00
|
|
|
|
2012-05-07 15:01:10 +00:00
|
|
|
#define CMD_START_FLAGS_WIDE_POS 5
|
2012-03-04 14:10:44 +00:00
|
|
|
#define CMD_START_FLAGS_CLK_SRC_POS 6
|
|
|
|
|
2012-05-07 15:01:10 +00:00
|
|
|
#define CMD_START_FLAGS_SAMPLE_8BIT (0 << CMD_START_FLAGS_WIDE_POS)
|
|
|
|
#define CMD_START_FLAGS_SAMPLE_16BIT (1 << CMD_START_FLAGS_WIDE_POS)
|
|
|
|
|
2012-03-04 14:10:44 +00:00
|
|
|
#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)
|
|
|
|
|
|
|
|
#pragma pack(push, 1)
|
|
|
|
|
2012-04-10 17:27:24 +00:00
|
|
|
struct version_info {
|
|
|
|
uint8_t major;
|
|
|
|
uint8_t minor;
|
|
|
|
};
|
|
|
|
|
2012-03-25 13:20:55 +00:00
|
|
|
struct cmd_start_acquisition {
|
2012-03-04 14:10:44 +00:00
|
|
|
uint8_t flags;
|
2012-05-07 11:40:52 +00:00
|
|
|
uint8_t sample_delay_h;
|
|
|
|
uint8_t sample_delay_l;
|
2012-03-04 14:10:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
2012-04-10 17:27:24 +00:00
|
|
|
SR_PRIV int command_get_fw_version(libusb_device_handle *devhdl,
|
|
|
|
struct version_info *vi);
|
2012-05-06 17:54:46 +00:00
|
|
|
SR_PRIV int command_get_revid_version(libusb_device_handle *devhdl,
|
|
|
|
uint8_t *revid);
|
2012-03-25 13:23:31 +00:00
|
|
|
SR_PRIV int command_start_acquisition(libusb_device_handle *devhdl,
|
2012-05-31 20:46:28 +00:00
|
|
|
uint64_t samplerate, gboolean samplewide);
|
2012-03-25 13:21:56 +00:00
|
|
|
|
|
|
|
#endif
|