Commit 7b9803b4 authored by Tomasz Wlostowski's avatar Tomasz Wlostowski

latest snapshot of the test program

parent 55c507d1
......@@ -1278,7 +1278,9 @@ int fdelay_configure_pulse_gen(fdelay_device_t *dev, int channel, int enable, fd
int fdelay_channel_triggered(fdelay_device_t *dev, int channel)
{
fd_decl_private(dev)
return chan_readl(FD_REG_DCR) & FD_DCR_PG_TRIG ? 1: 0;
uint32_t dcr= chan_readl(FD_REG_DCR);
printf("DCR%d %x\n", channel, dcr);
return dcr & FD_DCR_PG_TRIG ? 1: 0;
}
/* Todo: write get_time() */
......
......@@ -17,14 +17,14 @@ main(int argc, char *argv[])
printf("Current Time: %lld:%d\n", t_cur.utc, t_cur.coarse);
t_start.coarse = t_cur.coarse;
t_start.utc = t_cur.utc+1;
t_start.coarse = 0;//t_cur.coarse;
t_start.utc = t_cur.utc+2;
t_start.frac = 0;
fdelay_configure_pulse_gen(&dev, 1, 1, t_start, 48000LL, 100000LL, -1); /* Output 1, period = 100 ns, width = 48 ns - a bit asymmetric 10 MHz */
fdelay_configure_pulse_gen(&dev, 2, 1, t_start, 48000LL, 1000000000000LL, -1); /* Output 2: period = 1 second, width = 48 ns - PPS signal */
fdelay_configure_pulse_gen(&dev, 2, 1, t_start, 1000000000000LL/2LL, 1000000000000LL, -1); /* Output 2: period = 1 second, width = 48 ns - PPS signal */
while(!fdelay_channel_triggered(&dev, 1) || fdelay_channel_triggered(&dev, 2))
while(!fdelay_channel_triggered(&dev, 1) || !fdelay_channel_triggered(&dev, 2))
usleep(10000); /* wait until both outputs have triggered*/;
return 0;
}
......@@ -23,7 +23,7 @@ class fd_timestamp(Structure):
class FineDelay:
BASE_ADDR = 0x84000
BASE_ADDR = 0x80000
FREE_RUNNING = 0x10
WR_OFFLINE = 0x8
......@@ -39,7 +39,7 @@ class FineDelay:
self.handle = c_voidp(self.fdelay.fdelay_create_rawrabbit(c_int(fd), c_ulong(self.BASE_ADDR)));
if(c_int(self.fdelay.fdelay_load_firmware("spec_top.bin")) < 0):
if(c_int(self.fdelay.fdelay_load_firmware("../spec_top_wr.bin")) < 0):
print ("Firmware loader failed...");
sys.exit(-1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment