提交 fdbd1748 编写于 作者: A Annie_wang

update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 1b9b66bc
...@@ -39,7 +39,7 @@ The figure below shows the general GPIO development process. In the APIs, a GPIO ...@@ -39,7 +39,7 @@ The figure below shows the general GPIO development process. In the APIs, a GPIO
**Figure 1** Using GPIO driver APIs **Figure 1** Using GPIO driver APIs
![](figures/using-gpio-process.png "using-gpio-process.png") ![](figures/using-GPIO-process.png "using-gpio-process.png")
### Determining the GPIO Pin Number ### Determining the GPIO Pin Number
...@@ -70,7 +70,9 @@ The method for determining the GPIO pin number varies depending on the GPIO cont ...@@ -70,7 +70,9 @@ The method for determining the GPIO pin number varies depending on the GPIO cont
- Set the GPIO pin direction. - Set the GPIO pin direction.
Before performing read/write operations on a GPIO pin, call **GpioSetDir()** to set the pin direction. Before performing read/write operations on a GPIO pin, call **GpioSetDir()** to set the pin direction.
```c
int32_t GpioSetDir(uint16_t gpio, uint16_t dir); int32_t GpioSetDir(uint16_t gpio, uint16_t dir);
```
**Table 2** Description of GpioSetDir **Table 2** Description of GpioSetDir
...@@ -86,7 +88,9 @@ The method for determining the GPIO pin number varies depending on the GPIO cont ...@@ -86,7 +88,9 @@ The method for determining the GPIO pin number varies depending on the GPIO cont
Call **GpioRead()** to read the level of a GPIO pin. Call **GpioRead()** to read the level of a GPIO pin.
```c
int32_t GpioRead(uint16_t gpio, uint16_t \*val); int32_t GpioRead(uint16_t gpio, uint16_t \*val);
```
**Table 3** Description of GpioRead **Table 3** Description of GpioRead
...@@ -100,8 +104,10 @@ The method for determining the GPIO pin number varies depending on the GPIO cont ...@@ -100,8 +104,10 @@ The method for determining the GPIO pin number varies depending on the GPIO cont
Call **GpioWrite()** to write the level for a GPIO pin. Call **GpioWrite()** to write the level for a GPIO pin.
```c
int32_t GpioWrite(uint16_t gpio, uint16_t val); int32_t GpioWrite(uint16_t gpio, uint16_t val);
```
**Table 4** Description of GpioWrite **Table 4** Description of GpioWrite
| **Parameter**| **Description**| | **Parameter**| **Description**|
...@@ -144,8 +150,10 @@ The method for determining the GPIO pin number varies depending on the GPIO cont ...@@ -144,8 +150,10 @@ The method for determining the GPIO pin number varies depending on the GPIO cont
Call **GpioSetIrq()** to set the ISR function for a GPIO pin. Call **GpioSetIrq()** to set the ISR function for a GPIO pin.
```c
int32_t GpioSetIrq(uint16_t gpio, uint16_t mode, GpioIrqFunc func, void \*arg); int32_t GpioSetIrq(uint16_t gpio, uint16_t mode, GpioIrqFunc func, void \*arg);
```
**Table 5** Description of GpioSetIrq **Table 5** Description of GpioSetIrq
| **Parameter**| **Description**| | **Parameter**| **Description**|
...@@ -163,7 +171,9 @@ The method for determining the GPIO pin number varies depending on the GPIO cont ...@@ -163,7 +171,9 @@ The method for determining the GPIO pin number varies depending on the GPIO cont
If the ISR function is no longer required, call **GpioUnsetIrq()** to cancel it. If the ISR function is no longer required, call **GpioUnsetIrq()** to cancel it.
```c
int32_t GpioUnsetIrq(uint16_t gpio, void \*arg); int32_t GpioUnsetIrq(uint16_t gpio, void \*arg);
```
**Table 6** Description of GpioUnsetIrq **Table 6** Description of GpioUnsetIrq
...@@ -177,7 +187,9 @@ The method for determining the GPIO pin number varies depending on the GPIO cont ...@@ -177,7 +187,9 @@ The method for determining the GPIO pin number varies depending on the GPIO cont
After the ISR function is set, call **GpioEnableIrq()** to enable interrupts for the GPIO pin. After the ISR function is set, call **GpioEnableIrq()** to enable interrupts for the GPIO pin.
```c
int32_t GpioEnableIrq(uint16_t gpio); int32_t GpioEnableIrq(uint16_t gpio);
```
**Table 7** Description of GpioEnableIrq **Table 7** Description of GpioEnableIrq
...@@ -193,7 +205,9 @@ The method for determining the GPIO pin number varies depending on the GPIO cont ...@@ -193,7 +205,9 @@ The method for determining the GPIO pin number varies depending on the GPIO cont
You can call **GpioDisableIrq** to disable interrupts for the pin. You can call **GpioDisableIrq** to disable interrupts for the pin.
```c
int32_t GpioDisableIrq(uint16_t gpio); int32_t GpioDisableIrq(uint16_t gpio);
```
**Table 8** Description of GpioDisableIrq **Table 8** Description of GpioDisableIrq
...@@ -246,7 +260,7 @@ The method for determining the GPIO pin number varies depending on the GPIO cont ...@@ -246,7 +260,7 @@ The method for determining the GPIO pin number varies depending on the GPIO cont
``` ```
## Example ## Development Example
The procedure is as follows: The procedure is as follows:
......
...@@ -66,6 +66,7 @@ The GPIO module adaptation involves the following steps: ...@@ -66,6 +66,7 @@ The GPIO module adaptation involves the following steps:
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/> For details about the callbacks in **GpioMethod**, see [Available APIs](#available_apis). > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/> For details about the callbacks in **GpioMethod**, see [Available APIs](#available_apis).
4. Debug the driver. 4. Debug the driver.
(Optional) For new drivers, verify the basic functions, such as the GPIO status control and response to interrupts. (Optional) For new drivers, verify the basic functions, such as the GPIO status control and response to interrupts.
......
...@@ -316,9 +316,11 @@ The HDMI module adaptation involves the following steps: ...@@ -316,9 +316,11 @@ The HDMI module adaptation involves the following steps:
- **Bind** function - **Bind** function
**Input parameter**: **Input parameter**:
**HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs information. **HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs information.
**Return value**: **Return value**:
HDF_STATUS HDF_STATUS
The table below describes some status. For more information, see **HDF_STATUS** in the **/drivers/framework/include/utils/hdf_base.h** file. The table below describes some status. For more information, see **HDF_STATUS** in the **/drivers/framework/include/utils/hdf_base.h** file.
...@@ -333,6 +335,7 @@ The HDMI module adaptation involves the following steps: ...@@ -333,6 +335,7 @@ The HDMI module adaptation involves the following steps:
|HDF_FAILURE |Transmission failed.| |HDF_FAILURE |Transmission failed.|
**Function description**: **Function description**:
Initializes the custom structure object **HdmiAdapterHost** and **HdmiCntlr**, and calls the **HdmiCntlrAdd** function to add the HDMI controller to the core layer. Initializes the custom structure object **HdmiAdapterHost** and **HdmiCntlr**, and calls the **HdmiCntlrAdd** function to add the HDMI controller to the core layer.
The **HdmiCntlr**, **HdmiAdapterHost**, and **HdfDeviceObject** assign values with each other so that other functions can be converted successfully. The **HdmiCntlr**, **HdmiAdapterHost**, and **HdfDeviceObject** assign values with each other so that other functions can be converted successfully.
...@@ -377,13 +380,15 @@ The HDMI module adaptation involves the following steps: ...@@ -377,13 +380,15 @@ The HDMI module adaptation involves the following steps:
- **Init** function - **Init** function
**Input parameter**: **Input parameter**:
**HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs information. **HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs information.
**Return value**: **Return value**:
HDF_STATUS HDF_STATUS
**Function description**: **Function description**:
Implements the **HdmiAdapterInit** function. Implements the **HdmiAdapterInit** function.
```c ```c
...@@ -396,14 +401,17 @@ The HDMI module adaptation involves the following steps: ...@@ -396,14 +401,17 @@ The HDMI module adaptation involves the following steps:
- **Release** function - **Release** function
**Input parameter**: **Input parameter**:
**HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs information.
**HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs information.
**Return value**: **Return value**:
No value is returned. No value is returned.
**Function description**: **Function description**:
Releases the memory and deletes the controller. This function assigns values to the **Release** callback in the driver entry structure. If the HDF fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources. Releases the memory and deletes the controller. This function assigns values to the **Release** callback in the driver entry structure. If the HDF fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources.
```c ```c
static void HdmiAdapterRelease(struct HdfDeviceObject *obj) static void HdmiAdapterRelease(struct HdfDeviceObject *obj)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册