SDDC_Driver
Loading...
Searching...
No Matches
FX3Class.h
1/*
2 * This file is part of SDDC_Driver.
3 *
4 * =====================
5 * MIT License
6 * =====================
7 *
8 * Copyright (C) 2017 - Oscar Steila
9 * Copyright (C) 2020 - Howard Su
10 * Copyright (C) 2025 - RenardSpark
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a copy
13 * of this software and associated documentation files (the "Software"), to deal
14 * in the Software without restriction, including without limitation the rights
15 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16 * copies of the Software, and to permit persons to whom the Software is
17 * furnished to do so, subject to the following conditions:
18
19 * The above copyright notice and this permission notice shall be included in all
20 * copies or substantial portions of the Software.
21
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28 * SOFTWARE.
29 *
30 * SPDX-License-Identifier: MIT
31 */
32
33#ifndef FX3CLASS_H
34#define FX3CLASS_H
35
36#include <stdint.h>
37#include <functional>
38
39#include "config.h"
40#include "../Interface.h"
41#include "dsp/ringbuffer.h"
42#include "usb/usb_device.h"
43
44
45namespace SDDC {
46 typedef struct DeviceItem {
47 std::string product;
48 std::string serial_number;
49 USBDeviceInfo _usb_def;
50 } DeviceItem;
51}
52
54{
55public:
56 virtual ~fx3class(void) {}
57 virtual bool Open(SDDC::DeviceItem) = 0;
58 virtual bool Control(FX3Command command, uint8_t data = 0) = 0;
59 virtual bool Control(FX3Command command, uint32_t data) = 0;
60 virtual bool Control(FX3Command command, uint64_t data) = 0;
61 virtual bool SetArgument(uint16_t index, uint16_t value) = 0;
62 virtual bool GetHardwareInfo(uint32_t* data) = 0;
63 virtual bool ReadDebugTrace(uint8_t* pdata, uint8_t len) = 0;
64 virtual void StartStream(ringbuffer<int16_t>& input) = 0;
65 virtual void StopStream() = 0;
66 virtual size_t GetDeviceListLength() = 0;
67 virtual std::vector<SDDC::DeviceItem> GetDeviceList() = 0;
68};
69
70extern "C" fx3class* CreateUsbHandler();
71
72#endif // FX3CLASS_H
Definition FX3Class.h:54
Definition ringbuffer.h:49
Definition FX3Class.h:46
std::string product
The model of the SDR.
Definition FX3Class.h:47
std::string serial_number
The serial number of the SDR.
Definition FX3Class.h:48
Definition usb_device.h:29