Files
echart/api_document/03.control_object.i2c_slave.udp_rate_limiter.txt
T
simonandClaude Opus 4.7 eedead0d41 feat: 全面代码更新 - ECharts 5.4.2 重构、新增量化分析模块、前端库升级
- 升级 ECharts 到 5.4.2,重构 lib/ 目录结构
- 新增 DataTables 2.x 和 FixedColumns 插件
- 新增 quant/ 宏观研究报告模块
- 重构图表页面:stock_trend、hkholdbycode 等采用 JS fetch API.doorcome.cn 模式
- 新增 CLAUDE.md 补充页面文档和新数据流说明
- 更新 inc/config.php TuShare API 配置
- 更新新闻联播分析模块 news/ 和相关研究报告 research/
- 新增 api_document/ 参考文档
- 清理 .gitignore,排除 uploads/xls/.mcp.json/ source maps 等非代码文件
- 所有 PHP 文件通过 php -l 语法检查

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-06 18:01:55 +08:00

333 lines
9.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
hailo_platform.pyhailort.control_object
Control operations for the Hailo hardware device.
exception hailo_platform.pyhailort.control_object.ControlObjectException[source]
Bases: Exception
Raised on illegal ContolObject operation.
exception hailo_platform.pyhailort.control_object.FirmwareUpdateException[source]
Bases: Exception
class hailo_platform.pyhailort.control_object.HailoControl(device: hailo_platform.pyhailort._pyhailort.Device)[source]
Bases: hailo_platform.pyhailort.pyhailort.Control
Control object that sends control operations to a Hailo hardware device.
class hailo_platform.pyhailort.control_object.HcpControl(device: hailo_platform.pyhailort._pyhailort.Device)[source]
Bases: hailo_platform.pyhailort.control_object.HailoControl
Control object that uses the HCP protocol for controlling the device.
class hailo_platform.pyhailort.control_object.UdpHcpControl(remote_ip, device=None, remote_control_port=22401, retries=2, response_timeout_seconds=10.0, ignore_socket_errors=False)[source]
Bases: hailo_platform.pyhailort.control_object.HcpControl
Control object that uses a HCP over UDP controller interface.
__init__(remote_ip, device=None, remote_control_port=22401, retries=2, response_timeout_seconds=10.0, ignore_socket_errors=False)[source]
Initializes a new UdpControllerControl object.
Parameters
remote_ip (str) The IPv4 address of the remote Hailo device (X.X.X.X).
remote_control_port (int, optional) The port that the remote Hailo device listens on.
response_timeout_seconds (float, optional) Number of seconds to wait until a response is received.
ignore_socket_errors (bool, optional) Ignore socket error (might be usefull for debugging).
class hailo_platform.pyhailort.control_object.PcieHcpControl(device=None, device_info=None)[source]
Bases: hailo_platform.pyhailort.control_object.HcpControl
Control object that uses a HCP over PCIe controller interface.
__init__(device=None, device_info=None)[source]
Initializes a new HailoPcieController object.
hailo_platform.pyhailort.hailo_controller.i2c_slaves
hailo_platform.pyhailort.i2c_slaves.NO_I2C_SWITCH = 5
Variable which defines that the I2C slave is not behind a switch.
exception hailo_platform.pyhailort.i2c_slaves.I2CSlavesException[source]
Bases: Exception
class hailo_platform.pyhailort.i2c_slaves.I2CSlave(name, bus_index, slave_address, switch_number=5, register_address_size=1, endianness=<Endianness.LITTLE_ENDIAN: 1>, should_hold_bus=False)[source]
Bases: object
__init__(name, bus_index, slave_address, switch_number=5, register_address_size=1, endianness=<Endianness.LITTLE_ENDIAN: 1>, should_hold_bus=False)[source]
Initialize a class which describes an I2C slave.
Parameters
name (str) The name of the I2C slave.
bus_index (int) The bus number the I2C slave is connected to.
slave_address (int) The address of the I2C slave.
switch_number (int) The number of the switch the i2c salve is connected to.
register_address_size (int) Slave register address length (in bytes).
endianness (Endianness) The endianness of the slave.
should_hold_bus (bool) Should hold the bus during the read.
property name
Get the name of the I2C slave.
Returns
Name of the I2C slave.
Return type
str
property bus_index
Get bus index the I2C slave is connected to.
Returns
Index of the bus the I2C slave is connected to.
Return type
int
property slave_address
Get the address of the salve.
Returns
The address of the I2C slave.
Return type
int
property register_address_size
Get the slave register address length (in bytes). This number represents how many bytes are in the register address the slave can access.
Returns
Slave register address length.
Return type
int
Note
Pay attention to the slave endianness (Endianness).
property switch_number
Get the switch number the slave is connected to.
Returns
The number of the switch the I2C is behind.
Return type
int
Note
If NO_I2C_SWITCH is returned, it means the slave is not behind a switch.
property endianness
Get the slave endianness.
Returns
The slave endianness.
Return type
Endianness
property should_hold_bus
Returns a Boolean indicating if the bus will be held while reading from the slave.
Returns
True if the bus would be held, otherwise False.
Return type
bool
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_MIPI_AVDD
Class which represents the MIPI AVDD I2C slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_USB_AVDD_IO
Class which represents the USB AVDD IO slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_VDD_CORE
Class which represents the V_CORE slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_VDD_TOP
Class which represents the VDD TOP slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_MIPI_AVDD_H
Class which represents the MIPI AVDD_H I2C slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_USB_AVDD_IO_HV
Class which represents the DVM USB AVDD IO HV slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_VDD_IO
Class which represents the DVM_VDDIO slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_AVDD_H
Class which represents the DVM_AVDD_H slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_SDIO_VDD_IO
Class which represents the DVM_SDIO_VDDIO slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_M_DOT_2_OVERCURREN_PROTECTION
Class which represents the DVM_SDIO_VDDIO slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_I2S_CODEC
Class which represents the I2S codec I2C slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_I2C_TO_GPIO
Class which represents the I2C to gpio I2C slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_SWITCH
Class which represents the I2C switch slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_TEMP_SENSOR_0
Class which represents the I2C TEMP_sensor_0 slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_TEMP_SENSOR_1
Class which represents the I2S TEMP_sensor_1 slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_EEPROM
Class which represents the EEPROM I2C slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_RASPICAM
Class which represents the raspicam I2C slave.
hailo_platform.pyhailort.i2c_slaves.set_i2c_switch(control_object, slave, slave_switch=None)[source]
Set the I2C switch in order to perform actions from the I2C slave.
Parameters
control_object (HcpControl) Control object which communicates with the Hailo chip.
slave (I2CSlave) Slave which the switch is set for.
slave_switch (I2CSlave) The I2C slave for the switch it self. Defaults to I2C_SLAVE_SWITCH.
hailo_platform.tools.udp_rate_limiter
Tool for limiting the packet sending rate via UDP. Needed to ensure the board will not get more traffic than it can handle, which would cause packet loss.
exception hailo_platform.tools.udp_rate_limiter.RateLimiterException[source]
Bases: Exception
A problem has occurred during the rate setting.
exception hailo_platform.tools.udp_rate_limiter.BadTCParamError[source]
Bases: Exception
One of shells tc command params is wrong.
exception hailo_platform.tools.udp_rate_limiter.BadTCCallError[source]
Bases: Exception
Shells tc command has failed.
class hailo_platform.tools.udp_rate_limiter.RateLimiterWrapper(configured_network_group, fps=1, fps_factor=1.0, remote_ip=None)[source]
Bases: object
UDPRateLimiter wrapper enabling with statements.
__init__(configured_network_group, fps=1, fps_factor=1.0, remote_ip=None)[source]
RateLimiterWrapper constructor.
Parameters
configured_network_group (ConfiguredNetwork) The target network_group.
fps (int) Frame rate.
fps_factor (float) Safety factor by which to multiply the calculated UDP rate.
remote_ip (str) Device IP address.
class hailo_platform.tools.udp_rate_limiter.UDPRateLimiter(remote_ip, port, rate_kbits_per_sec=0)[source]
Bases: object
Enables limiting or removing limits on UDP communication rate to a board.
__init__(remote_ip, port, rate_kbits_per_sec=0)[source]
set_rate_limit()[source]
reset_rate_limit()[source]
static calc_udp_rate(hef, network_group_name, fps, fps_factor=1, max_supported_kbps_rate=850000.0)[source]
Calculates the proper UDP rate according to an HEF.
Parameters
hef (str) Path to an HEF file containing the network_group.
network_group_name (str) Name of the network_group to configure rates for.
fps (int) Frame rate.
fps_factor (float, optional) Safety factor by which to multiply the calculated UDP rate.
max_supported_kbps_rate (int, optional) Max supported Kbits per second. Defaults to 850 Mbit/s (850,000 Kbit/s).
Returns
Maps between each input default dport to its calculated Rate in Kbits/sec.
Return type
dict