Change in gr-gsm[master]: apps/grgsm_trx: introduce initial LMS driver support

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Piotr Krysik gerrit-no-reply at lists.osmocom.org
Tue Feb 5 12:10:57 UTC 2019


Piotr Krysik has submitted this change and it was merged. ( https://gerrit.osmocom.org/12676 )

Change subject: apps/grgsm_trx: introduce initial LMS driver support
......................................................................

apps/grgsm_trx: introduce initial LMS driver support

Change-Id: Ie983b10d1814906b6e659213f865e58d0f5c08e4
---
M apps/grgsm_trx
M python/trx/CMakeLists.txt
A python/trx/radio_if_lms.py
3 files changed, 73 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, but someone else must approve
  Piotr Krysik: Looks good to me, approved; Verified



diff --git a/apps/grgsm_trx b/apps/grgsm_trx
index 7da9e06..fb5a005 100755
--- a/apps/grgsm_trx
+++ b/apps/grgsm_trx
@@ -59,6 +59,8 @@
 
 		if argv.driver == "uhd":
 			from grgsm.trx.radio_if_uhd import RadioInterfaceUHD as Radio
+		elif argv.driver == "lms":
+			from grgsm.trx.radio_if_lms import RadioInterfaceLMS as Radio
 		else:
 			raise ValueError("Unknown RadioInterface driver '%s'" % argv.driver)
 
@@ -117,7 +119,7 @@
 	phy_group = parser.add_argument_group("PHY parameters")
 	phy_group.add_argument("--driver",
 		dest = "driver", type = str, default = "uhd",
-		choices = ["uhd"],
+		choices = ["uhd", "lms"],
 		help = "Set device driver (default %(default)s)")
 	phy_group.add_argument("-a", "--args",
 		dest = "args", type = str, default = "",
diff --git a/python/trx/CMakeLists.txt b/python/trx/CMakeLists.txt
index dbb3daa9..697687b 100644
--- a/python/trx/CMakeLists.txt
+++ b/python/trx/CMakeLists.txt
@@ -25,6 +25,7 @@
     ctrl_if_bb.py
     radio_if.py
     radio_if_uhd.py
+    radio_if_lms.py
     radio_if_grc.py
     transceiver.py
     dict_toggle_sign.py
diff --git a/python/trx/radio_if_lms.py b/python/trx/radio_if_lms.py
new file mode 100644
index 0000000..b9d771a
--- /dev/null
+++ b/python/trx/radio_if_lms.py
@@ -0,0 +1,69 @@
+#!/usr/bin/env python2
+# -*- coding: utf-8 -*-
+
+# GR-GSM based transceiver
+# Radio interface for Lime devices
+#
+# (C) 2019 by Vadim Yanitskiy <axilirator at gmail.com>
+#
+# All Rights Reserved
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import limesdr
+
+from radio_if import RadioInterface
+
+class RadioInterfaceLMS(RadioInterface):
+	lms_len_tag_name = "packet_len"
+	lms_dev_serial = ""
+	lms_dev_ch_mode = 1
+
+	# Human-readable description
+	def __str__(self):
+		return "LMS"
+
+	@property # Signal processing delay of PHY
+	def phy_proc_delay(self):
+		# FIXME: the current value is measured for USRP B2X0 at 26e6,
+		# we should measure it for LimeSDR separately!
+		return (285.616 + 2 * self.GSM_SYM_PERIOD_uS) * 1e-6
+
+	def phy_init_source(self):
+		self._phy_src = limesdr.source(self.lms_dev_serial,
+			self.lms_dev_ch_mode, "")
+
+		self._phy_src.set_sample_rate(self.sample_rate)
+		self._phy_src.set_gain(self.rx_gain, 0)
+
+	def phy_init_sink(self):
+		self._phy_sink = limesdr.sink(self.lms_dev_serial,
+			self.lms_dev_ch_mode, "",
+			self.lms_len_tag_name)
+
+		self._phy_sink.set_sample_rate(self.sample_rate)
+		self._phy_sink.set_gain(self.tx_gain, 0)
+
+	def phy_set_rx_freq(self, freq):
+		self._phy_src.set_center_freq(freq, 0)
+
+	def phy_set_tx_freq(self, freq):
+		self._phy_sink.set_center_freq(freq, 0)
+
+	def phy_set_rx_gain(self, gain):
+		self._phy_src.set_gain(gain, 0)
+
+	def phy_set_tx_gain(self, gain):
+		self._phy_sink.set_gain(gain, 0)

-- 
To view, visit https://gerrit.osmocom.org/12676
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie983b10d1814906b6e659213f865e58d0f5c08e4
Gerrit-Change-Number: 12676
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Piotr Krysik <ptrkrysik at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190205/50fc8f5a/attachment.htm>


More information about the gerrit-log mailing list