From 60cf8289ccc2015b93b2dedb73173f682dee750c Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Tue, 19 Nov 2013 14:59:24 +0100 Subject: [PATCH] added new padiwa_amps register to disable discharge signal --- tools/padiwa.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/padiwa.pl b/tools/padiwa.pl index 34b5df6..5d83163 100755 --- a/tools/padiwa.pl +++ b/tools/padiwa.pl @@ -28,6 +28,7 @@ if(!(defined $ARGV[0]) || !(defined $ARGV[1]) || !(defined $ARGV[2])) { print "\t \t\t read temperature compensation value. no options\n"; print "\t disable \t set input diable. options: \$mask\n"; print "\t \t\t read input disable. no options\n"; + print "\t discharge \t Disables the discharge circuit if set. options: \$mask\n"; print "\t input \t\t read input status. no options\n"; print "\t invert \t set invert status. options: \$mask\n"; print "\t \t\t read invert status. no options\n"; @@ -141,6 +142,18 @@ if($ARGV[2] eq "comp") { printf("0x%04x\t%d\t0x%04x\n",$e,$chain,$b->{$e}&0xffff); } } + +if($ARGV[2] eq "discharge" && defined $ARGV[3]) { + my $b = sendcmd(0x20870000+($mask&0x00ff)); + print "Wrote Discharge Disable settings.\n"; + } + +if($ARGV[2] eq "discharge") { + my $b = sendcmd(0x20070000); + foreach my $e (sort keys %$b) { + printf("0x%04x\t%d\t0x%04x\n",$e,$chain,$b->{$e}&0xff); + } + } if($ARGV[2] eq "disable" && defined $ARGV[3]) { my $b = sendcmd(0x20800000+($mask&0xffff)); -- 2.43.0