提交 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
**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
......@@ -70,7 +70,9 @@ The method for determining the GPIO pin number varies depending on the GPIO cont
- Set the GPIO 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);
```
**Table 2** Description of GpioSetDir
......@@ -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.
```c
int32_t GpioRead(uint16_t gpio, uint16_t \*val);
```
**Table 3** Description of GpioRead
......@@ -100,7 +104,9 @@ The method for determining the GPIO pin number varies depending on the GPIO cont
Call **GpioWrite()** to write the level for a GPIO pin.
```c
int32_t GpioWrite(uint16_t gpio, uint16_t val);
```
**Table 4** Description of GpioWrite
......@@ -144,7 +150,9 @@ 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.
```c
int32_t GpioSetIrq(uint16_t gpio, uint16_t mode, GpioIrqFunc func, void \*arg);
```
**Table 5** Description of GpioSetIrq
......@@ -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.
```c
int32_t GpioUnsetIrq(uint16_t gpio, void \*arg);
```
**Table 6** Description of GpioUnsetIrq
......@@ -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.
```c
int32_t GpioEnableIrq(uint16_t gpio);
```
**Table 7** Description of GpioEnableIrq
......@@ -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.
```c
int32_t GpioDisableIrq(uint16_t gpio);
```
**Table 8** Description of GpioDisableIrq
......@@ -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:
......
......@@ -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).
4. Debug the driver.
(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:
- **Bind** function
**Input parameter**:
**HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs information.
**Return value**:
HDF_STATUS
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:
|HDF_FAILURE |Transmission failed.|
**Function description**:
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.
......@@ -377,9 +380,11 @@ The HDMI module adaptation involves the following steps:
- **Init** function
**Input parameter**:
**HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs information.
**Return value**:
HDF_STATUS
**Function description**:
......@@ -396,12 +401,15 @@ The HDMI module adaptation involves the following steps:
- **Release** function
**Input parameter**:
**HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs information.
**Return value**:
No value is returned.
**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.
```c
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册