kp.core
kp.core.connect_devices(usb_port_ids)
To connect multiple (including one) Kneron devices.
-
Parameters
usb_port_ids :
List
[int
]An list contains device’s port ID which can be known from scan_devices(), if [0] is given then it will try to connect first connectable device.
-
Returns
device_group :
kp.DeviceGroup
Represents a set of devices handle.
-
Raises
-
Return type
kp.core.disable_firmware_log(device_group)
Disable firmware log of all devices with firmware log enabled.
-
Parameters
device_group :
kp.DeviceGroup
A set of devices handle.
-
Raises
-
Return type
kp.core.disconnect_devices(device_group)
To disconnect a Kneron device.
-
Parameters
device_group :
kp.DeviceGroup
A set of devices handle.
-
Raises
-
Return type
kp.core.enable_firmware_log(device_group, usb_port_id, log_file_path)
Enable firmware log from certain device.
-
Parameters
device_group :
kp.DeviceGroup
A set of devices handle.
usb_port_id :
int
The device port ID to enable firmware log.
log_file_path :
str
The log file output path.
-
Raises
-
Return type
kp.core.get_model_info(device_group, usb_port_id)
Get model information (crc, model id, etc.).
-
Parameters
device_group :
kp.DeviceGroup
A set of devices handle.
usb_port_id :
int
Specific device port ID.
-
Returns
model_nef_descriptor :
kp.ModelNefDescriptor
ModelNefDescriptor object for describing the uploaded models.
-
Raises
-
Return type
kp.core.get_system_info(device_group, usb_port_id)
Get system information (kn number and firmware version).
-
Parameters
device_group :
kp.DeviceGroup
A set of devices handle.
usb_port_id :
int
Specific device port ID.
-
Returns
system_info :
kp.SystemInfo
SystemInfo object for describing the system information of specific device.
-
Raises
-
Return type
kp.core.get_version()
Get Kneron PLUS version
-
Returns
plus_version_string :
str
Kneron PLUS version string.
-
Return type
kp.core.install_driver_for_windows(product_id)
Install device driver on Windows
-
Parameters
product_id :
kp.ProductId
enum for USB PID(Product ID).
-
Raises
-
Return type
kp.core.load_encrypted_models(device_group, nef_buffer_list)
Upload encrypted NEF models data bytes to device through USB.
-
Parameters
device_group :
kp.DeviceGroup
A set of devices handle.
nef_buffer_list :
List
[bytes
]A list of byte buffer that contains the content of encrypted NEF file(s).
-
Returns
model_nef_descriptor :
kp.ModelNefDescriptor
ModelNefDescriptor object for describing the uploaded models.
-
Raises
-
Return type
kp.core.load_encrypted_models_from_file(device_group, file_path_list)
Upload encrypted NEF Models to device through USB by encrypted NEF file path(s).
-
Parameters
device_group :
kp.DeviceGroup
A set of devices handle.
file_path_list :
List
[str
]A list of encrypted NEF model file path(s).
-
Returns
model_nef_descriptor :
kp.ModelNefDescriptor
ModelNefDescriptor object for describing the uploaded models.
-
Raises
ApiKPException
-
Return type
kp.core.load_firmware(device_group, scpu_fw_buffer, ncpu_fw_buffer)
Upload firmware data bytes to device through USB.
-
Parameters
device_group :
kp.DeviceGroup
A set of devices handle.
scpu_fw_buffer :
bytes
A bytes buffer contains the content of SCPU firmware file.
ncpu_fw_buffer :
bytes
A bytes buffer contains the content of NCPU firmware file.
-
Raises
-
Return type
kp.core.load_firmware_from_file(device_group, scpu_fw_path, ncpu_fw_path)
Upload firmware to device through USB by firmware file path.
-
Parameters
device_group :
kp.DeviceGroup
A set of devices handle.
scpu_fw_path :
str
SCPU firmware file path.
ncpu_fw_path :
str
NCPU firmware file path.
-
Raises
-
Return type
kp.core.load_model(device_group, nef_buffer)
Upload NEF models data bytes to device through USB.
-
Parameters
device_group :
kp.DeviceGroup
A set of devices handle.
nef_buffer :
bytes
A bytes buffer contains the content of NEF file.
-
Returns
model_nef_descriptor :
kp.ModelNefDescriptor
ModelNefDescriptor object for describing the uploaded models.
-
Raises
-
Return type
kp.core.load_model_from_file(device_group, file_path)
Upload NEF Model to device through USB by NEF file path.
-
Parameters
device_group :
kp.DeviceGroup
A set of devices handle.
file_path :
str
NEF model file path.
-
Returns
model_nef_descriptor :
kp.ModelNefDescriptor
ModelNefDescriptor object for describing the uploaded models.
-
Raises
ApiKPException
-
Return type
kp.core.load_model_from_flash(device_group)
Load model from device flash (Please update NEF model in flash by Kneron DFUT).
-
Parameters
device_group :
kp.DeviceGroup
A set of devices handle.
-
Returns
model_nef_descriptor :
kp.ModelNefDescriptor
ModelNefDescriptor object for describing the uploaded models.
-
Raises
-
Return type
kp.core.reset_device(device_group, reset_mode, sleep_secs=0)
Reset the device in hardware mode or software mode.
-
Parameters
device_group :
kp.DeviceGroup
A set of devices handle.
reset_mode :
kp.ResetMode
Refer to ResetMode.
sleep_secs :
float
Set sleep time in seconds for reboot device.
-
Raises
-
Return type
kp.core.scan_devices()
Scan all Kneron devices and report a list. This function can get devices connectivity information at runtime.
-
Returns
device_descriptor_list :
kp.DeviceDescriptorList
DeviceDescriptorList object, contain information of connected devices from USB perspectives.
-
Return type
kp.core.set_timeout(device_group, milliseconds)
To set a global timeout value for all USB communications with the device.
-
Parameters
device_group :
kp.DeviceGroup
A set of devices handle.
milliseconds :
int
Pre-set timeout value in milliseconds.
-
Return type