@@ -33,12 +33,16 @@ def parse_power(value):
3333parser_actions .add_argument ('--vtref' , type = parse_power , help = 'Set VTREF' )
3434parser_actions .add_argument ('--vtpwr' , type = parse_power , help = 'Set VTPWR' )
3535
36+ parser_options = parser .add_argument_group ('Options' )
37+ parser_options .add_argument ('--proxy' , action = 'store_true' , help = 'Use proxy interface' )
38+
3639args = parser .parse_args ()
3740
3841class Orbtrace :
3942 def __init__ (self , device ):
4043 self .trace_if = None
4144 self .power_if = None
45+ self .proxy_if = None
4246
4347 self .read_config (device )
4448
@@ -58,11 +62,15 @@ def read_config(self, device):
5862
5963 if setting .getSubClass () == ord ('P' ):
6064 self .power_if = setting .getNumber ()
65+
66+ if setting .getSubClass () == ord ('X' ):
67+ self .proxy_if = setting .getNumber ()
6168
62- def trace_set_input_format (self , format ):
63- assert self .trace_if is not None
69+ def trace_set_input_format (self , format , use_proxy = False ):
70+ if_num = self .proxy_if if use_proxy else self .trace_if
71+ assert if_num is not None
6472
65- self .handle .controlWrite (0x41 , 0x01 , input_formats [format ], self . trace_if , b'' )
73+ self .handle .controlWrite (0x41 , 0x01 , input_formats [format ], if_num , b'' )
6674
6775 def power_set_enable (self , channel , enable ):
6876 assert self .power_if is not None
@@ -105,7 +113,7 @@ def power_set_voltage(self, channel, voltage):
105113 orbtrace = Orbtrace (devices [0 ])
106114
107115 if args .input_format :
108- orbtrace .trace_set_input_format (args .input_format )
116+ orbtrace .trace_set_input_format (args .input_format , args . proxy )
109117
110118 if args .vtref :
111119 if args .vtref in ['off' , 'on' ]:
0 commit comments