summaryrefslogtreecommitdiff
path: root/hw/sdr.h
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2015-10-07 20:31:04 +0100
committerFreeArtMan <dos21h@gmail.com>2015-10-07 20:31:04 +0100
commit66c15af1113de0e864c5286ea255142b2cd53aca (patch)
tree6f3b3424ddea373d569bf140c2730804a4252df4 /hw/sdr.h
parente1fd164e62c2dfbd08d0d4699a723cace40d0e8c (diff)
downloadradiola-66c15af1113de0e864c5286ea255142b2cd53aca.tar.gz
radiola-66c15af1113de0e864c5286ea255142b2cd53aca.zip
Added interface for sdr. To manage audio, sdr devices
Diffstat (limited to 'hw/sdr.h')
-rw-r--r--hw/sdr.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/hw/sdr.h b/hw/sdr.h
new file mode 100644
index 0000000..81ec57f
--- /dev/null
+++ b/hw/sdr.h
@@ -0,0 +1,61 @@
+#ifndef __RADIOLA_HW_SDR_H
+#define __RADIOLA_HW_SDR_H
+
+#include "hw.h"
+
+typedef enum
+{
+ DEVICE_NONE=0,
+ DEVICE_RTLSDR,
+ DEVICE_AUDIO,
+ DEVICE_NET,
+ DEVICE_PTT
+} sdr_device;
+
+
+typedef struct dongle_t
+{
+ rtlsdr_dev_t *dev;
+ int dev_index;
+ uint32_t freq;
+ uint32_t rate;
+ int gain;
+} dongle_t;
+
+
+typedef struct audio_t
+{
+} audio_t;
+
+
+typedef struct sdr_t
+{
+ sdr_device dev_type;
+ dongle_t *dongle;
+ uint32_t d_used;
+ audio_t *audio;
+ uint32_t a_used;
+} sdr_t;
+
+//index of device in oter list
+//return inner device list
+int sdr_open_device( sdr_t *sdr, int dev_index );
+//get index in list of devices of structure from outer device index
+//? do we need?
+//int sdr_get_dongle_idx( sdr_t *sdr, int idx );
+//close device by internal list index
+int sdr_close_device( sdr_t *sdr, int idx );
+
+int dongle_stop( sdr_t *sdr, int idx );
+//int dongle_open( sdr_t *);
+int dongle_set_freq( sdr_t *sdr, int idx, uint32_t freq);
+int dongle_set_gain( sdr_t *sdr, int idx, int gain);
+int dongle_set_sample_rate( sdr_t *sdr, int idx, uint32_t srate );
+
+uint32_t dongle_get_freq( sdr_t *sdr, int idx );
+int dongle_get_gain( sdr_t *sdr, int idx);
+uint32_t dongle_get_sample_rate( sdr_t *sdr, int idx );
+int dongle_get_samples( sdr_t *sdr, int idx, uint8_t *buf, int len );
+//int dongle_close();
+
+#endif \ No newline at end of file