From b1f2cb7de3c80007459e3295c711c4691f7657bc Mon Sep 17 00:00:00 2001 From: mer0m Date: Mon, 6 Feb 2017 13:40:07 +0100 Subject: [PATCH] first commit --- redpitaya/server/README | 1 + redpitaya/server/tests/set_offset.py | 30 ++++++++++++++++++++++++++++++ redpitaya/server/tests/test.py | 6 ++++++ 3 files changed, 37 insertions(+) create mode 100644 redpitaya/server/README create mode 100755 redpitaya/server/tests/set_offset.py create mode 100644 redpitaya/server/tests/test.py diff --git a/redpitaya/server/README b/redpitaya/server/README new file mode 100644 index 0000000..387101c --- /dev/null +++ b/redpitaya/server/README @@ -0,0 +1 @@ +assumed liboscimp_fpga.so is in /usr/lib/ diff --git a/redpitaya/server/tests/set_offset.py b/redpitaya/server/tests/set_offset.py new file mode 100755 index 0000000..837fd52 --- /dev/null +++ b/redpitaya/server/tests/set_offset.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python +import ctypes, argparse +import liboscimp_fpga + +def parse(): + parser = argparse.ArgumentParser(description = 'Set offsets to DAC1 and DAC2') + parser.add_argument('-of1', + action='store', + dest='of1', + default=0, + help='DAC1 offset (bits)') + parser.add_argument('-of2', + action='store', + dest='of2', + default=0, + help='DAC2 offset (bits)') + args = parser.parse_args() + return args + +def main(): + args = parse() + of1 = int(args.of1) + of2 = int(args.of2) + liboscimp_fpga.add_const_set_offset("/dev/add_const_0", of1) + liboscimp_fpga.add_const_set_offset("/dev/add_const_1", of2) + print('offset DAC1 : %i'%of1) + print('offset DAC2 : %i'%of2) + +if __name__ == "__main__": + main() diff --git a/redpitaya/server/tests/test.py b/redpitaya/server/tests/test.py new file mode 100644 index 0000000..2ba73ef --- /dev/null +++ b/redpitaya/server/tests/test.py @@ -0,0 +1,6 @@ +import time + +with open('/dev/data16_adc12', 'r') as f: + for line in f: + print(line.encode('bin')) + time.sleep(0.1) -- 2.16.4