return trb_register_read($board,0xd412);
}
-sub sendcmd_bitbang {
- my $cmd = shift;
- #csb low
- trb_register_write($board,0xa080,0x11);
-
- for my $j (0..23) {
- my $b = ($cmd>>(23-$j)) & 1;
- $b = $b << 5;
- trb_register_write($board,0xa080,0x01 | $b);
- trb_register_write($board,0xa080,0x11 | $b);
- }
- #csb high
- trb_register_write($board,0xa080,0x51);
-}
-sub sendcmd_bitbang_single {
+sub sendcmd_bitbang {
my $cmd = shift;
# we use the padiwa register to control
# so set the global CSB high (and keep it high, see for loop
# the instruction bits is simply the $adc_reg value, since
# the bit31 should be zero for writing, and bit30/29 should be
# 0 to request to write one byte
- sendcmd_bitbang_single( ($adc_reg << 8)
+ sendcmd_bitbang( ($adc_reg << 8)
+ ($adc_val << 0));#,
#$chain{adc});