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 Python bindings for the Housekeeping API of DGILib."""
"""Python bindings for DGILib Housekeeping.
DGILib is a Dynamic-Link Library (DLL) to help software applications communicate with Data Gateway Interface (DGI) devices. See the Data Gateway Interface user guide for further details. DGILib handles the low-level USB communication and adds a level of buffering for minimizing the chance of overflows. The library helps parse data streams of high complexity. """
"""`connect`.
Opens a connection to the specified device. This function must be called prior to any function requiring the connection handle.
`int connect(char* sn, uint32_t* dgi_hndl_p)`
+------------+------------+ | Parameter | Description | +============+============+ | *sn* | Buffer holding the serial number of the device to open a connection to | | *dgi_hndl_p* | Pointer to a variable that will hold the handle of the connection | +------------+------------+
:param device_sn: Serial number of the device :type device_sn: str :return: Variable that holds the handle of the connection :rtype: c_uint() :raises: :exc:`DeviceReturnError` """
# Initialize (not in manual, exists in dgilib.h) # self.dgilib.Initialize(byref(dgi_hndl))
raise DeviceReturnError(f"connect returned: {res}")
"""`disconnect`.
Closes the specified connection.
`int disconnect(uint32_t dgi_hndl)`
+------------+------------+ | Parameter | Description | +============+============+ | *dgi_hndl* | Handle of the connection | +------------+------------+
:raises: :exc:`DeviceReturnError` """ raise DeviceReturnError(f"disconnect returned: {res}")
# UnInitialize (not in manual, exists in dgilib.h) # self.dgilib.UnInitialize(dgi_hndl)
"""`connection_status`.
Verifies that the specified connection is still open.
`int connection_status(uint32_t* dgi_hndl)`
+------------+------------+ | Parameter | Description | +============+============+ | *dgi_hndl* | Handle of the connection | +------------+------------+
:return: A non-zero return value indicates a connection error. :rtype: int """
"""`get_major_version`.
Get the major version of the DGI library.
`int get_major_version(void)`
:return: The major version of the DGI library :rtype: int """
"""`get_minor_version`.
Get the minor version of the DGI library.
`int get_minor_version(void)`
:return: The minor version of the DGI library :rtype: int """
"""`get_build_number`.
Get the major version of the DGI library.
Returns the build number of DGILib. If not supported, returns 0.
`int get_build_number(void)`
:return: The build number of DGILib. If not supported, returns 0. :rtype: int """
"""`get_fw_version`.
Gets the firmware version of the DGI device connected. Note that this is the version of the DGI device, and not the tool.
`int get_fw_version(uint32_t dgi_hndl, unsigned char* major, unsigned char* minor)`
+------------+------------+ | Parameter | Description | +============+============+ | *dgi_hndl* | Handle of the connection | | *major* | Pointer to a variable where the major version will be stored | | *minor* | Pointer to a variable where the minor version will be stored | +------------+------------+
:return: Version information of the DGI device: - major_fw: the major firmware version of the DGI device connected - minor_fw: the minor firmware version of the DGI device connected :rtype: tuple(int, int) """ self.dgi_hndl, byref(major_fw), byref(minor_fw)) raise DeviceReturnError(f"get_fw_version returned: {res}")
"""`start_polling`.
This function will start the polling system and start acquisition on enabled interfaces. It is possible to enable/disable interfaces both before and after the polling has been started. However, no data will be transferred until the polling is started.
`int start_polling(uint32_t dgi_hndl)`
+------------+------------+ | Parameter | Description | +============+============+ | *dgi_hndl* | Handle of the connection | +------------+------------+
:param dgi_hndl: Handle of the connection :type dgi_hndl: c_uint() :raises: :exc:`DeviceReturnError` """ raise DeviceReturnError(f"start_polling returned: {res}")
"""`stop_polling`.
This function will stop the polling system and stop acquisition on all interfaces.
`int stop_polling(uint32_t dgi_hndl)`
+------------+------------+ | Parameter | Description | +============+============+ | *dgi_hndl* | Handle of the connection | +------------+------------+
:param dgi_hndl: Handle of the connection :type dgi_hndl: c_uint() :raises: :exc:`DeviceReturnError` """ raise DeviceReturnError(f"stop_polling returned: {res}")
"""`target_reset`.
This function is used to control the state of the reset line connected to the target, if available.
`int target_reset(uint32_t dgi_hndl, bool hold_reset)`
+------------+------------+ | Parameter | Description | +============+============+ | *dgi_hndl* | Handle of the connection | | *hold_reset* | True will assert reset, false will release it | +------------+------------+
:param hold_reset: True will assert reset, False will release it :type hold_reset: bool :raises: :exc:`DeviceReturnError` """ self.dgi_hndl, hold_reset) raise DeviceReturnError(f"target_reset returned: {res}") |