Commit bd35fd256617fc948be93dc9acb47a81089deaa5
1 parent
145da201a3
Exists in
master
-
Showing 1 changed file with 30 additions and 0 deletions Inline Diff
redpitaya/server/tests/test_dac_offsets.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) |