• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Introduction to Driver Development Kit
2
3Empowered 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.
4
5## When to Use
6
7With Driver Development Kit, you can develop dedicated or extended peripheral drivers in an efficient and secure manner.
8
91. Develop drivers of dedicated
10
11   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.
12
132. Develop enhanced functions of non-standard peripherals,
14
15   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.
16
17## Typical Use Cases
18
19- You can develop advanced peripheral functions to meet user requirements.
20
21- The extended driver framework supports lifecycle management of peripheral drivers and provides APIs for querying and binding peripheral devices.
22
23## Basic Concepts
24
25- Peripheral driver client: [basic UI-based driver](externaldevice-guidelines.md), which is used to query and bind drivers, and customize the communication mode and data processing mode.
26- Peripheral driver: [basic UI-free driver](driverextensionability.md), which is the dedicated peripheral driver or enhanced peripheral driver developed based on the DDK.
27- External Device Manager: performs lifecycle management of peripheral devices and driver packages.
28- Bundle Manager Service (BMS): manages application installation, uninstallation, and data on the system.
29- Ability Manager Service (AMS): starts and stops **DriverExtensionAbility**.
30
31## Implementation Principles
32
33The HDF extended driver framework provides unified APIs for you to leverage the DDK capabilities for user-mode peripheral driver development.
34
35External 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.
36
37### Peripheral Driver Architecture
38
39  **Figure 1** Peripheral driver working mechanism
40
41![driverExtension](figures/driverExtension.png)
42
43
44### Operation Process
45
46Figure 2 shows the process for matching a peripheral driver client with a peripheral driver when a peripheral is connected.
47
48**Figure 2** Process for matching a peripheral driver client with a peripheral driver
49
50![timeSeries1](figures/timeSeries1.png)
51
52Figure 3 shows the process for binding the peripheral driver client with a peripheral driver.
53
54**Figure 3** Process of binding the peripheral driver client with a peripheral driver
55
56![timeSeries2](figures/timeSeries2.png)
57
58## Notes and Constraints
59
60To call the ArkTs or C APIs provided by Driver Development Kit, you need to apply for specified permissions.
61
62The following table lists the required permissions.
63
64| API Type| DDK Type| Permission|
65| --------- | --------- | --------- |
66| ArkTs-API | NA| ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER |
67| C-API     | USB DDK | ohos.permission.ACCESS_DDK_USB |
68| C-API     | HID DDK | ohos.permission.ACCESS_DDK_HID |
69| C-API     | USB Serial DDK | ohos.permission.ACCESS_DDK_USB_SERIAL |
70| C-API     | SCSI Peripheral DDK | ohos.permission.ACCESS_DDK_SCSI_PERIPHERAL |
71
72## Associated Modules
73
74The following table lists the associated modules you may use during development of peripheral drivers.
75
76| Name| Description|
77| --------- | --------- |
78| PerformanceAnalysisKit | Introduces {hilog} for log printing.|
79| BasicServicesKit       | Introduces {BusinessError} to capture error information.|
80| IPCKit                 | Introduces {rpc} to implement inter-process communication between the driver and the client.|
81| AbilityKit             | Introduces {want} for lifecycle management.|
82