changeset 44:5018fd8eecce

autocal: started Rx cal core code
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 27 May 2017 05:33:42 +0000
parents 8c7b0ba1e5c4
children 98abe6bd2042
files autocal/Makefile autocal/gmagicmain.c autocal/rxcaldefs.h autocal/rxcommon.c
diffstat 4 files changed, 29 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/autocal/Makefile	Sat May 27 05:11:43 2017 +0000
+++ b/autocal/Makefile	Sat May 27 05:33:42 2017 +0000
@@ -3,7 +3,8 @@
 PROGS=	fc-rfcal-gmagic fc-rfcal-vcxo
 INSTBIN=/opt/freecalypso/bin
 
-GMAGIC_OBJS=	gmagicmain.o l1tmops.o rvinterf.o sockopts.o tsidsock.o
+GMAGIC_OBJS=	gmagicmain.o l1tmops.o rvinterf.o rxcommon.o sockopts.o \
+		tsidsock.o
 VCXO_OBJS=	l1tmops.o rvinterf.o sockopts.o tsidsock.o vcxomain.o vcxomeas.o
 
 all:	${PROGS}
--- a/autocal/gmagicmain.c	Sat May 27 05:11:43 2017 +0000
+++ b/autocal/gmagicmain.c	Sat May 27 05:33:42 2017 +0000
@@ -8,6 +8,7 @@
 #include <strings.h>
 #include <rvinterf/l1tm.h>
 #include <rvinterf/exitcodes.h>
+#include "rxcaldefs.h"
 #include "stdband.h"
 
 static struct band {
@@ -73,6 +74,7 @@
 	printf("Putting the DUT into Test Mode\n");
 	do_tms(1);
 	do_rfpw(STD_BAND_FLAG, selected_band->rfpw_std_band);
+	l1tm_setup_for_rxcal();
 
 
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/autocal/rxcaldefs.h	Sat May 27 05:33:42 2017 +0000
@@ -0,0 +1,4 @@
+/* some definitions for the Rx calibration process */
+
+#define	RXCAL_SIGGEN_LEVEL	149	/* -74.5 dBm */
+#define	RXCAL_AGC_DB		34
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/autocal/rxcommon.c	Sat May 27 05:33:42 2017 +0000
@@ -0,0 +1,21 @@
+/*
+ * This module contains the common code for
+ * fc-rfcal-gmagic and fc-rfcal-rxband.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+#include <rvinterf/l1tm.h>
+#include <rvinterf/exitcodes.h>
+#include "rxcaldefs.h"
+
+l1tm_setup_for_rxcal()
+{
+	do_rxpw(RX_AGC_ENA_FLAG, 0);
+	do_rxpw(RX_AGC_GAIN, RXCAL_AGC_DB);
+	do_rfpw(AFC_ENA_FLAG, 0);
+	/* scw settings to be added */
+	return(0);
+}