From 31b88cb36960337342b9dee3ea827ee35f19fea3 Mon Sep 17 00:00:00 2001 From: klaute Date: Wed, 28 Sep 2016 19:00:35 +0200 Subject: [PATCH] RF control added to the meas script. --- tools/meas.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/meas.py b/tools/meas.py index 089bbc5..fea3936 100644 --- a/tools/meas.py +++ b/tools/meas.py @@ -33,6 +33,10 @@ parser.add_argument("-o", "--output_file", type=str, help="") parser.add_argument("-g", "--show_graph", default=False, help="", action='store_true') # get config parser.add_argument("-c", "--get_config", default=False, help="", action='store_true') +# enable clk +parser.add_argument("-l", "--enable_clk", type=int, help="") +# disable clk +parser.add_argument("-L", "--disable_clk", type=int, help="") # save default config parser.add_argument("-S", "--save_config", default=False, help="", action='store_true') @@ -62,6 +66,8 @@ CC_CMD_SET_DRIVE_STRENGTH = 0x04 CC_CMD_SET_FREQ_STEP = 0x05 CC_CMD_START_MEASUREMENT = 0x06 CC_CMD_GET_CONFIG = 0x10 +CC_CMD_EN_CLK = 0x20 +CC_CMD_DIS_CLK = 0x21 CC_CMD_SAV_DFLT = 0x22 ############################################################################### @@ -454,6 +460,20 @@ if __name__ == "__main__": sendSerialData([CC_CMD_GET_CONFIG]) dataSend = dataSend + 1 + if args.enable_clk != None: + if args.enable_clk < 0 or args.enable_clk > 2: + args.enable_clk = 0 + print "Enabling clock output channel: %d" % (args.enable_clk) + sendSerialData([CC_CMD_EN_CLK, args.enable_clk]) + dataSend = dataSend + 1 + + if args.disable_clk != None and args.enable_clk == None: + if args.disable_clk < 0 or args.disable_clk > 2: + args.disable_clk = 0 + print "Disabling clock output channel: %d" % (args.disable_clk) + sendSerialData([CC_CMD_DIS_CLK, args.disable_clk]) + dataSend = dataSend + 1 + if args.save_config == True: print "Save default configuration values..." sendSerialData([CC_CMD_SAV_DFLT])