24def endpoint(obj, id, device):
26 Endpoint master commands.
29 DEVICE: uhal device identifier
32 lDevice = obj.mConnectionManager.getDevice(str(device))
34 lDevice.setTimeoutPeriod(obj.mTimeout)
36 echo(
'Created endpoint device ' + style(lDevice.id(), fg=
'blue'))
37 lTopDesign = lDevice.getNode(
'')
39 lBoardInfo = toolbox.readSubNodes(lDevice.getNode(
'io.config'),
False)
42 if lBoardInfo[
'board_type'].value()
in kLibrarySupportedBoards
and lBoardInfo[
'design_type'].value()
in kLibrarySupportedDesigns:
44 lTopDesign.validate_firmware_version()
47 echo(lDevice.getNode(
'io').get_hardware_info())
49 secho(
"Failed to retrieve hardware information! I2C issue? Initial board reset needed?", fg=
'yellow')
51 secho(
"Error: {}".format(e), fg=
'red')
54 lEPNames = lDevice.getNodes(f
"endpoint{id}")
56 if len(lEPNames) == 0:
57 raise click.ClickException(f
"Endpoint {id} does not exist")
58 elif len(lEPNames) > 1:
59 raise click.ClickException(f
"Multiple endpoint {id} matches")
62 obj.mEndpoint = lDevice.getNode(f
"endpoint{id}")
63 obj.mIO = lDevice.getNode(
'io')
68@endpoint.command('freq', short_help="Measure some frequencies.")
87def enable(ctx, obj, action, address):
89 Activate timing endpoint wrapper block.
92 lEndPointNode = obj.mEndpoint
94 lEndPointNode.disable()
96 lEndPointNode.enable(address)
97 elif action ==
'reset':
98 lEndPointNode.reset(address)
106@endpoint.command('status', short_help='Display the status of timing endpoint.')
108@click.option('--watch', '-w', is_flag=True, default=False, help='Turn on automatic refresh')
109@click.option('--period', '-p', type=click.IntRange(0, 240), default=2, help=
'Period of automatic refresh')