是否有软件或代码可以改变 USB 电源输出

发布于 2024-08-11 17:21:54 字数 398 浏览 8 评论 0原文

我查看了这个这个,但没有人听起来特别确定他们的想法,无论如何我都在追求另一件事。我想将我的 USB 电源线(红色和黑色)连接到我的手机,这样我就不必使用电池(无论如何电池已经没电了,这只是一个实验)。问题是 USB 标准确保提供至少 4.35V 的电压,而我只需要 3.7V。有谁确定可以或不能以编程方式调节功率输出?我的其他一些疑问是:睡眠模式提供什么样的电源?我需要编写什么代码来实现这个功能,C++?

I had a look at this and this but no one sounded particularly sure of their ideas and I'm kind of after a different thing anyway. I want to hook my usb power cables (red and black) up to my phone so I don't have to use a battery (the battery is dead anyway and this is just an experiment). The problem is that USB standards ensure that a minimum of 4.35V is supplied, when I only want 3.7V. Does anyone know for sure that you can or cannot regulate power output programmatically? Some other queries I have are: What kind of power does the sleep mode provide? And what would I need to code something in to play with this, C++?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

此生挚爱伱 2024-08-18 17:21:54

不,您找不到允许您在软件中设置此电压的计算机。它会破坏 USB 规范。

默认情况下,您可以获得 150mA,如果您的 USB 设备与计算机进行协商,则可以获得 500mA(需要设备中的一些逻辑)。乘以 5V 即可获得所提供的功率。

No, you won't find a computer that allows you to set this voltage in software. It would break the USB specification.

You can get 150mA by default, and 500mA if your USB device negotiates it with the computer (requiring a little bit of logic in the device). Multiply by 5V to get the provided power.

缺⑴份安定 2024-08-18 17:21:54

有关 Pascal 答案的更多信息:

  1. 正常操作(非配置模式)为 100mA

  2. 理论上,操作系统应该检查设备配置描述符的 MaxPower 值,以决定是否允许其消耗超过 100mA 的电流。
    实际上,个人电脑不会这样做(并且无法控制它)。所以你可以尝试取500mA。
    (当然,连接总线供电的集线器并链接多个 500mA 设备应该是行不通的。)

  3. 如果设备未被主动使用,操作系统可能(并且应该)挂起它。挂起时,电源限制为 1-0.5mA(理论上,因为它不能由软件控制)。

A bit more info on the answer from Pascal:

  1. The normal operation (Non-Configured mode) is 100mA

  2. In theory, the operating system should check the MaxPower value of the device's configuration descriptor to decide if to allow it to draw more than 100mA.
    In practice, PCs do not do it (and have no way to control it). So you can try taking 500mA.
    (Of course connecting a bus powered hub and linking more then one 500mA device, should, not work.)

  3. If the device is not actively used, the OS may (and should) suspend it. When suspended the power is limited to 1-0.5mA (Again, in theory, since it can not be controlled by software).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文