sub usage {
print <<EOF;
-usage: spi_slave.pl <--endpoint|e=0xYYYY> <--chain|c=N> [--register=number] [--data=number]
-
-examples: spi_slave.pl -e 0x1212 -c 0 -x time # reads the compile time of 0x1212, chain 0
- spi_slave.pl -e 0x1212 -c 0 -x pwm --channel=1 # reads the threshold setting of channel 1
- spi_slave.pl -e=0x1212 -c=0 -x=inputenable --data=0xa55a # disables some channels
- spi_slave.pl --endpoint=0x1212 --chain=0 -x dischargedelayinvert -d 0xff # sets the dischargedelayinvert bits
- spi_slave.pl --endpoint=0x1212 --chain=0 -x dischargedelayinvert # reads the dischargedelayinvert register
- spi_slave.pl -e 0x1212 -c 0 --enablecfgflash=1 # enables the access to the config-flash
- spi_slave.pl --endpoint=0x1212 --chain=0 --dumpcfgflash > flash_dump.txt
+usage: spi_flash16bit_slaves.pl <--endpoint|e=0xYYYY> <--chain|c=N> [--register=number] [--data=number]
+
+examples: spi_flash16bit_slaves.pl -e 0x1212 -c 0 -x time # reads the compile time of 0x1212, chain 0
+ spi_flash16bit_slaves.pl -e 0x1212 -c 0 -x pwm --channel=1 # reads the threshold setting of channel 1
+ spi_flash16bit_slaves.pl -e=0x1212 -c=0 -x=inputenable --data=0xa55a # disables some channels
+ spi_flash16bit_slaves.pl --endpoint=0x1212 --chain=0 -x dischargedelayinvert -d 0xff # sets the dischargedelayinvert bits
+ spi_flash16bit_slaves.pl --endpoint=0x1212 --chain=0 -x dischargedelayinvert # reads the dischargedelayinvert register
+ spi_flash16bit_slaves.pl -e 0x1212 -c 0 --enablecfgflash=1 # enables the access to the config-flash
+ spi_flash16bit_slaves.pl --endpoint=0x1212 --chain=0 --dumpcfgflash > flash_dump.txt
Some of the commands can also be used directly, i.e. '-rr=0x12' instead of '-x=rr -register=0x12'
sendcmd16(@a);
sendcmd(0x51<<$REGNR | $WRITE | 0x4);
sendcmd(0x50<<$REGNR | $WRITE | $p);
-
+
$p++;
printf(STDERR "\r%d ",$p) if(!($p%10));
}
my @a;
for (my $i=0;$i<16;$i++) {
if ($i eq 11) {
- # adds the magic 09 the last page of the config flash
+ # adds the magic 09 the last page of the config flash
push(@a,0x40<<$REGNR | $i << $REGNR | $WRITE | 0x09);
} else {
push(@a,0x40<<$REGNR | $i << $REGNR | $WRITE | 0x0);
sendcmd16(@a);
sendcmd(0x51<<$REGNR | $WRITE | 0x4);
if (($version & 0xFF00) eq 0x100) {
- sendcmd(0x50<<$REGNR | $WRITE | 0x167e); # dirich2
+ sendcmd(0x50<<$REGNR | $WRITE | 0x167e);
} else {
- sendcmd(0x50<<$REGNR | $WRITE | 0x23fc); #padiwa amps2
- }
+ sendcmd(0x50<<$REGNR | $WRITE | 0x23fc);
+ }
}
###############################################################################