diff --git a/en/device-dev/driver/driver-platform-gpio-des.md b/en/device-dev/driver/driver-platform-gpio-des.md index a64ff651382bc4b6ba326446f1256c32c1cdb17f..0314eb8595e41442a093ef761b653232eaeba947 100644 --- a/en/device-dev/driver/driver-platform-gpio-des.md +++ b/en/device-dev/driver/driver-platform-gpio-des.md @@ -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,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. + ```c int32_t GpioWrite(uint16_t gpio, uint16_t val); - + ``` + **Table 4** Description of GpioWrite | **Parameter**| **Description**| @@ -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. + ```c int32_t GpioSetIrq(uint16_t gpio, uint16_t mode, GpioIrqFunc func, void \*arg); - + ``` + **Table 5** Description of GpioSetIrq | **Parameter**| **Description**| @@ -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: diff --git a/en/device-dev/driver/driver-platform-gpio-develop.md b/en/device-dev/driver/driver-platform-gpio-develop.md index 6d4894c9e9991228c1b7d7901464c4762a59cad0..9ecbecc0945e789af111593f57ade7c938641b1b 100644 --- a/en/device-dev/driver/driver-platform-gpio-develop.md +++ b/en/device-dev/driver/driver-platform-gpio-develop.md @@ -66,6 +66,7 @@ The GPIO module adaptation involves the following steps: > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
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. diff --git a/en/device-dev/driver/driver-platform-hdmi-develop.md b/en/device-dev/driver/driver-platform-hdmi-develop.md index a997c8c76f8bd2a2f8f4439f9746387794cf0fe5..7cd4437b5c7fd746b9a1cb467d71046cb8b0e740 100644 --- a/en/device-dev/driver/driver-platform-hdmi-develop.md +++ b/en/device-dev/driver/driver-platform-hdmi-develop.md @@ -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,13 +380,15 @@ 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**: - + Implements the **HdmiAdapterInit** function. ```c @@ -396,14 +401,17 @@ The HDMI module adaptation involves the following steps: - **Release** function **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**: + 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 static void HdmiAdapterRelease(struct HdfDeviceObject *obj) {