aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/device/ipc/uhdwrap.h
diff options
context:
space:
mode:
authorEric <ewild@sysmocom.de>2020-04-24 21:39:17 +0200
committerOliver Smith <osmith@sysmocom.de>2020-05-27 14:00:05 +0200
commitebc9e074766e000cdfeb283c336b89586d65336b (patch)
tree38082f8d4a904423452fc0ceae92e36553030924 /Transceiver52M/device/ipc/uhdwrap.h
parent58425b9653781012f3d85ba0a51d274f2f9a7abc (diff)
v1
Diffstat (limited to 'Transceiver52M/device/ipc/uhdwrap.h')
-rw-r--r--Transceiver52M/device/ipc/uhdwrap.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/Transceiver52M/device/ipc/uhdwrap.h b/Transceiver52M/device/ipc/uhdwrap.h
new file mode 100644
index 0000000..44999a0
--- /dev/null
+++ b/Transceiver52M/device/ipc/uhdwrap.h
@@ -0,0 +1,66 @@
+#ifndef IPC_UHDWRAP_H
+#define IPC_UHDWRAP_H
+
+#ifdef __cplusplus
+#include "../uhd/UHDDevice.h"
+
+class uhd_wrap : public uhd_device {
+ public:
+ // std::thread *t;
+ size_t samps_per_buff_rx;
+ size_t samps_per_buff_tx;
+ int channel_count;
+
+ std::vector<std::vector<short> > wrap_rx_buffs;
+ std::vector<std::vector<short> > wrap_tx_buffs;
+ std::vector<short *> wrap_rx_buf_ptrs;
+ std::vector<short *> wrap_tx_buf_ptrs;
+
+ template <typename... Args> uhd_wrap(Args... args) : uhd_device(args...)
+ {
+ // t = new std::thread(magicthread);
+ // give the thread some time to start and set up
+ // std::this_thread::sleep_for(std::chrono::seconds(1));
+ }
+ virtual ~uhd_wrap();
+
+ // void ipc_sock_close() override {};
+ int wrap_read(TIMESTAMP *timestamp);
+ virtual int open(const std::string &args, int ref, bool swap_channels) override;
+
+ // bool start() override;
+ // bool stop() override;
+ // virtual TIMESTAMP initialWriteTimestamp() override;
+ // virtual TIMESTAMP initialReadTimestamp() override;
+
+ int getTimingOffset()
+ {
+ return ts_offset;
+ }
+ size_t bufsizerx();
+ size_t bufsizetx();
+ int chancount();
+};
+#else
+void *uhdwrap_open(struct ipc_sk_if_open_req *open_req);
+
+int32_t uhdwrap_get_bufsizerx(void *dev);
+
+int32_t uhdwrap_get_timingoffset(void *dev);
+
+int32_t uhdwrap_read(void *dev, uint32_t num_chans);
+
+int32_t uhdwrap_write(void *dev, uint32_t num_chans, bool *underrun);
+
+double uhdwrap_set_freq(void *dev, double f, size_t chan, bool for_tx);
+
+double uhdwrap_set_gain(void *dev, double f, size_t chan, bool for_tx);
+
+int32_t uhdwrap_start(void *dev, int chan);
+
+int32_t uhdwrap_stop(void *dev, int chan);
+
+void uhdwrap_fill_info_cnf(struct ipc_sk_if *ipc_prim);
+#endif
+
+#endif // IPC_B210_H