From d821fdb5216eb547bea1ccbb163c758fe34744ae Mon Sep 17 00:00:00 2001 From: Annie_wang Date: Thu, 14 Apr 2022 20:38:55 +0800 Subject: [PATCH] update docs Signed-off-by: Annie_wang --- .../driver/driver-hdf-development.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/en/device-dev/driver/driver-hdf-development.md b/en/device-dev/driver/driver-hdf-development.md index 16bed266e7..4716637357 100644 --- a/en/device-dev/driver/driver-hdf-development.md +++ b/en/device-dev/driver/driver-hdf-development.md @@ -16,7 +16,7 @@ The figure below shows the HDF driver model. The HDF-based driver development involves driver implementation and configuration. The procedure is as follows: -1. Implement a driver. +1. Implement a driver.
Write the driver code and register the driver entry with the HDF. - Writing the driver service code @@ -68,11 +68,11 @@ The HDF-based driver development involves driver implementation and configuratio HDF_INIT(g_sampleDriverEntry); ``` -2. Build the driver. - - LiteOS +2. Build the driver.
+ - LiteOS
Modify **makefile** and **BUILD.gn**. - - **makefile**: + - **makefile**:
Use the **makefile** template provided by the HDF to compile the driver code. @@ -93,7 +93,7 @@ The HDF-based driver development involves driver implementation and configuratio LIB_SUBDIRS += # Directory in which the driver code makefile is located. ``` - - **BUILD.gn**: + - **BUILD.gn**:
Add **BUILD.gn**. The content of **BUILD.gn** is as follows: @@ -126,7 +126,7 @@ The HDF-based driver development involves driver implementation and configuratio ] } ``` - - Linux + - Linux
To define the driver control macro, add the **Kconfig** file to the driver directory **xxx** and add the path of the **Kconfig** file to **drivers/adapter/khdf/linux/Kconfig**. @@ -148,12 +148,12 @@ The HDF-based driver development involves driver implementation and configuratio obj-y += xxx.o ``` -3. Configure the driver. +3. Configure the driver.
The HDF Configuration Source (HCS) contains the source code of HDF configuration. For details about the HCS, see [Configuration Management](../driver/driver-hdf-manage.md). The driver configuration consists of the driver device description defined by the HDF and the private driver configuration. - - (Mandatory) Setting the driver device description + - (Mandatory) Setting the driver device description
The HDF loads a driver based on the driver device description defined by the HDF. Therefore, the driver device description must be added to the **device_info.hcs** file defined by the HDF. The following is an example: @@ -208,7 +208,7 @@ The HDF-based driver development involves driver implementation and configuratio - - (Optional) Setting driver private information + - (Optional) Setting driver private information
If the driver has private configuration, add a driver configuration file to set default driver configuration. When loading the driver, the HDF obtains and saves the driver private information in **property** of **HdfDeviceObject**, and passes the information to the driver using **Bind()** and **Init()** (see step 1). The following is an example of the driver private configuration: @@ -255,5 +255,5 @@ The HDF-based driver development involves driver implementation and configuratio > > If **preload** is set to **2 (DEVICE_PRELOAD_DISABLE)** , the driver is dynamically loaded instead of being loaded during the system boot process. When a user-mode process requests the driver service, the HDF attempts to dynamically load the driver if the driver service does not exist. For more details, see [Driver Message Mechanism Management](driver-hdf-message-management.md). > -> - Sequential loading (**preload** set to **0 (DEVICE_PRELOAD_ENABLE)**) +> - Sequential loading (**preload** set to **0 (DEVICE_PRELOAD_ENABLE)**)
> In the configuration file, the **priority** fields (value range: 0 to 200) determines the loading sequence of a host and a driver. For drivers in different hosts, a smaller host priority value indicates a higher driver loading priority; for drivers in the same host, a smaller driver priority value indicates a higher driver loading priority. -- GitLab