Trigger Settings
- class Nets.TriggerSettings
Configure the trigger parameters for capturing a net's waveform. These methods can be use by nets of type
Analog
andLogic
.- get_status()
Get the net's current trigger status.
from lager import Net, NetType, TriggerStatus v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() status = v33_net.trigger_settings.get_trigger_status() print(status)
- Returns:
status
- Return type:
- set_mode_auto()
Enable continuous triggering on the given net, regardless of trigger conditions.
from lager.pcb.net import Net, NetType v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() v33_net.trigger_settings.set_mode_auto()
- set_mode_normal()
Trigger a waveform capture if all conditions of the trigger are met.
from lager.pcb.net import Net, NetType v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() v33_net.trigger_settings.set_mode_normal()
- set_mode_single()
Trigger once then stop.
from lager.pcb.net import Net, NetType v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() v33_net.trigger_settings.set_mode_single()
- get_mode()
Get the current trigger mode.
from lager.pcb.net import Net, NetType, TriggerMode v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() mode = v33_net.trigger_settings.get_trigger_mode() print(mode)
- Returns:
mode
- Return type:
- set_coupling_AC()
Set the trigger coupling to AC
from lager.pcb.net import Net, NetType v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() v33_net.trigger_settings.set_coupling_AC()
- set_coupling_DC()
Set the trigger coupling to DC
from lager import Net, NetType v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() v33_net.trigger_settings.set_coupling_DC()
- set_coupling_low_freq_reject()
Enable low frequency rejection coupling
from lager import Net, NetType v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() v33_net.trigger_settings.set_coupling_low_freq_reject()
- set_coupling_high_freq_reject()
Enable high frequency rejection coupling
from lager import Net, NetType v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() v33_net.trigger_settings.set_coupling_high_freq_reject()
- get_coupling()
Get coupling type
from lager import Net, NetType, TriggerCoupling v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() coupling = v33_net.trigger_settings.get_coupling() print(coupling)
- Returns:
mode
- Return type:
- set_type(trigger_type)
Set the trigger type
from lager import Net, NetType, TriggerType v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() v33_net.trigger_settings.set_type(TriggerType.Edge)
- Parameters:
trigger_type (TriggerType) -- Type of trigger to use
- get_type()
Get the trigger type
from lager import Net, NetType, TriggerType v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() type = v33_net.trigger_settings.get_trigger_type() print(type)
- Returns:
type
- Return type:
- class Nets.TriggerSettingsEdge
Configure edge triggers. These methods can be use by nets that support
TriggerSettings
.- set_slope_rising()
Set the edge trigger parameter to rising edge
from lager import Net, NetType v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() v33_net.trigger_settings.set_type(TriggerType.Edge) v33_net.trigger_settings.edge.set_slope_rising()
- set_slope_falling()
Set the edge trigger parameter to falling edge
from lager import Net, NetType, TriggerType v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() v33_net.trigger_settings.set_type(TriggerType.Edge) v33_net.trigger_settings.edge.set_slope_falling()
- set_slope_both()
Set the edge trigger parameter to both edges (rising and falling)
from lager import Net, NetType, TriggerType v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() v33_net.trigger_settings.set_type(TriggerType.Edge) v33_net.trigger_settings.edge.set_slope_both()
- get_slope()
Get the trigger edge slope condition
from lager import Net, NetType, TriggerType v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() v33_net.trigger_settings.set_type(TriggerType.Edge) v33_net.trigger_settings.edge.set_slope_both() slope = v33_net.trigger_settings.edge.get_slope() print(slope)
- Returns:
Edge slope type
- Return type:
- set_level(level)
Set the trigger edge level
from lager import Net, NetType, TriggerType v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() v33_net.trigger_settings.set_type(TriggerType.Edge) v33_net.trigger_settings.edge.set_level(1.8) #Set trigger value to 1.8V
- Parameters:
level (float) -- voltage level for trigger value in Volts
- get_level()
Get the edge slope
from lager import Net, NetType, TriggerType v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() v33_net.trigger_settings.set_type(TriggerType.Edge) v33_net.trigger_settings.edge.set_level(1.8) level = v33_net.trigger_settings.edge.get_level() print(level)
- Returns:
Edge voltage level in Volts
- Return type:
float
- set_source(net)
Set the trigger edge source
from lager import Net, NetType, TriggerType v33_net = Net.get('+3.3V', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) button_net = Net.get('BTN', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) v33_net.enable() v33_net.trigger_settings.set_type(TriggerType.Edge) v33_net.trigger_settings.edge.set_source(button_net)
- Parameters:
source (Net) -- Trigger source
- class Nets.TriggerSettingsPulse
Configure pulse triggers. These methods can be use by nets that support
TriggerSettings
.- set_level(level)
Set minimum required voltage level for pulse signal to be used as trigger.
from lager import Net, NetType, TriggerType pwm_net = Net.get('MOTOR_PWM', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) pwm_net.enable() pwm_net.trigger_settings.set_type(TriggerType.Pulse) pwm_net.trigger_settings.pulse.set_level(2.3)
- Parameters:
level (float) -- voltage level
- get_level()
Get minimum required voltage level of trigger source.
from lager import Net, NetType, TriggerType pwm_net = Net.get('MOTOR_PWM', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) pwm_net.enable() pwm_net.trigger_settings.set_type(TriggerType.Pulse) print(pwm_net.trigger_settings.pulse.get_level())
- Returns:
Minimum voltage level
- Return type:
float
- set_trigger_on_pulse_greater_than_width(pulse_width)
Trigger a waveform capture if pulse width is greater than set width.
from lager import Net, NetType, TriggerType pwm_net = Net.get('MOTOR_PWM', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) pwm_net.enable() pwm_net.trigger_settings.set_type(TriggerType.Pulse) pwm_net.trigger_settings.pulse.set_trigger_on_pulse_greater_than_width(.0001) :param float pulse_width: Minimum pulse width for capture to be triggered
- set_trigger_on_pulse_less_than_width(pulse_width)
Trigger a waveform capture if pulse width is less than set width.
from lager import Net, NetType, TriggerType pwm_net = Net.get('MOTOR_PWM', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) pwm_net.enable() pwm_net.trigger_settings.set_type(TriggerType.Pulse) pwm_net.trigger_settings.pulse.set_trigger_on_pulse_less_than_width(.001) :param float pulse_width: Minimum pulse width for capture to be triggered
- set_trigger_on_pulse_less_than_greater_than(max_pulse_width=None, min_pulse_width=None)
Trigger a waveform capture if pulse width is between the lower and upper bound.
from lager import Net, NetType, TriggerType pwm_net = Net.get('MOTOR_PWM', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) pwm_net.enable() pwm_net.trigger_settings.set_type(TriggerType.Pulse) pwm_net.trigger_settings.pulse.set_trigger_on_pulse_less_than_width(.001) :param float max_pulse_width: Maximum pulse width for capture to be triggered :param float min_pulse_width: Minimum pulse width for capture to be triggered
- set_source(net)
Set trigger pulse source.
from lager import Net, NetType, TriggerType pwm_net = Net.get('MOTOR_PWM', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) pwm_net.enable() pwm_net.trigger_settings.set_type(TriggerType.Pulse) pwm_net.trigger_settings.pulse.set_source(pwm_net)
- Parameters:
source (Net) -- Trigger source
- class Nets.TriggerSettingsUART
Configure UART triggers. These methods can be use by nets that support
TriggerSettings
.- set_level(level)
Set minimum required voltage level for UART signal to be used as trigger.
from lager import Net, NetType, TriggerType tx_net = Net.get('UART.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.UART) tx_net.trigger_settings.uart.set_level(2.3)
- Parameters:
level (float) -- voltage level
- get_level()
Get minimum required voltage level of uart trigger source.
from lager import Net, NetType, TriggerType tx_net = Net.get('UART.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.UART) print(tx_net.trigger_settings.uart.get_level())
- Returns:
Minimum voltage level
- Return type:
float
- set_uart_params(parity=None, stopbits=None, baud=None, bits=None)
Set UART trigger bus parameters.
from lager import Net, NetType, TriggerType, TriggerUARTParity tx_net = Net.get('UART.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.UART) tx_net.trigger_settings.uart.set_uart_params(parity=None, stopbits=1, baud=115200, bits=8) :param TriggerUARTParity parity: UART parity :param float stopbits: Number of stopbits in data packet :param float baud: UART baud rate :param int bits: Width in bits of data
- set_trigger_on_start()
Set to trigger on start bit of UART communication.
from lager import Net, NetType, TriggerType tx_net = Net.get('UART.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.UART) tx_net.trigger_settings.uart.set_trigger_on_start()
- set_trigger_on_frame_error()
Set to trigger on a frame error.
from lager import Net, NetType, TriggerType tx_net = Net.get('UART.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.UART) tx_net.trigger_settings.uart.set_trigger_on_frame_error()
- set_trigger_on_check_error()
Set to trigger on a check error.
from lager import Net, NetType, TriggerType tx_net = Net.get('UART.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.UART) tx_net.trigger_settings.uart.set_trigger_on_check_error()
- set_trigger_on_data(data=None)
Set to trigger on a specific data value
from lager import Net, NetType, TriggerType tx_net = Net.get('UART.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.UART) tx_net.trigger_settings.uart.set_trigger_on_data(0xab) :param int data: UART data to trigger on
- set_source(net)
Set UART source for trigger.
from lager import Net, NetType, TriggerType tx_net = Net.get('UART.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.UART) tx_net.trigger_settings.uart.set_source(tx_net)
- Parameters:
source (Net) -- Trigger source
- class Nets.TriggerSettingsI2C
Configure I2C triggers. These methods can be use by nets that support
TriggerSettings
.- set_scl_trigger_level(level)
Set minimum voltage level for scl trigger source
from lager import Net, NetType, TriggerType sda_net = Net.get('I2C.SDA', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) sda_net.enable() sda_net.trigger_settings.set_type(TriggerType.I2C) sda_net.trigger_settings.i2c.set_scl_trigger_level(1.5)
- Parameters:
level (float) -- Voltage level
- get_scl_trigger_level()
Set minimum voltage level for scl trigger source
from lager import Net, NetType, TriggerType sda_net = Net.get('I2C.SDA', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) sda_net.enable() sda_net.trigger_settings.set_type(TriggerType.I2C) print(sda_net.trigger_settings.i2c.get_scl_trigger_level())
- Returns:
Minimum voltage level
- Return type:
float
- set_sda_trigger_level(level)
Set minimum voltage level for sda trigger source
from lager import Net, NetType, TriggerType sda_net = Net.get('I2C.SDA', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) sda_net.enable() sda_net.trigger_settings.set_type(TriggerType.I2C) sda_net.trigger_settings.i2c.set_sda_trigger_level(1.5)
- Parameters:
level (float) -- Voltage level
- get_sda_trigger_level()
Set minimum voltage level for sda trigger source
from lager import Net, NetType, TriggerType sda_net = Net.get('I2C.SDA', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) sda_net.enable() sda_net.trigger_settings.set_type(TriggerType.I2C) print(sda_net.trigger_settings.i2c.get_sda_trigger_level())
- Returns:
Minimum voltage level
- Return type:
float
- set_trigger_on_start()
Set trigger on start bit of I2C communications.
from lager import Net, NetType, TriggerType sda_net = Net.get('I2C.SDA', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) sda_net.enable() sda_net.trigger_settings.set_type(TriggerType.I2C) sda_net.trigger_settings.i2c.set_trigger_on_start()
- set_trigger_on_restart()
Set trigger on re-start bit of I2C communications.
from lager import Net, NetType, TriggerType sda_net = Net.get('I2C.SDA', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) sda_net.enable() sda_net.trigger_settings.set_type(TriggerType.I2C) sda_net.trigger_settings.i2c.set_trigger_on_restart()
- set_trigger_on_stop()
Set trigger on stop bit of I2C communications.
from lager import Net, NetType, TriggerType sda_net = Net.get('I2C.SDA', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) sda_net.enable() sda_net.trigger_settings.set_type(TriggerType.I2C) sda_net.trigger_settings.i2c.set_trigger_on_stop()
- set_trigger_on_nack()
Set trigger on NACK from slave device.
from lager import Net, NetType, TriggerType sda_net = Net.get('I2C.SDA', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) sda_net.enable() sda_net.trigger_settings.set_type(TriggerType.I2C) sda_net.trigger_settings.i2c.set_trigger_on_nack()
- set_trigger_on_address(bits=None, direction=None, address=None)
Set trigger on communication to specific device address.
from lager import Net, NetType, TriggerType, TriggerI2CDirection sda_net = Net.get('I2C.SDA', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) sda_net.enable() sda_net.trigger_settings.set_type(TriggerType.I2C) sda_net.trigger_settings.i2c.set_trigger_on_address(bits=7, direction=TriggerI2CDirection.Write, address=0x01) :param int bits: Width in bits of device address :param TriggerI2CDirection direction: Direction of I2C communication :param int address: Device Address
- set_trigger_on_data(width=None, data=None)
Set trigger on communication to specific data.
from lager import Net, NetType, TriggerType sda_net = Net.get('I2C.SDA', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) sda_net.enable() sda_net.trigger_settings.set_type(TriggerType.I2C) sda_net.trigger_settings.i2c.set_trigger_on_data(width=1, data=0xab) :param int width: Width in bytes of data :param int data: Device data
- set_trigger_on_addr_data(bits=None, direction=None, address=None, width=None, data=None)
Set trigger on communication to specific device address.
from lager import Net, NetType, TriggerType, TriggerI2CDirection sda_net = Net.get('I2C.SDA', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) sda_net.enable() sda_net.trigger_settings.set_type(TriggerType.I2C) sda_net.trigger_settings.i2c.set_trigger_on_addr_data(bits=7, direction=TriggerI2CDirection.Write, address=0x01, width=1, data=0xab) :param int bits: Width in bits of device address :param TriggerI2CDirection direction: Direction of I2C communication :param int address: Device Address :param int width: Width in bytes of data :param int data: Device data
- set_source(net_scl=None, net_sda=None)
Set I2C sources for trigger.
from lager import Net, NetType, TriggerType sda_net = Net.get('I2C.SDA', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) scl_net = Net.get('I2C.SCL', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) sda_net.enable() sda_net.trigger_settings.set_type(TriggerType.I2C) sda_net.trigger_settings.i2c.set_source(net_scl=scl_net, net_sda=sda_net)
- class Nets.TriggerSettingsSPI
Configure SPI triggers. These methods can be use by nets that support
TriggerSettings
.- set_sck_trigger_level(level)
Set minimum voltage level for clock trigger source
from lager import Net, NetType, TriggerType mosi_net = Net.get('SPI.MOSI', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) mosi_net.enable() mosi_net.trigger_settings.set_type(TriggerType.SPI) mosi_net.trigger_settings.spi.set_sck_trigger_level(1.5)
- Parameters:
level (float) -- Voltage level
- get_sck_trigger_level()
Set minimum voltage level for clock trigger source
from lager import Net, NetType, TriggerType mosi_net = Net.get('SPI.MOSI', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) mosi_net.enable() mosi_net.trigger_settings.set_type(TriggerType.SPI) print(mosi_net.trigger_settings.spi.get_sck_trigger_level())
- Returns:
Minimum voltage level
- Return type:
float
- set_mosi_miso_trigger_level(level)
Set minimum voltage level for data trigger source
from lager import Net, NetType, TriggerType mosi_net = Net.get('SPI.MOSI', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) mosi_net.enable() mosi_net.trigger_settings.set_type(TriggerType.SPI) mosi_net.trigger_settings.spi.set_mosi_miso_trigger_level(1.5)
- Parameters:
level (float) -- Voltage level
- get_mosi_miso_trigger_level()
Set minimum voltage level for data trigger source
from lager import Net, NetType, TriggerType mosi_net = Net.get('SPI.MOSI', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) mosi_net.enable() mosi_net.trigger_settings.set_type(TriggerType.SPI) print(mosi_net.trigger_settings.spi.get_mosi_miso_trigger_level())
- Returns:
Minimum voltage level
- Return type:
float
- set_cs_trigger_level(level)
Set minimum voltage level for chip select trigger source
from lager import Net, NetType, TriggerType mosi_net = Net.get('SPI.MOSI', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) mosi_net.enable() mosi_net.trigger_settings.set_type(TriggerType.SPI) mosi_net.trigger_settings.spi.set_cs_trigger_level(1.5)
- Parameters:
level (float) -- Voltage level
- get_cs_trigger_level()
Set minimum voltage level for chip select trigger source
from lager import Net, NetType, TriggerType mosi_net = Net.get('SPI.MOSI', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) mosi_net.enable() mosi_net.trigger_settings.set_type(TriggerType.SPI) print(mosi_net.trigger_settings.spi.get_cs_trigger_level())
- Returns:
Minimum voltage level
- Return type:
float
- set_clk_edge_positive()
Set trigger for clock sampling data on positive edge
from lager import Net, NetType, TriggerType mosi_net = Net.get('SPI.MOSI', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) mosi_net.enable() mosi_net.trigger_settings.set_type(TriggerType.SPI) mosi_net.trigger_settings.spi.set_clk_edge_positive()
- set_clk_edge_negative()
Set trigger for clock sampling data on negative edge
from lager import Net, NetType, TriggerType mosi_net = Net.get('SPI.MOSI', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) mosi_net.enable() mosi_net.trigger_settings.set_type(TriggerType.SPI) mosi_net.trigger_settings.spi.set_clk_edge_negative()
- get_clk_edge_slope()
Set minimum voltage level for chip select trigger source
from lager import Net, NetType, TriggerType, TriggerSPISlope mosi_net = Net.get('SPI.MOSI', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) mosi_net.enable() mosi_net.trigger_settings.set_type(TriggerType.SPI) print(mosi_net.trigger_settings.spi.get_clk_edge_slope())
- Returns:
Minimum voltage level
- Return type:
float
- set_trigger_on_timeout(timeout)
Set timeout value for when to trigger after the start of SPI communication start.
from lager import Net, NetType, TriggerType mosi_net = Net.get('SPI.MOSI', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) mosi_net.enable() mosi_net.trigger_settings.set_type(TriggerType.SPI) mosi_net.trigger_settings.spi.set_trigger_on_timeout(.0004)
- Parameters:
timeout (float) -- Communication trigger timeout
- get_trigger_timeout()
Get SPI trigger timeout
from lager import Net, NetType, TriggerType mosi_net = Net.get('SPI.MOSI', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) mosi_net.enable() mosi_net.trigger_settings.set_type(TriggerType.SPI) print(mosi_net.trigger_settings.spi.get_trigger_timeout())
- Returns:
Timeout value
- Return type:
float
- set_trigger_on_cs_high()
Set trigger when chip select line goes high
from lager import Net, NetType, TriggerType mosi_net = Net.get('SPI.MOSI', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) mosi_net.enable() mosi_net.trigger_settings.set_type(TriggerType.SPI) mosi_net.trigger_settings.spi.set_trigger_on_cs_high()
- set_trigger_on_cs_low()
Set trigger when chip select line goes low
from lager import Net, NetType, TriggerType mosi_net = Net.get('SPI.MOSI', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) mosi_net.enable() mosi_net.trigger_settings.set_type(TriggerType.SPI) mosi_net.trigger_settings.spi.set_trigger_on_cs_low()
- set_trigger_data(bits=None, data=None)
Set trigger for data value with given width.
from lager import Net, NetType, TriggerType mosi_net = Net.get('SPI.MOSI', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) mosi_net.enable() mosi_net.trigger_settings.set_type(TriggerType.SPI) mosi_net.trigger_settings.spi.set_trigger_data(bit=8, data=0xba)
- Parameters:
bits (int) -- Width in bits of data
data (int) -- SPI data value
- set_source(net_sck=None, net_mosi_miso=None, net_cs=None)
Set SPI sources for trigger.
from lager import Net, NetType, TriggerType mosi_net = Net.get('SPI.MOSI', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) sck_net = Net.get('SPI.SCK', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) cs_net = Net.get('SPI.CS', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) sda_net.enable() sda_net.trigger_settings.set_type(TriggerType.SPI) sda_net.trigger_settings.spi.set_source(net_sck=sck_net, net_mosi_miso=mosi_net, net_cs=cs_net)
- class Nets.TriggerSettingsCAN
Configure CAN triggers. These methods can be use by nets that support
TriggerSettings
.- set_level(level)
Set minimum required voltage level for CAN signal to be used as trigger.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_level(2.3)
- Parameters:
level (float) -- voltage level
- get_level()
Get minimum required voltage level of CAN trigger source.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) print(tx_net.trigger_settings.can.get_level())
- Returns:
Minimum voltage level
- Return type:
float
- set_baud(baud)
Set CAN trigger BAUD.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_baud(500_000)
- Parameters:
baud (float) -- CAN baud rate
- get_baud()
Get CAN trigger BAUD.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) print(tx_net.trigger_settings.can.get_baud())
- Returns:
baud rate
- Return type:
float
- set_sample_point(sample_point)
Where in data bit to sample as a percentage.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_sample_point(50)
- Parameters:
sample_point (float) -- sample point as percentage
- get_sample_point()
Get CAN trigger sample point posistion.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) print(tx_net.trigger_settings.can.get_sample_point())
- Returns:
sample point
- Return type:
int
- set_trigger_on_sof()
Set to trigger on start of frame.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_trigger_on_sof()
- set_trigger_on_eof()
Set to trigger on end of frame.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_trigger_on_eof()
- set_trigger_on_id_remote()
Set to trigger on a remote frame.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_trigger_on_id_remote()
- set_trigger_on_over_load()
Set to trigger on an over load.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_trigger_on_over_load()
- set_trigger_on_id_frame()
Set to trigger on an ID frame.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_trigger_on_id_frame()
- set_trigger_on_data_frame()
Set to trigger on a data frame.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_trigger_on_data_frame()
- set_trigger_on_id_data()
Set to trigger on a ID data.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_trigger_on_id_data()
- set_trigger_on_error_frame()
Set to trigger on an error frame.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_trigger_on_error_frame()
- set_trigger_on_error_reply()
Set to trigger on an error reply.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_trigger_on_error_reply()
- set_trigger_on_error_checksum()
Set to trigger on an crc error.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_trigger_on_error_checksum()
- set_trigger_on_error_format()
Set to trigger on a formatting error
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_trigger_on_error_format()
- set_trigger_on_error_random()
Set to trigger on a random error
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_trigger_on_error_random()
- set_trigger_on_error_bit()
Set to trigger on a bit stuff error
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_trigger_on_error_bit()
- get_trigger_condition()
Get "trigger on" condition
from lager import Net, NetType, TriggerType, TriggerCANCondition tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) print(tx_net.trigger_settings.can.get_trigger_condition())
- Returns:
sample point
- Return type:
- set_signal_type_can_high()
Set trigger signal type to raw CAN high line.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_signal_type_can_high()
- set_signal_type_can_low()
Set trigger signal type to raw CAN low line.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_signal_type_can_low()
- set_signal_type_can_diff()
Set trigger signal type to raw CAN differential signal.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_signal_type_can_diff()
- set_signal_type_can_txrx()
Set trigger signal type to tx/rx transceiver.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_signal_type_can_txrx()
- get_signal_type()
Get trigger signal type
from lager import Net, NetType, TriggerType, TriggerCANSigType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) print(tx_net.trigger_settings.can.get_signal_type())
- Returns:
sample point
- Return type:
- set_source(net)
Set CAN source for trigger.
from lager import Net, NetType, TriggerType tx_net = Net.get('CAN.TX', type=NetType.Analog, setup_function=setup_net, teardown_function=teardown_net) tx_net.enable() tx_net.trigger_settings.set_type(TriggerType.CAN) tx_net.trigger_settings.can.set_source(tx_net)
- class Nets.TriggerStatus(enum)
Status of the trigger.
- TRIGGERED
- WAITING
- TRIGGERING
- AUTO_TRIGGERING
- STOPPED