51 #define RX_ENDPOINT (0x86) 52 #define VRT_VENDOR_IN (0xC0) 53 #define VRT_VENDOR_OUT (0x40) 54 #define RX_INTERFACE (2) 55 #define RX_ALTINTERFACE (0) 56 #define VRQ_XFER (0x01) 57 #define VRQ_ENABLE (0x10) 58 #define VRQ_WRITE_CMD (0x20) 59 #define VRQ_GET_STATUS (0x80) 60 #define GS_RX_OVERRUN (1) 66 #define GN3S_VID (0x1781) 67 #define GN3S_PID (0x0B3C) 68 #define PROG_SET_CMD (0xE600) 69 #define USB_BUFFER_SIZE (65536) 70 #define USB_BLOCK_SIZE (512) 71 #define USB_NBLOCKS (USB_BUFFER_SIZE / USB_BLOCK_SIZE) 72 #define USB_NTRANSFERS (16) 73 #define USB_TIMEOUT (1000) 89 struct libusb_device *fx2_device;
90 struct libusb_device_handle *fx2_handle;
94 libusb_context *ctx =
nullptr;
96 struct libusb_device* usb_fx2_find(
int vid,
int pid);
97 bool usb_fx2_configure();
99 bool usb_fx2_start_transfers();
100 bool usb_fx2_cancel_transfers();
101 bool send_rx_cmd(
char VRQ_TYPE,
int start);
102 bool get_rx_status(
int which,
bool *trouble);
103 void set_bias_bit(
int bias);
104 void set_ant_bit(
int ant);
105 void set_freq_bit(
int freq);
106 void set_bw_bit(
int bw,
int zeroif);
114 int read(
unsigned char *buff,
int bytes);
115 int write_cmd(
int request,
int value,
int index,
unsigned char *bytes,
int len);
121 bool set_bw(
int bw,
int zeroif);
int write_cmd(int request, int value, int index, unsigned char *bytes, int len)
#define USB_NTRANSFERS
Definition: gnmax.h:72
Definition: gnmax_defines.h:25
gnmax(int _which, gnmax_settings settings)
Constructor.
int read(unsigned char *buff, int bytes)
bool set_bw(int bw, int zeroif)