Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
"""This module provides user friendly way to interact with the DGILib API."""
INTERFACE_GPIO, INTERFACE_TIMESTAMP, INTERFACE_POWER_DATA)
"""A user friendly way to interact with the DGILib API."""
"""Instantiate DGILibExtra object.""" # Add modules as classes (will be replaced by objects when used) INTERFACE_POWER: DGILibInterfacePower} # Set default values for attributes # Instantiate base class # Store arguments
# Instantiate logger
"""For usage in ``with DGILibExtra() as dgilib:`` syntax."""
# Instantiate interface objects and enable the interfaces "interfaces", self.default_enabled_interfaces): self, *self.args, **self.kwargs) else: self.interfaces[interface_id] = DGILibInterface( self, *self.args, **self.kwargs)
"""For usage in ``with DGILibExtra() as dgilib:`` syntax."""
"""Get the build information of DGILib.
Returns ------- tuple(str, str, str, str, str, str) Version information of DGILib:
- major_version: the major_version of DGILib
- minor_version: the minor_version of DGILib
- build_number: the build number of DGILib. 0 if not supported
- major_fw: the major firmware version of the connected DGI device
- minor_fw: the minor firmware version of the connected DGI device """ minor_version = self.get_minor_version()
return major_version, minor_version, build_number, major_fw, minor_fw
"""device_reset
Set the device reset line for duration seconds.""" self.target_reset(True)
"""get_time_factor
Get the factor to multiply timestamps by to get seconds.
Returns ------- float Timer factor """ _, config_value = self.interface_get_configuration(INTERFACE_TIMESTAMP) timer_prescaler = config_value[0] timer_frequency = config_value[1]
if self.verbose: f"timer_factor: {timer_prescaler / timer_frequency}, " f"timer_prescaler: {timer_prescaler}, timer_frequency: " f"{timer_frequency}")
"""empty_data
Populate self.data with an empty data structure (of type :class:`LoggerData`).
Parameters ---------- interfaces : list(int, int, ...) List of interface ids. (default: `self.enabled_interfaces`) """ if interfaces is None: interfaces = self.enabled_interfaces self.data = LoggerData(interfaces) |