From 0bc963de314ab71fd8c32719f303e8e081e19126 Mon Sep 17 00:00:00 2001 From: annie_wangli Date: Wed, 23 Feb 2022 15:04:17 +0800 Subject: [PATCH] update docs Signed-off-by: annie_wangli --- .../driver/driver-platform-sdio-des.md | 16 ------ .../driver/driver-platform-sdio-develop.md | 55 +++++++++--------- .../driver/driver-platform-spi-des.md | 12 ---- .../driver/driver-platform-spi-develop.md | 5 -- .../driver/driver-platform-uart-des.md | 16 ------ .../driver/driver-platform-uart-develop.md | 50 +++++++++-------- .../driver/driver-platform-watchdog-des.md | 15 ----- .../driver-platform-watchdog-develop.md | 56 +++++++++---------- 8 files changed, 79 insertions(+), 146 deletions(-) diff --git a/en/device-dev/driver/driver-platform-sdio-des.md b/en/device-dev/driver/driver-platform-sdio-des.md index e781662256..98c11950f2 100644 --- a/en/device-dev/driver/driver-platform-sdio-des.md +++ b/en/device-dev/driver/driver-platform-sdio-des.md @@ -1,21 +1,5 @@ # SDIO -- [Overview](#section1155271783811) -- [Available APIs](#section12601496259) -- [Usage Guidelines](#section1878939192515) - - [How to Use](#section1490685512255) - - [Opening an SDIO Controller](#section10782428132616) - - [Claiming a Host Exclusively](#section11263172312715) - - [Enabling the SDIO Device](#section17861486271) - - [Claiming an SDIO IRQ](#section521213262286) - - [Performing SDIO Communication](#section85661522153420) - - [Releasing the SDIO IRQ](#section1683449352) - - [Disabling the SDIO Device](#section15379324143611) - - [Releasing the Exclusively Claimed Host](#section536018263713) - - [Closing an SDIO Controller](#section4752739183716) - -- [Usage Example](#section376910122382) - ## Overview - Secure Digital Input/Output \(SDIO\) is a peripheral interface evolved from the Secure Digital \(SD\) memory card interface. The SDIO interface is compatible with SD memory cards and can be connected to devices that support the SDIO interface. diff --git a/en/device-dev/driver/driver-platform-sdio-develop.md b/en/device-dev/driver/driver-platform-sdio-develop.md index f954769c94..cdc43461d1 100644 --- a/en/device-dev/driver/driver-platform-sdio-develop.md +++ b/en/device-dev/driver/driver-platform-sdio-develop.md @@ -1,10 +1,5 @@ # SDIO -- [Overview](#section1347805272150053) -- [How to Develop](#section581179475150053) - - [SdioDeviceOps](#section482911395315) - -- [Development Example](#section2112250242150053) ## Overview @@ -13,31 +8,9 @@ A Secure Digital Input Output \(SDIO\) card is an extension of the SD specificat **Figure 1** Independent service mode ![](figures/independent-service-mode.png "independent-service-mode-12") -## How to Develop - -The SDIO 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 **sdio\_config.hcs** file. - -3. Instantiate the SDIO controller object. - - Initialize **SdioDevice**. - - Instantiate **SdioDeviceOps** in the **SdioDevice** object. - - >![](../public_sys-resources/icon-note.gif) **NOTE:** - >For details, see [SdioDeviceOps](#section482911395315) and [Table 1](#table878215448417). - - -4. Debug the driver. - - \(Optional\) For new drivers, verify the basic functions, such as the SDIO control status and response to interrupts. - +## Available APIs -### SdioDeviceOps +SdioDeviceOps ``` // Function template @@ -300,6 +273,30 @@ struct SdioDeviceOps { >- **irqCap**: specifies the interrupt request \(IRQ\) capabilities. >- **\(void \*\)data** +## How to Develop + +The SDIO 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 **sdio\_config.hcs** file. + +3. Instantiate the SDIO controller object. + - Initialize **SdioDevice**. + - Instantiate **SdioDeviceOps** in the **SdioDevice** object. + + >![](../public_sys-resources/icon-note.gif) **NOTE:** + >For details, see [SdioDeviceOps](#section482911395315) and [Table 1](#table878215448417). + + +4. Debug the driver. + - \(Optional\) For new drivers, verify the basic functions, such as the SDIO control status and response to interrupts. + + ## Development Example The following uses **sdio\_adapter.c** as an example to present the contents that need to be provided by the vendor to implement device functions. diff --git a/en/device-dev/driver/driver-platform-spi-des.md b/en/device-dev/driver/driver-platform-spi-des.md index a11b550624..4388fdd99b 100644 --- a/en/device-dev/driver/driver-platform-spi-des.md +++ b/en/device-dev/driver/driver-platform-spi-des.md @@ -1,17 +1,5 @@ # SPI -- [Overview](#section193356154511) -- [Available APIs](#section1325964832615) -- [Usage Guidelines](#section71363452477) - - [How to Use](#section32846814820) - - [Obtaining an SPI Device Handle](#section1927265711481) - - [Obtaining SPI Device Configuration Parameters](#section541133418493) - - [Setting SPI Device Configuration Parameters](#section7870106145010) - - [Performing SPI Communication](#section13324155195013) - - [Destroying the SPI Device Handle](#section19661632135117) - -- [Usage Example](#section06541058155120) - ## Overview - Serial Peripheral Interface \(SPI\) is a serial bus specification used for high-speed, full-duplex, and synchronous communication. diff --git a/en/device-dev/driver/driver-platform-spi-develop.md b/en/device-dev/driver/driver-platform-spi-develop.md index b09cf5f471..687a93aa90 100644 --- a/en/device-dev/driver/driver-platform-spi-develop.md +++ b/en/device-dev/driver/driver-platform-spi-develop.md @@ -1,10 +1,5 @@ # SPI -- [Overview](#section84922229152909) -- [Available APIs](#section752964871810) -- [How to Develop](#section799667984152909) -- [Development Example](#section956157227152909) - ## Overview diff --git a/en/device-dev/driver/driver-platform-uart-des.md b/en/device-dev/driver/driver-platform-uart-des.md index f6d43fd109..0d8809f05b 100644 --- a/en/device-dev/driver/driver-platform-uart-des.md +++ b/en/device-dev/driver/driver-platform-uart-des.md @@ -1,21 +1,5 @@ # UART -- [Overview](#section833012453535) -- [Available APIs](#section1928742202715) -- [Usage Guidelines](#section12779050105412) - - [How to Use](#section1858116395510) - - [Obtaining a UART Device Handle](#section124512065617) - - [Setting the UART Baud Rate](#section86881004579) - - [Obtaining the UART Baud Rate](#section897032965712) - - [Setting the UART Device Attributes](#section129141884588) - - [Obtaining UART Device Attributes](#section18689637165812) - - [Setting the UART Transmission Mode](#section72713435918) - - [Writing Data of a Specified Length into a UART Device](#section128001736155919) - - [Reading Data of a Specified Length from a UART Device](#section92851601604) - - [Destroying the UART Device Handle](#section1477410521406) - -- [Usage Example](#section35404241311) - ## Overview - The Universal Asynchronous Receiver/Transmitter \(UART\) is a universal serial data bus used for asynchronous communication. It enables bi-directional communication between devices in full-duplex mode. diff --git a/en/device-dev/driver/driver-platform-uart-develop.md b/en/device-dev/driver/driver-platform-uart-develop.md index 3964b5ad1b..fc92e1a98c 100644 --- a/en/device-dev/driver/driver-platform-uart-develop.md +++ b/en/device-dev/driver/driver-platform-uart-develop.md @@ -13,31 +13,9 @@ In the Hardware Driver Foundation \(HDF\) framework, the Universal Asynchronous **Figure 1** Independent service mode ![](figures/independent-service-mode.png "independent-service-mode-14") -## How to Develop - -The UART 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 **uart\_config.hcs** file. - -3. Instantiate the UART controller object. - - Initialize **UartHost**. - - Instantiate **UartHostMethod** in the **UartHost** object. - - >![](../public_sys-resources/icon-note.gif) **NOTE:** - >For details, see [UartHostMethod](#section192316441461) and [Table 1](#table22862114719). +## Available APIs - -4. Debug the driver. - - \(Optional\) For new drivers, verify the basic functions, such as the UART control status and response to interrupts. - - -### UartHostMethod +UartHostMethod ``` struct UartHostMethod { @@ -190,6 +168,30 @@ struct UartHostMethod { +## How to Develop + +The UART 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 **uart\_config.hcs** file. + +3. Instantiate the UART controller object. + - Initialize **UartHost**. + - Instantiate **UartHostMethod** in the **UartHost** object. + + >![](../public_sys-resources/icon-note.gif) **NOTE:** + >For details, see [UartHostMethod](#section192316441461) and [Table 1](#table22862114719). + + +4. Debug the driver. + - \(Optional\) For new drivers, verify the basic functions, such as the UART control status and response to interrupts. + + ## Development Example The following uses **uart\_hi35xx.c** as an example to present the contents that need to be provided by the vendor to implement device functions. diff --git a/en/device-dev/driver/driver-platform-watchdog-des.md b/en/device-dev/driver/driver-platform-watchdog-des.md index ba879b0aea..e571e6fc34 100644 --- a/en/device-dev/driver/driver-platform-watchdog-des.md +++ b/en/device-dev/driver/driver-platform-watchdog-des.md @@ -1,20 +1,5 @@ # Watchdog -- [Overview](#section14918241977) -- [Available APIs](#section1180575010271) -- [Usage Guidelines](#section10103184312813) - - [How to Use](#section10181195910815) - - [Opening a Watchdog](#section66089201107) - - [Obtaining the Watchdog Status](#section786624341011) - - [Setting the Timeout Duration](#section182386137111) - - [Obtaining the Timeout Duration](#section1883310371114) - - [Starting a Watchdog](#section82501405123) - - [Feeding a Watchdog](#section3547530101211) - - [Stopping a Watchdog](#section944595841217) - - [Closing a Watchdog](#section96561824121311) - -- [Usage Example](#section1724514523135) - ## Overview A watchdog, also called a watchdog timer, is a hardware timing device. If an error occurs in the main program of the system and fails to reset the watchdog timer, the watchdog timer sends a reset signal to restore the system to a normal state. diff --git a/en/device-dev/driver/driver-platform-watchdog-develop.md b/en/device-dev/driver/driver-platform-watchdog-develop.md index 2c01a9b2dc..6d1bb7bebd 100644 --- a/en/device-dev/driver/driver-platform-watchdog-develop.md +++ b/en/device-dev/driver/driver-platform-watchdog-develop.md @@ -1,10 +1,5 @@ # Watchdog -- [Overview](#section1315827527160117) -- [How to Develop](#section477974542160117) - - [WatchdogMethod](#section220331929) - -- [Development Example](#section1832270347160117) ## Overview @@ -13,31 +8,9 @@ In the Hardware Driver Foundation \(HDF\) framework, the Watchdog \(also called **Figure 1** Independent service mode ![](figures/independent-service-mode.png "independent-service-mode-15") -## How to Develop - -The Watchdog module adaptation involves the following steps: +## Available APIs -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 **watchdog\_config.hcs** file. - -3. Instantiate the Watchdog controller object. - - Initialize **WatchdogCntlr**. - - Instantiate **WatchdogMethod** in the **WatchdogCntlr** object. - - >![](../public_sys-resources/icon-note.gif) **NOTE:** - >For details, see [WatchdogMethod](#section220331929) and [Table 1](#table1370451732). - - -4. Debug the driver. - - \(Optional\) For new drivers, verify basic functions, for example, verify the information returned after the connect operation and whether the watchdog timer is successfully set. - - -### WatchdogMethod +WatchdogMethod ``` struct WatchdogMethod { @@ -137,6 +110,31 @@ struct WatchdogMethod { + +## How to Develop + +The Watchdog 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 **watchdog\_config.hcs** file. + +3. Instantiate the Watchdog controller object. + - Initialize **WatchdogCntlr**. + - Instantiate **WatchdogMethod** in the **WatchdogCntlr** object. + + >![](../public_sys-resources/icon-note.gif) **NOTE:** + >For details, see [WatchdogMethod](#section220331929) and [Table 1](#table1370451732). + + +4. Debug the driver. + - \(Optional\) For new drivers, verify basic functions, for example, verify the information returned after the connect operation and whether the watchdog timer is successfully set. + + ## Development Example The following uses **watchdog\_hi35xx.c** as an example to present the contents that need to be provided by the vendor to implement device functions. -- GitLab