HAL Interface

This module allows the creation of userspace HAL components in Python. This includes pins and parameters of the various HAL types.


from qtpyvcp import hal

# create a new component and add some pins
comp = hal.getComponent("loop-back")
comp.addPin("in", "float", "in")
comp.addPin("out", "float", "out")

# mark the component as 'ready'

# define a function to call when the input pin changes
def onInChanged(new_value):
    # loop the out pin to the in pin value
    comp.getPin('out').value = new_value

# connect the listener to the input pin
comp.addListener('in', onInChanged)

Initializes a new HAL component and registers it.


Get HAL component.

Parameters:name (str) – The name of the component to get. Defaults to qtpyvcp.
Returns:An existing or new HAL component.
Return type:QComponent