From 58b4f5d628338bc9c82b7272e86f65ebf8da8f8b Mon Sep 17 00:00:00 2001 From: annie_wangli Date: Wed, 23 Feb 2022 14:19:14 +0800 Subject: [PATCH] update docs Signed-off-by: annie_wangli --- .../driver/driver-platform-gpio-develop.md | 7 --- .../driver/driver-platform-hdmi-des.md | 17 +----- .../driver/driver-platform-hdmi-develop.md | 4 -- .../driver/driver-platform-i2c-des.md | 10 ---- .../driver/driver-platform-i2c-develop.md | 56 +++++++++---------- 5 files changed, 30 insertions(+), 64 deletions(-) diff --git a/en/device-dev/driver/driver-platform-gpio-develop.md b/en/device-dev/driver/driver-platform-gpio-develop.md index 1b31e3a4ff..2851ea6e4d 100644 --- a/en/device-dev/driver/driver-platform-gpio-develop.md +++ b/en/device-dev/driver/driver-platform-gpio-develop.md @@ -1,12 +1,5 @@ # GPIO -- [Overview](#section1826197354103451) -- [Available APIs](#section752964871810) -- [How to Develop](#section731175315103451) -- [Development Example](#section800425816103451) - - - ## Overview In the Hardware Driver Foundation \(HDF\) framework, the general-purpose input/output \(GPIO\) module uses the service-free mode for API adaptation. The service-free mode applies to the devices that do not provide user-mode APIs or the OS system that does not distinguish the user mode and the kernel mode. In the service-free mode, **DevHandle** \(a void pointer\) directly points to the kernel-mode address of the device object. diff --git a/en/device-dev/driver/driver-platform-hdmi-des.md b/en/device-dev/driver/driver-platform-hdmi-des.md index 2f9dc7c4c1..6d104d6b37 100644 --- a/en/device-dev/driver/driver-platform-hdmi-des.md +++ b/en/device-dev/driver/driver-platform-hdmi-des.md @@ -1,20 +1,5 @@ # HDMI -- [Overview](#section1) -- [Available APIs](#section2) -- [Usage Guidelines](#section3) - - [How to Use](#section4) - - [Opening an HDMI Controller](#section5) - - [Registering a Callback for Hot Plug Detect](#section6) - - [Reading the EDID](#section7) - - [Setting Attributes](#section8) - - [Starting HDMI Transmission](#section10) - - [Stopping HDMI Transmission](#section11) - - [Unregistering the Callback for Hot Plug Detect](#section12) - - [Closing an HDMI Controller](#section13) - -- [Example](#section14) - ## Overview - The High-Definition Multimedia Interface (HDMI) is an audio/video transmission protocol released by Hitachi, Panasonic, Philips, Silicon Image, Sony, Thomson, Toshiba. @@ -28,6 +13,7 @@ - Registering and unregistering a callback for HDMI hot plug detect. - [Figure 1](#fig1) shows the HDMI physical connection. **Figure 1** HDMI physical connection + ![](figures/HDMI_physical_connection.png "HDMI_physical_connection") ## Available APIs @@ -129,6 +115,7 @@ [Figure 2](#fig2) shows how HDMI works. **Figure 2** How HDMI works + ![](figures/HDMI_usage_flowchart.png "HDMI_usage_flowchart") ### Opening an HDMI Controller diff --git a/en/device-dev/driver/driver-platform-hdmi-develop.md b/en/device-dev/driver/driver-platform-hdmi-develop.md index 768dca07f7..d57ae51e27 100644 --- a/en/device-dev/driver/driver-platform-hdmi-develop.md +++ b/en/device-dev/driver/driver-platform-hdmi-develop.md @@ -1,9 +1,5 @@ # HDMI -- [Overview](#1) -- [How to Develop](#2) -- [Development Example](#3) - ## Overview The High-Definition Multimedia Interface (HDMI) is an audio/video transmission protocol released by Hitachi, Panasonic, Philips, SiliconImage, Sony, Thomson and Toshiba. It is used to transmit audio or video data from an audio or video source device, such as a DVD player or STB, to a sink device, such as a TV or monitor. The transmission process complies with the Transition Minimized Differential Signaling (TMDS) protocol. diff --git a/en/device-dev/driver/driver-platform-i2c-des.md b/en/device-dev/driver/driver-platform-i2c-des.md index f0fc3530d5..16b1d22f7a 100644 --- a/en/device-dev/driver/driver-platform-i2c-des.md +++ b/en/device-dev/driver/driver-platform-i2c-des.md @@ -1,15 +1,5 @@ # I2C -- [Overview](#section5361140416) -- [Available APIs](#section545869122317) -- [Usage Guidelines](#section1695201514281) - - [How to Use](#section1338373417288) - - [Opening an I2C Controller](#section13751110132914) - - [Performing I2C Communication](#section9202183372916) - - [Closing an I2C Controller](#section19481164133018) - -- [Usage Example](#section5302202015300) - ## Overview - The Inter-Integrated Circuit \(I2C\) is a simple, bidirectional, and synchronous serial bus that uses merely two wires. diff --git a/en/device-dev/driver/driver-platform-i2c-develop.md b/en/device-dev/driver/driver-platform-i2c-develop.md index 6d3bea6f18..f7199bbd8e 100644 --- a/en/device-dev/driver/driver-platform-i2c-develop.md +++ b/en/device-dev/driver/driver-platform-i2c-develop.md @@ -1,10 +1,6 @@ # I2C -- [Overview](#section2040078630114257) -- [How to Develop](#section1085786591114257) - - [I2cMethod and I2cLockMethod](#section1683458184518) -- [Development Example](#section1773332551114257) ## Overview @@ -13,31 +9,9 @@ The Inter-Integrated Circuit \(I2C\) bus is a simple and bidirectional two-wire **Figure 1** Unified service mode ![](figures/unified-service-mode.png "unified-service-mode-8") -## How to Develop +## Available APIs -The I2C module adaptation involves the following steps: - -1. Instantiate the driver entry. - - Instantiate the **HdfDriverEntry** structure. - - Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF framework. - -2. Configure attribute files. - - Add the **deviceNode** information to the **device\_info.hcs** file. - - \(Optional\) Add the **i2c\_config.hcs** file. - -3. Instantiate the I2C controller object. - - Initialize **I2cCntlr**. - - Instantiate **I2cMethod** and **I2cLockMethod** in **I2cCntlr**. - - >![](../public_sys-resources/icon-note.gif) **NOTE:** - >For details, see [I2cMethod and I2cLockMethod](#section1683458184518) and [Table 1](#table10549174014611). - - -4. Debug the driver. - - \(Optional\) For new drivers, verify basic functions, for example, verify the information returned after the connect operation and whether data is successfully transmitted. - - -### I2cMethod and I2cLockMethod +I2cMethod and I2cLockMethod ``` struct I2cMethod { @@ -78,6 +52,32 @@ struct I2cLockMethod {// Lock mechanism operation structure +## How to Develop + +The I2C module adaptation involves the following steps: + +1. Instantiate the driver entry. + - Instantiate the **HdfDriverEntry** structure. + - Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF framework. + +2. Configure attribute files. + - Add the **deviceNode** information to the **device\_info.hcs** file. + - \(Optional\) Add the **i2c\_config.hcs** file. + +3. Instantiate the I2C controller object. + - Initialize **I2cCntlr**. + - Instantiate **I2cMethod** and **I2cLockMethod** in **I2cCntlr**. + + >![](../public_sys-resources/icon-note.gif) **NOTE:** + >For details, see [I2cMethod and I2cLockMethod](#section1683458184518) and [Table 1](#table10549174014611). + + +4. Debug the driver. + - \(Optional\) For new drivers, verify basic functions, for example, verify the information returned after the connect operation and whether data is successfully transmitted. + + + + ## Development Example The following uses **i2c\_hi35xx.c** as an example to present the contents that need to be provided by the vendor to implement device functions. -- GitLab