From eaef6295a42e63c444918ce3ad692afe971da3ed Mon Sep 17 00:00:00 2001
From: James Webb <james@Jamess-MacBook-Air.local>
Date: Mon, 20 Sep 2021 15:23:10 +1000
Subject: [PATCH] Star chip testing macro skeleton

---
 setupStarChips.C | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 setupStarChips.C

diff --git a/setupStarChips.C b/setupStarChips.C
new file mode 100644
index 0000000..2b5a769
--- /dev/null
+++ b/setupStarChips.C
@@ -0,0 +1,36 @@
+#include "ROOT"
+#include "macros/AMACv2.h"
+#include "macros/AMACv2.cpp"
+#include "macros/abc_star/testing.cpp"
+#include "macros/runtimeCommon.h"
+
+void setupStarChips()
+{
+
+	e->ConfigureVariable(10049,1);
+	AMACv2_setID(0,0,0);
+	AMACv2_setID(0,0,0);
+	AMACv2_DCDC(0,0,0);	
+	AMACv2_DCDC(0,1,0);	
+
+	uint16_t val = 0x00010100;
+//	string hex_val = "0x00010100";
+//	int val = stoi(hex_val,0,16);
+
+	AMACv2_writeReg(0,46,val,0);
+	AMACv2_writeReg(0,47,val,0);
+	val = 0x00077700;
+//	hex_val = "0x00077700";
+//	val = stoi(hex_val,0,16);
+	AMACv2_writeReg(0,40,val,0);
+	AMACv2_writeReg(0,41,val,0);
+	AMACv2_writeReg(0,40,val,0);
+	AMACv2_writeReg(0,41,val,0);
+	
+//Set LCB phase
+	e->ExecuteConfigs();
+	abc_star_fast_command(2,2);
+	abc_star_fast_command(3,0);
+	e->ExecuteConfigs();
+	
+} 
-- 
GitLab