USB - USB suspend介绍

USB 挂起是 USB(通用串行总线)规范中定义的一种省电功能,它允许 USB 设备在不使用时进入低功耗状态。这种机制对于节省电能至关重要,尤其是在笔记本电脑和平板电脑等电池供电的设备中。

下面是 USB 挂起的详细说明:

1,挂起状态: 当 USB 设备闲置(即不传输数据)一段时间后,主机(如电脑)可发出信号,让设备进入挂起状态。在这种状态下,设备的功耗极低。

2,唤醒机制: 设备可通过用户交互(如移动鼠标、按键盘上的键)或主机命令等特定事件从挂起状态唤醒。

3,选择性挂起: 它允许独立暂停单个 USB 端口或设备,而不是暂停整个 USB 总线。它只暂停不使用的设备,从而提高了能效。

4,电源管理: USB 挂起功能允许外围设备在不需要时进入低功耗模式,有助于实现整体电源管理。这对于依赖电池供电的移动设备尤为重要。

5,合规性和支持: USB 挂起是 USB 规范的一部分(从 USB 1.1 开始,并在 USB 2.0 和 USB 3.x 等后续版本中得到完善),合规设备必须支持该功能,以确保互操作性和电源效率。

总之,USB 挂起是一项旨在降低功耗的功能,当 USB 设备不使用时,可将其置于低功耗状态,从而延长便携式设备的电池寿命并降低总体能耗。

USB suspend is a power-saving feature defined in the USB (Universal Serial Bus) specifications that allows a USB device to enter a low-power state when it is not actively in use. This mechanism is crucial for conserving power, especially in battery-powered devices like laptops and tablets.

Here’s a more detailed breakdown of USB suspend:

1. Suspend State: When a USB device is idle (i.e., not transferring data) for a certain period, the host (e.g., computer) can signal the device to enter a suspend state. In this state, the device consumes minimal power.

2. Wake-Up Mechanism: The device can be woken up from the suspend state by specific events such as user interaction (e.g., moving a mouse, pressing a key on a keyboard) or commands from the host.

3. Selective Suspend: This allows individual USB ports or devices to be suspended independently rather than suspending the entire USB bus. It enhances power efficiency by suspending only those devices that are not in use.

4. Power Management: USB suspend helps in overall power management by allowing peripheral devices to enter a low-power mode when they are not needed. This is particularly important for mobile devices that rely on battery power.

5. Compliance and Support: USB suspend is part of the USB specification (starting from USB 1.1 and refined in later versions like USB 2.0 and USB 3.x), and compliant devices must support this feature to ensure interoperability and power efficiency.

In summary, USB suspend is a feature designed to reduce power consumption by putting USB devices into a low-power state when they are not in active use, thereby extending the battery life of portable devices and reducing energy consumption in general.

USB 挂起过程是一种电源管理功能,可让 USB 设备在不与主机(如计算机)通信时进入低功耗状态。下面是 USB 挂起过程的详细说明:

1,发起挂起

a. 空闲检测:

  • USB 主机控制器监控所连接 USB 设备的活动。

  • 如果设备闲置(即不传输数据)达到指定时间(通常为 3 毫秒无总线活动),主机将决定挂起该设备。

b. 挂起信号:

  • 主机通过停止 USB 总线上该设备的所有通信,向该设备发出进入挂起状态的信号。

  • 总线活动消失超过 3 毫秒,意味着该设备接收到了进入挂起模式的信号。

2. 进入挂起状态

a. 设备响应:

  • 检测到总线活动消失时,USB 设备将进入挂起状态。

  • 设备会大幅降低功耗,关闭大部分内部功能和电路。

b. 降低功耗:

  • 全速和低速设备的电流不应超过 2.5 mA。

  • 高速设备的目标也是将电流消耗限制在 2.5 mA,但可能会允许短暂的较高电流间隔,以完成进入挂起状态的必要任务。

3. 选择性挂起(可选)

  • 选择性挂起允许主机独立挂起个别设备或端口,而不是挂起整个总线。当只有特定设备不使用时,这对节约电能特别有用。

4. 从挂起状态恢复

a. 远程唤醒:

  • 某些 USB 设备支持一种称为远程唤醒的功能,允许它们通知主机向其发出唤醒信号。

  • 设备会产生一个恢复信号,这是 USB 总线上的一个电信号,表示它要退出挂起模式。

b. 主机发起退出挂起:

  • 主机可通过向设备发送恢复信号发起退出挂起的过程。

  • 该信号由短暂的总线活动组成,被挂起的设备可识别该活动,并提示其唤醒。

5. 唤醒机制

a. 恢复通信:

  • 接收到唤醒信号(来自设备或主机)后,主机与设备之间恢复正常通信。

  • 设备恢复正常工作电源并重新启动其功能。

b. 恢复时间:

  • 恢复后,设备会经历一个短暂的稳定期,以确保其可正常运行。

6. 合规性和配置

a. USB 规范:

  • USB 挂起和恢复机制是 USB 标准规范的一部分,确保所有符合标准的设备都支持这些省电功能。

b. 驱动程序和固件:

  • USB 设备驱动程序和固件必须正确处理挂起和恢复过程。

  • 这包括在挂起前保存设备状态,以及在退出挂起后恢复设备状态,以确保无缝操作。

