From c775e243dd34cbc180316d9057345a5f042c038b Mon Sep 17 00:00:00 2001 From: Maps Date: Tue, 1 Aug 2023 22:09:15 +0200 Subject: [PATCH] add download link for config file --- http/htdocs/getdacfile.pl | 48 +++++++++++++++++++++++++++++++++++++++ http/htdocs/setreg.htm | 3 ++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100755 http/htdocs/getdacfile.pl diff --git a/http/htdocs/getdacfile.pl b/http/htdocs/getdacfile.pl new file mode 100755 index 0000000..ff53431 --- /dev/null +++ b/http/htdocs/getdacfile.pl @@ -0,0 +1,48 @@ +#!/usr/bin/perl -w +use URI::Escape; +use lib '../scripts/'; +use lib '../../scripts/'; +use Mimosis; +use Data::Dumper; +use HADES::TrbNet; + +trb_init_ports() or die trb_strerror(); + +eval{ + htsponse(200,"OK"); + print "Content-type: text/html\r\n\r\n"; + }; + +my ($fpga,$reg,$value) = split('-',$ENV{'QUERY_STRING'}); + +$fpga = hex($fpga) if $fpga =~ /^0x/; + +my $val; +my @registers = ( +"], #IBIAS 0 - 80 nA , 312 pA Pixel current ", +"], #ITHR 0 - 2.5 nA , 9.8 pA Pixel current ", +"], #IDB 0 - 40 nA , 157 pA Pixel current ", +"], #VRESET 0.37 - 1.79 V , 6 mV Pixel input amplifier reset voltage ", +"], #VPL 0.37 - 1.79 V , 6 mV Pixel voltage for charge injection (low value) ", +"], #VPH 0.37 - 1.79 V , 6 mV Pixel voltage for charge injection (high ", +"], #VPH_FINE 0 - 256 mV , 1 mV value) VPH+VPH_FINE ", +"], #VCASP 0 - 1.54 V , 6 mV Pixel voltage ", +"], #VCASNA 0 - 1.54 V , 6 mV Pixel threshold voltage for submatrix A ", +"], #VCASNB 0 - 1.54 V , 6 mV Pixel threshold voltage for submatrix B ", +"], #VCASNC 0 - 1.54 V , 6 mV Pixel threshold voltage for submatrix C ", +"], #VCASND 0 - 1.54 V , 6 mV Pixel threshold voltage for submatrix D ", +"], #VCASN2 0 - 1.54 V , 6 mV Pixel voltage ", +"], #VCLIP 0 - 1.54 V , 6 mV Pixel clipping amplifier voltage ", +"], #IBUFBIAS 0 - 10 μA , 312 pA Internal buffer bias (not in pixel) ", + + +); + + +for my $i (0..14) { + $val = Mimosis::mimosis_register_read($fpga, $i+0x40,1); #single access mode as default + $val &= 0xff; + printf("[0x00%02x, %3i%s\n",$i+0x40,$val,$registers[$i]); + } + +exit 1; diff --git a/http/htdocs/setreg.htm b/http/htdocs/setreg.htm index 43b8e8f..1cf9381 100644 --- a/http/htdocs/setreg.htm +++ b/http/htdocs/setreg.htm @@ -93,7 +93,7 @@

DAC Control

- FPGA + FPGA  Download
VCASP
VCASNA
VCASNB
@@ -119,6 +119,7 @@ loadvalues(); function loadvalues() { + document.getElementById("DownloadLink").href="getdacfile.pl?"+document.getElementById("fpga").value; getData("getdac.pl?"+document.getElementById("fpga").value,"",showDacs); } -- 2.43.0