Browse Source

RF control added to the meas script.

klaute 2 years ago
parent
commit
31b88cb369
1 changed files with 20 additions and 0 deletions
  1. 20
    0
      tools/meas.py

+ 20
- 0
tools/meas.py View File

@@ -33,6 +33,10 @@ parser.add_argument("-o", "--output_file", type=str, help="")
33 33
 parser.add_argument("-g", "--show_graph", default=False, help="", action='store_true')
34 34
 # get config
35 35
 parser.add_argument("-c", "--get_config", default=False, help="", action='store_true')
36
+# enable clk
37
+parser.add_argument("-l", "--enable_clk", type=int, help="")
38
+# disable clk
39
+parser.add_argument("-L", "--disable_clk", type=int, help="")
36 40
 # save default config
37 41
 parser.add_argument("-S", "--save_config", default=False, help="", action='store_true')
38 42
 
@@ -62,6 +66,8 @@ CC_CMD_SET_DRIVE_STRENGTH = 0x04
62 66
 CC_CMD_SET_FREQ_STEP      = 0x05
63 67
 CC_CMD_START_MEASUREMENT  = 0x06
64 68
 CC_CMD_GET_CONFIG         = 0x10
69
+CC_CMD_EN_CLK             = 0x20
70
+CC_CMD_DIS_CLK            = 0x21
65 71
 CC_CMD_SAV_DFLT           = 0x22
66 72
 
67 73
 ###############################################################################
@@ -454,6 +460,20 @@ if __name__ == "__main__":
454 460
     sendSerialData([CC_CMD_GET_CONFIG])
455 461
     dataSend = dataSend + 1
456 462
 
463
+  if args.enable_clk != None:
464
+    if args.enable_clk < 0 or args.enable_clk > 2:
465
+      args.enable_clk = 0
466
+    print "Enabling clock output channel: %d" % (args.enable_clk)
467
+    sendSerialData([CC_CMD_EN_CLK, args.enable_clk])
468
+    dataSend = dataSend + 1
469
+
470
+  if args.disable_clk != None and args.enable_clk == None:
471
+    if args.disable_clk < 0 or args.disable_clk > 2:
472
+      args.disable_clk = 0
473
+    print "Disabling clock output channel: %d" % (args.disable_clk)
474
+    sendSerialData([CC_CMD_DIS_CLK, args.disable_clk])
475
+    dataSend = dataSend + 1
476
+
457 477
   if args.save_config == True:
458 478
     print "Save default configuration values..."
459 479
     sendSerialData([CC_CMD_SAV_DFLT])