openharmony 鸿蒙 driverdevelopment-overview

2025-06-06 浏览 (1)

Introduction to Driver Development Kit

Empowered by the C-API solution, Driver Development Kit provides easy-to-use, secure, and diversified ArkTs-API and C APIs to elevate your experience in developing peripheral drivers, which bring ultimate plug-and-play experience to users.

When to Use

With Driver Development Kit, you can develop dedicated or extended peripheral drivers in an efficient and secure manner.

  1. Develop drivers of dedicated

    peripherals for bank counters, enterprise office, and medical detection, such as high-speed document scanners, ID card scanners, fingerprint scanners, and blood oxygen and blood glucose meters.

  2. Develop enhanced functions of non-standard peripherals,

    such as customizing handwriting pad shortcut keys, setting the pressure sensing/drawing area, setting extended enhancement capabilities, setting the mouse lighting effect, customizing mouse extended buttons, and setting DPI and X and Y axes.

Typical Use Cases

  • You can develop advanced peripheral functions to meet user requirements.

  • The extended driver framework supports lifecycle management of peripheral drivers and provides APIs for querying and binding peripheral devices.

Basic Concepts

  • Peripheral driver client: basic UI-based driver, which is used to query and bind drivers, and customize the communication mode and data processing mode.
  • Peripheral driver: basic UI-free driver, which is the dedicated peripheral driver or enhanced peripheral driver developed based on the DDK.
  • External Device Manager: performs lifecycle management of peripheral devices and driver packages.
  • Bundle Manager Service (BMS): manages application installation, uninstallation, and data on the system.
  • Ability Manager Service (AMS): starts and stops DriverExtensionAbility.

Implementation Principles

The HDF extended driver framework provides unified APIs for you to leverage the DDK capabilities for user-mode peripheral driver development.

External Device Manager, the core service of user-mode peripheral management, performs lifecycle management of peripherals and peripheral drivers. In addition, standard ArkTS APIs are provided to query, bind, and unbind peripherals.

Peripheral Driver Architecture

Figure 1 Peripheral driver working mechanism

driverExtension

Operation Process

Figure 2 shows the process for matching a peripheral driver client with a peripheral driver when a peripheral is connected.

Figure 2 Process for matching a peripheral driver client with a peripheral driver

timeSeries1

Figure 3 shows the process for binding the peripheral driver client with a peripheral driver.

Figure 3 Process of binding the peripheral driver client with a peripheral driver

timeSeries2

Notes and Constraints

To call the ArkTs or C APIs provided by Driver Development Kit, you need to apply for specified permissions.

The following table lists the required permissions.

API TypeDDK TypePermission
ArkTs-APINAohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER
C-APIUSB DDKohos.permission.ACCESS_DDK_USB
C-APIHID DDKohos.permission.ACCESS_DDK_HID
C-APIUSB Serial DDKohos.permission.ACCESS_DDK_USB_SERIAL
C-APISCSI Peripheral DDKohos.permission.ACCESS_DDK_SCSI_PERIPHERAL

Associated Modules

The following table lists the associated modules you may use during development of peripheral drivers.

NameDescription
PerformanceAnalysisKitIntroduces {hilog} for log printing.
BasicServicesKitIntroduces {BusinessError} to capture error information.
IPCKitIntroduces {rpc} to implement inter-process communication between the driver and the client.
AbilityKitIntroduces {want} for lifecycle management.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Driver Development Kit

harmony 鸿蒙UI-free Driver Development

harmony 鸿蒙Setting Up the Environment

harmony 鸿蒙FAQs

harmony 鸿蒙UI-based Driver Development

harmony 鸿蒙HID DDK Development

harmony 鸿蒙SCSI Peripheral DDK Development

harmony 鸿蒙Terms

harmony 鸿蒙USB DDK Development

harmony 鸿蒙USB Serial DDK Development

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/8bJGkn