总结

USB 挂起是一项重要的电源管理功能,可让 USB 设备在空闲时进入低功耗状态,从而节约能源。该过程包括检测空闲时间、向设备发出进入挂起模式的信号,以及为主机和设备提供唤醒和恢复正常运行的机制。选择性挂起允许挂起个别设备而不影响整个 USB 总线,从而提高了能效。要正确实现这些功能,必须遵守 USB 规范,并精心设计设备驱动程序和固件。

The USB suspend process is a power management feature that allows USB devices to enter a low-power state when they are not actively communicating with the host (e.g., a computer). Here is a detailed explanation of the USB suspend process:

1. Initiation of Suspend

a. Idle Detection:

* The USB host controller monitors the activity of connected USB devices.

* If a device has been idle (i.e., not transferring data) for a specified period (typically 3 milliseconds of no bus activity), the host decides to suspend the device.

b. Suspend Signaling:

* The host signals the device to enter the suspend state by ceasing all communication on the USB bus for that device.

* The absence of bus activity for more than 3 milliseconds signals the device to enter the suspend mode.

2. Entering Suspend State

a. Device Response:

* Upon detecting the lack of bus activity, the USB device transitions into the suspend state.

* The device significantly reduces its power consumption, shutting down most of its internal functions and circuits.

b. Power Reduction:

* Full-speed and low-speed devices should not draw more than 2.5 mA of current.

* High-speed devices also aim to limit current draw to 2.5 mA, though brief intervals of higher current may be allowed to complete necessary tasks for entering suspend state.

3. Selective Suspend (Optional)

* Selective suspend allows the host to suspend individual devices or ports independently, rather than suspending the entire bus. This is particularly useful for conserving power when only specific devices are not in use.

4. Resuming from Suspend

a. Remote Wakeup:

* Some USB devices support a feature called remote wakeup, allowing them to signal the host to wake them up.

* The device generates a resume signal, an electrical signal on the USB bus indicating it wants to exit the suspend mode.

b. Host Initiated Resume:

* The host can initiate the resume process by sending a resume signal to the device.

* This signal consists of brief bus activity that the suspended device recognizes, prompting it to wake up.

5. Wake-Up Mechanism

a. Resuming Communication:

* Upon receiving a wake-up signal (either from the device or the host), normal communication between the host and the device resumes.

* The device restores its normal operating power and reactivates its functions.

b. Recovery Time:

* After resuming, the device undergoes a brief stabilization period to ensure it is ready for normal operations.

6. Compliance and Configuration

a. USB Specification:

* The USB suspend and resume mechanisms are part of the USB standard specifications, ensuring all compliant devices support these power-saving features.

b. Driver and Firmware:

* USB device drivers and firmware must handle the suspend and resume processes correctly.

* This involves saving the device's state before suspending and restoring it after resuming to ensure seamless operation.

Summary

USB suspend is a vital power management feature that allows USB devices to enter a low-power state when idle, thereby conserving energy. The process includes detecting idle periods, signaling devices to enter suspend mode, and providing mechanisms for both the host and devices to wake up and resume normal operation. Selective suspend enhances power efficiency by allowing individual devices to be suspended without affecting the entire USB bus. Proper implementation of these features requires adherence to USB specifications and well-designed device drivers and firmware.

USB 设备无法在 USB 总线上启动挂起。USB 挂起机制由 USB 主机控制。下面是该过程的工作原理:

1. 主机启动挂起: USB 主机负责管理 USB 设备的电源状态。如果主机检测到 USB 设备已闲置(即未通信)一段时间,则可决定将设备置于挂起状态,以节省电源。

2. 设备对挂起的响应: 主机启动挂起时,会停止向设备发送帧开始(SOF)数据包或其他数据。设备在一定时间内(通常为 3 毫秒)未收到任何数据后,会识别到它应进入挂起状态。在此状态下,设备会大幅降低功耗。

3. 从挂起状态恢复: 挂起的 USB 设备可以通过发送恢复信号向主机发出需要唤醒总线的信号,但设备挂起状态的发起仍由主机控制。

总之,主机启动了挂起过程,而设备可以请求恢复运行,但自身不具备启动挂起的能力。

A USB device cannot initiate a suspend on the USB bus. The USB suspend mechanism is controlled by the USB host. Here’s how the process works:

1. Host-Initiated Suspend: The USB host is responsible for managing the power states of the USB devices. If the host detects that a USB device has been idle (i.e., not communicating) for a specified period, it can decide to put the device into a suspend state to save power.

2. Device Response to Suspend: When the host initiates a suspend, it stops sending Start-of-Frame (SOF) packets or other data to the device. The device, upon not receiving any data for a certain period (usually 3 milliseconds), recognizes that it should enter the suspend state. During this state, the device significantly reduces its power consumption.

3. Resume from Suspend: A suspended USB device can signal the host that it needs to wake up the bus by sending a resume signal, but the initiation of the suspend state itself is controlled by the host.

In summary, the host initiates the suspend process, while the device can request to resume operation but does not have the capability to initiate the suspend itself.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜流冰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值