提交 d821fdb5 编写于 作者: A Annie_wang

update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 1631559c
...@@ -16,7 +16,7 @@ The figure below shows the HDF driver model. ...@@ -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: The HDF-based driver development involves driver implementation and configuration. The procedure is as follows:
1. Implement a driver. 1. Implement a driver.<br/>
Write the driver code and register the driver entry with the HDF. Write the driver code and register the driver entry with the HDF.
- Writing the driver service code - Writing the driver service code
...@@ -68,11 +68,11 @@ The HDF-based driver development involves driver implementation and configuratio ...@@ -68,11 +68,11 @@ The HDF-based driver development involves driver implementation and configuratio
HDF_INIT(g_sampleDriverEntry); HDF_INIT(g_sampleDriverEntry);
``` ```
2. Build the driver. 2. Build the driver.<br/>
- LiteOS - LiteOS<br/>
Modify **makefile** and **BUILD.gn**. Modify **makefile** and **BUILD.gn**.
- **makefile**: - **makefile**:<br/>
Use the **makefile** template provided by the HDF to compile the driver code. 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 ...@@ -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. LIB_SUBDIRS += # Directory in which the driver code makefile is located.
``` ```
- **BUILD.gn**: - **BUILD.gn**:<br/>
Add **BUILD.gn**. The content of **BUILD.gn** is as follows: 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 ...@@ -126,7 +126,7 @@ The HDF-based driver development involves driver implementation and configuratio
] ]
} }
``` ```
- Linux - Linux<br/>
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**. 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 ...@@ -148,12 +148,12 @@ The HDF-based driver development involves driver implementation and configuratio
obj-y += xxx.o obj-y += xxx.o
``` ```
3. Configure the driver. 3. Configure the driver.<br/>
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 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. 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<br/>
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: 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 ...@@ -208,7 +208,7 @@ The HDF-based driver development involves driver implementation and configuratio
- (Optional) Setting driver private information - (Optional) Setting driver private information<br/>
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). 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: The following is an example of the driver private configuration:
...@@ -255,5 +255,5 @@ The HDF-based driver development involves driver implementation and configuratio ...@@ -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). > 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)**)<br/>
> 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. > 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.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册