summaryrefslogtreecommitdiff
path: root/Radio/HW
diff options
context:
space:
mode:
Diffstat (limited to 'Radio/HW')
-rw-r--r--Radio/HW/AirSpy/src/airspy.c41
-rw-r--r--Radio/HW/AirSpy/src/airspy.h46
2 files changed, 47 insertions, 40 deletions
diff --git a/Radio/HW/AirSpy/src/airspy.c b/Radio/HW/AirSpy/src/airspy.c
index 02c1542..8ca11fc 100644
--- a/Radio/HW/AirSpy/src/airspy.c
+++ b/Radio/HW/AirSpy/src/airspy.c
@@ -39,15 +39,9 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSI
#include "iqconverter_int16.h"
#include "filters.h"
-#ifndef bool
-typedef int bool;
-#define true 1
-#define false 0
-#endif
-
#define PACKET_SIZE (12)
#define UNPACKED_SIZE (16)
-#define RAW_BUFFER_COUNT (8)
+
#ifdef AIRSPY_BIG_ENDIAN
#define TO_LE(x) __builtin_bswap32(x)
@@ -76,39 +70,6 @@ typedef struct {
uint32_t freq_hz;
} set_freq_params_t;
-typedef struct airspy_device
-{
- libusb_context* usb_context;
- libusb_device_handle* usb_device;
- struct libusb_transfer** transfers;
- airspy_sample_block_cb_fn callback;
- volatile bool streaming;
- volatile bool stop_requested;
- pthread_t transfer_thread;
- pthread_t consumer_thread;
- bool transfer_thread_running;
- bool consumer_thread_running;
- pthread_cond_t consumer_cv;
- pthread_mutex_t consumer_mp;
- uint32_t supported_samplerate_count;
- uint32_t *supported_samplerates;
- uint32_t transfer_count;
- uint32_t buffer_size;
- uint32_t dropped_buffers;
- uint32_t dropped_buffers_queue[RAW_BUFFER_COUNT];
- uint16_t *received_samples_queue[RAW_BUFFER_COUNT];
- volatile int received_samples_queue_head;
- volatile int received_samples_queue_tail;
- volatile int received_buffer_count;
- void *output_buffer;
- uint16_t *unpacked_samples;
- bool packing_enabled;
- iqconverter_float_t *cnv_f;
- iqconverter_int16_t *cnv_i;
- void* ctx;
- enum airspy_sample_type sample_type;
-} airspy_device_t;
-
static const uint16_t airspy_usb_vid = 0x1d50;
static const uint16_t airspy_usb_pid = 0x60a1;
diff --git a/Radio/HW/AirSpy/src/airspy.h b/Radio/HW/AirSpy/src/airspy.h
index 573298b..3a778ee 100644
--- a/Radio/HW/AirSpy/src/airspy.h
+++ b/Radio/HW/AirSpy/src/airspy.h
@@ -26,7 +26,10 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSI
#define __AIRSPY_H__
#include <stdint.h>
+#include "libusb.h"
#include "airspy_commands.h"
+#include "iqconverter_float.h"
+#include "iqconverter_int16.h"
#define AIRSPY_VERSION "1.0.12"
#define AIRSPY_VER_MAJOR 1
@@ -116,8 +119,51 @@ typedef struct {
uint32_t revision;
} airspy_lib_version_t;
+#ifndef bool
+typedef int bool;
+#define true 1
+#define false 0
+#endif
+
typedef int (*airspy_sample_block_cb_fn)(airspy_transfer* transfer);
+#define RAW_BUFFER_COUNT (8)
+
+typedef struct airspy_device
+{
+ libusb_context* usb_context;
+ libusb_device_handle* usb_device;
+ struct libusb_transfer** transfers;
+ airspy_sample_block_cb_fn callback;
+ volatile bool streaming;
+ volatile bool stop_requested;
+ pthread_t transfer_thread;
+ pthread_t consumer_thread;
+ bool transfer_thread_running;
+ bool consumer_thread_running;
+ pthread_cond_t consumer_cv;
+ pthread_mutex_t consumer_mp;
+ uint32_t supported_samplerate_count;
+ uint32_t *supported_samplerates;
+ uint32_t transfer_count;
+ uint32_t buffer_size;
+ uint32_t dropped_buffers;
+ uint32_t dropped_buffers_queue[RAW_BUFFER_COUNT];
+ uint16_t *received_samples_queue[RAW_BUFFER_COUNT];
+ volatile int received_samples_queue_head;
+ volatile int received_samples_queue_tail;
+ volatile int received_buffer_count;
+ void *output_buffer;
+ uint16_t *unpacked_samples;
+ bool packing_enabled;
+ iqconverter_float_t *cnv_f;
+ iqconverter_int16_t *cnv_i;
+ void* ctx;
+ enum airspy_sample_type sample_type;
+} airspy_device_t;
+
+
+
extern ADDAPI void ADDCALL airspy_lib_version(airspy_lib_version_t* lib_version);
/* airspy_init() deprecated */
extern ADDAPI int ADDCALL airspy_init(void);