USB通讯第三方库HIDAPI

  • 4RO7h9LwbG
    了解作者
  • C/C++
    开发工具
  • 1.5MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 5 积分
    下载积分
  • 0
    下载次数
  • 2022-12-05 03:31
    上传日期
USB通讯第三方库HIDAPI,添加可用
hidapi-win.zip
  • x64
  • hidapi.lib
    5.9KB
  • hidapi.dll
    145.5KB
  • hidapi.pdb
    3.4MB
  • x86
  • hidapi.lib
    6KB
  • hidapi.dll
    117KB
  • hidapi.pdb
    3.6MB
  • include
  • hidapi.h
    17.8KB
  • hidapi_winapi.h
    1.6KB
内容介绍
/******************************************************* HIDAPI - Multi-Platform library for communication with HID devices. Alan Ott Signal 11 Software libusb/hidapi Team Copyright 2022, All Rights Reserved. At the discretion of the user of this library, this software may be licensed under the terms of the GNU General Public License v3, a BSD-Style license, or the original HIDAPI license as outlined in the LICENSE.txt, LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt files located at the root of the source distribution. These files may also be found in the public source code repository located at: https://github.com/libusb/hidapi . ********************************************************/ /** @file * @defgroup API hidapi API */ #ifndef HIDAPI_H__ #define HIDAPI_H__ #include <wchar.h> #ifdef _WIN32 #define HID_API_EXPORT __declspec(dllexport) #define HID_API_CALL #else #define HID_API_EXPORT /**< API export macro */ #define HID_API_CALL /**< API call macro */ #endif #define HID_API_EXPORT_CALL HID_API_EXPORT HID_API_CALL /**< API export and call macro*/ /** @brief Static/compile-time major version of the library. @ingroup API */ #define HID_API_VERSION_MAJOR 0 /** @brief Static/compile-time minor version of the library. @ingroup API */ #define HID_API_VERSION_MINOR 12 /** @brief Static/compile-time patch version of the library. @ingroup API */ #define HID_API_VERSION_PATCH 0 /* Helper macros */ #define HID_API_AS_STR_IMPL(x) #x #define HID_API_AS_STR(x) HID_API_AS_STR_IMPL(x) #define HID_API_TO_VERSION_STR(v1, v2, v3) HID_API_AS_STR(v1.v2.v3) /** @brief Coverts a version as Major/Minor/Patch into a number: <8 bit major><16 bit minor><8 bit patch>. This macro was added in version 0.12.0. Convenient function to be used for compile-time checks, like: #if HID_API_VERSION >= HID_API_MAKE_VERSION(0, 12, 0) @ingroup API */ #define HID_API_MAKE_VERSION(mj, mn, p) (((mj) << 24) | ((mn) << 8) | (p)) /** @brief Static/compile-time version of the library. This macro was added in version 0.12.0. @see @ref HID_API_MAKE_VERSION. @ingroup API */ #define HID_API_VERSION HID_API_MAKE_VERSION(HID_API_VERSION_MAJOR, HID_API_VERSION_MINOR, HID_API_VERSION_PATCH) /** @brief Static/compile-time string version of the library. @ingroup API */ #define HID_API_VERSION_STR HID_API_TO_VERSION_STR(HID_API_VERSION_MAJOR, HID_API_VERSION_MINOR, HID_API_VERSION_PATCH) #ifdef __cplusplus extern "C" { #endif struct hid_api_version { int major; int minor; int patch; }; struct hid_device_; typedef struct hid_device_ hid_device; /**< opaque hidapi structure */ /** hidapi info structure */ struct hid_device_info { /** Platform-specific device path */ char *path; /** Device Vendor ID */ unsigned short vendor_id; /** Device Product ID */ unsigned short product_id; /** Serial Number */ wchar_t *serial_number; /** Device Release Number in binary-coded decimal, also known as Device Version Number */ unsigned short release_number; /** Manufacturer String */ wchar_t *manufacturer_string; /** Product string */ wchar_t *product_string; /** Usage Page for this Device/Interface (Windows/Mac/hidraw only) */ unsigned short usage_page; /** Usage for this Device/Interface (Windows/Mac/hidraw only) */ unsigned short usage; /** The USB interface which this logical device represents. * Valid on both Linux implementations in all cases. * Valid on the Windows implementation only if the device contains more than one interface. * Valid on the Mac implementation if and only if the device is a USB HID device. */ int interface_number; /** Pointer to the next device */ struct hid_device_info *next; }; /** @brief Initialize the HIDAPI library. This function initializes the HIDAPI library. Calling it is not strictly necessary, as it will be called automatically by hid_enumerate() and any of the hid_open_*() functions if it is needed. This function should be called at the beginning of execution however, if there is a chance of HIDAPI handles being opened by different threads simultaneously. @ingroup API @returns This function returns 0 on success and -1 on error. */ int HID_API_EXPORT HID_API_CALL hid_init(void); /** @brief Finalize the HIDAPI library. This function frees all of the static data associated with HIDAPI. It should be called at the end of execution to avoid memory leaks. @ingroup API @returns This function returns 0 on success and -1 on error. */ int HID_API_EXPORT HID_API_CALL hid_exit(void); /** @brief Enumerate the HID Devices. This function returns a linked list of all the HID devices attached to the system which match vendor_id and product_id. If @p vendor_id is set to 0 then any vendor matches. If @p product_id is set to 0 then any product matches. If @p vendor_id and @p product_id are both set to 0, then all HID devices will be returned. @ingroup API @param vendor_id The Vendor ID (VID) of the types of device to open. @param product_id The Product ID (PID) of the types of device to open. @returns This function returns a pointer to a linked list of type struct #hid_device_info, containing information about the HID devices attached to the system, or NULL in the case of failure. Free this linked list by calling hid_free_enumeration(). */ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned short vendor_id, unsigned short product_id); /** @brief Free an enumeration Linked List This function frees a linked list created by hid_enumerate(). @ingroup API @param devs Pointer to a list of struct_device returned from hid_enumerate(). */ void HID_API_EXPORT HID_API_CALL hid_free_enumeration(struct hid_device_info *devs); /** @brief Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number. If @p serial_number is NULL, the first device with the specified VID and PID is opened. This function sets the return value of hid_error(). @ingroup API @param vendor_id The Vendor ID (VID) of the device to open. @param product_id The Product ID (PID) of the device to open. @param serial_number The Serial Number of the device to open (Optionally NULL). @returns This function returns a pointer to a #hid_device object on success or NULL on failure. */ HID_API_EXPORT hid_device * HID_API_CALL hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number); /** @brief Open a HID device by its path name. The path name be determined by calling hid_enumerate(), or a platform-specific path name can be used (eg: /dev/hidraw0 on Linux). This function sets the return value of hid_error(). @ingroup API @param path The path name of the device to open @returns This function returns a pointer to a #hid_device object on success or NULL on failure. */ HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path); /** @brief Write an Output report to a HID device. The first byte of @p data[] must contain the Report ID. For devices which only support a single report, this must be set to 0x0. The remaining bytes contain the report data. Since the Report ID is mandatory, calls to hid_write() will always contain one more byte than the report contains. For example, if a hid report is 16 bytes long, 17 bytes must be passed to hid_write(), the Report ID (or 0x0, f
评论
    相关推荐
    • CPP_USB-CAN.rar
      C++关于DLL调用的源代码,关于界面设计,DLL调用等方面,很有参考价值。此例程针对武汉吉阳光电www.glinker.cn的GY8507 USB
    • USB通讯工具
      集成USB转SPI I2C IIC UART多种通讯方式,并可烧录flash
    • 【二次开发】CH372 USB DLL 下载
      说 明:声明USB CH37x DLL函数 作 者:温子祺 创建时间:2010-08-06 联系方式:wenziqi@hotmail.com 博 客:http://www.cnblogs.com/wenziqi/ 小 组:http://group.ednchina.com/2748/ 官 网:www.smartmcu.com -----------...
    • USB编程
      c/c++使用USB hid进行单片机升级
    • USB转CAN DLL兼容周立功
      界面为MFC所编写,实现USB转CAN功能,适应于HID设备,DLL可兼容周立功软件,只需修改DLL内Pid和Vip参数即可使用周立功软件调试你自己的HID-CAN设备
    • usb通用驱动程序 dll文件 上位机的
      设备新华龙单片机C8051f 与 上位机 通信的驱动程序 vC6.0 开发
    • winusb.dll控件
      直接拷贝该文件到系统目录里:1、Windows 95/98/Me系统,将winusb.dll复制到C:\Windows\System目录下。2、Windows NT/2000系统,将winusb.dll复制到C:\WINNT\System32目录下。3、Windows XP/WIN7/Vista系统,将win...
    • Usb Hid Dll
      操作HID设备的DLL,之前用来和STM32单片机的USB口通讯,,,,,,,,,,,,,,,,,,,。。。
    • USB HID DLL
      FHHID.dll为出售中的商品,调用此DLL可大大节省您的开发时间,本店主估计花了两个月的时间打磨此DLL才达到现在的效果,可实现1毫秒实时从Windows中处理数据,支持USB热拔插并自动加入与移除HID功能,可枚举当前系统...
    • cyUsb C#USB通信 DLL
      很好用的库。cyUSB类库(包括cyAPI,cyUsb.dll以及使用说明)