Skip to main content

外设驱动接口

Project description

驱动接口下载方式

 pip install driverApi -i https://www.pypi.org/simple/

驱动接口规范说明

1、driverApi 相关包说明:

  • common 基本常量以及基本工具的定义
  • device 基本设备功能及信息定义
  • driver 驱动接口规范
  • logger 日志输出工具

2、driverApi 使用说明

(1)、目录结构定义

|-- your_project/
    |--package_name/
        |--module1.py
        |--module2.py
        |--your_driver.dll
    |--package_name/
        |--module3.py
        |--dll/
            |--your_driver.dll
  • package_name:符合变量命名规范,推荐使用设备型号命名,例如 CentA10
  • module1.py:设备功能模块
  • your_driver.dll:该设备的驱动文件,可为文件或目录

(2)、加载驱动方式

示例目录
|-- ExtDriver/
    |--A10/
        |--__init__.py
        |--A10_keypad.py
        |--A10_multi_func_screen.py
        |--CENT_GWQ.dll
  • 示例:A10_keypad.py 模块中使用以下方式加载dll驱动文件:
import ctypes
from common import get_absolute_path

dll_GWQ = ctypes.WinDLL(get_absolute_path("plugin/A10/CENT_GWQ.dll"))
  • get_absolute_pathcommon包中的获取路径工具,plugin为外设应用中已有的插件目录

(3)、插件导入方式

  • 将所有 package_name 包复制到外设工具的plugin目录下即可

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

driverApi-1.0.7.tar.gz (19.5 kB view details)

Uploaded Source

File details

Details for the file driverApi-1.0.7.tar.gz.

File metadata

  • Download URL: driverApi-1.0.7.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.10

File hashes

Hashes for driverApi-1.0.7.tar.gz
Algorithm Hash digest
SHA256 9a443af688ecbafc6a8dd46d3aadc707deb033c17dbf001647ded1642218ea6c
MD5 40c4174d6df778de2ccf89d12013fa37
BLAKE2b-256 058e0ef0849043c0b15b1eb2f88adab67b8706a48da93a96986928c19c3fb480

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page