#hardware #pci #library

已撤回 设备

适用于获取可用PCI设备信息的pci.ids兼容库

6.0.2 2021年8月10日
6.0.1 2021年8月9日
6.0.0 2021年7月13日
5.1.0 2021年7月12日
3.4.2 2021年6月28日

#17 in #pci

Download history 3/week @ 2024-03-14 1/week @ 2024-03-28 1/week @ 2024-04-04

641 每月下载量

MIT 许可证

47KB
1K SLoC

设备

一个适用于获取可用PCI设备信息的pci.ids兼容库。

version docs

免责声明

  • 不建议使用main分支,因为该项目尚处于起步阶段,API 的更改很可能发生。相反,您应使用在 crates.io 中提供的crate。

  • 目前aparato仅在Linux上工作,未来将支持更多平台。

用法

将以下内容添加到您的项目Cargo.toml文件中

aparato = "4.0.0" # Be sure to use the latest version

示例

use aparato::{Device, PCIDevice};

fn main() {

    // Know the domain of the PCI device?
    // Instantiate a new PCIDevice so we can get to know it a bit.
    let device = PCIDevice::new("00:02.0");

    println!("Class Name: {}", device.class_name());       // e.g. Display Controller
    println!("Subclass Name: {}", device.subclass_name()); // e.g. VGA compatible controller
    println!("Vendor Name: {}", device.vendor_name());     // e.g. Intel Corporation
    println!("Device Name: {}", device.device_name());     // e.g. WhiskeyLake-U GT2 [UHD Graphics 620]
}

贡献

欢迎任何形式的贡献,无论是单元测试、重构还是修复错误。建议在开始工作之前报告问题。

依赖

~25KB