Commit b1f2cb7de3c80007459e3295c711c4691f7657bc
1 parent
d39e53ad2b
Exists in
master
first commit
Showing 3 changed files with 37 additions and 0 deletions Inline Diff
redpitaya/server/README
| File was created | 1 | assumed liboscimp_fpga.so is in /usr/lib/ |
redpitaya/server/tests/set_offset.py
| File was created | 1 | #!/usr/bin/env python | ||
| 2 | import ctypes, argparse | |||
| 3 | import liboscimp_fpga | |||
| 4 | ||||
| 5 | def parse(): | |||
| 6 | parser = argparse.ArgumentParser(description = 'Set offsets to DAC1 and DAC2') | |||
| 7 | parser.add_argument('-of1', | |||
| 8 | action='store', | |||
| 9 | dest='of1', | |||
| 10 | default=0, | |||
| 11 | help='DAC1 offset (bits)') | |||
| 12 | parser.add_argument('-of2', | |||
| 13 | action='store', | |||
| 14 | dest='of2', | |||
| 15 | default=0, | |||
| 16 | help='DAC2 offset (bits)') | |||
| 17 | args = parser.parse_args() | |||
| 18 | return args | |||
| 19 | ||||
| 20 | def main(): | |||
| 21 | args = parse() | |||
| 22 | of1 = int(args.of1) | |||
| 23 | of2 = int(args.of2) | |||
| 24 | liboscimp_fpga.add_const_set_offset("/dev/add_const_0", of1) | |||
| 25 | liboscimp_fpga.add_const_set_offset("/dev/add_const_1", of2) | |||
| 26 | print('offset DAC1 : %i'%of1) | |||
| 27 | print('offset DAC2 : %i'%of2) |
redpitaya/server/tests/test.py
| File was created | 1 | import time | ||
| 2 | ||||
| 3 | with open('/dev/data16_adc12', 'r') as f: | |||
| 4 | for line in f: | |||
| 5 | print(line.encode('bin')) |