RF control added to the meas script.

This commit is contained in:
klaute 2016-09-28 19:00:35 +02:00
parent 7a5140b313
commit 31b88cb369

View file

@ -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') parser.add_argument("-g", "--show_graph", default=False, help="", action='store_true')
# get config # get config
parser.add_argument("-c", "--get_config", default=False, help="", action='store_true') 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 # save default config
parser.add_argument("-S", "--save_config", default=False, help="", action='store_true') 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_SET_FREQ_STEP = 0x05
CC_CMD_START_MEASUREMENT = 0x06 CC_CMD_START_MEASUREMENT = 0x06
CC_CMD_GET_CONFIG = 0x10 CC_CMD_GET_CONFIG = 0x10
CC_CMD_EN_CLK = 0x20
CC_CMD_DIS_CLK = 0x21
CC_CMD_SAV_DFLT = 0x22 CC_CMD_SAV_DFLT = 0x22
############################################################################### ###############################################################################
@ -454,6 +460,20 @@ if __name__ == "__main__":
sendSerialData([CC_CMD_GET_CONFIG]) sendSerialData([CC_CMD_GET_CONFIG])
dataSend = dataSend + 1 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: if args.save_config == True:
print "Save default configuration values..." print "Save default configuration values..."
sendSerialData([CC_CMD_SAV_DFLT]) sendSerialData([CC_CMD_SAV_DFLT])