The WLAN module is developed based on the Hardware Driver Foundation \(HDF\). It supports cross-OS migration, component adaptation, and modular assembly and compilation. Based on the unified APIs provided by the WLAN module, driver developers of WLAN vendors can adapt their driver code and are capable of creating, disabling, scanning, and connecting to WLAN hotspots. The WLAN driver provides the Hardware Device Interface \(HDI\) layer with the capabilities of setting and obtaining the device MAC address and setting the transmit power. The following figure shows the framework of the WLAN module:
## Available APIs<a name="section7331102018815"></a>
The WLAN driver module provides APIs that can be directly called by driver developers, such as creating/releasing a **WifiModule**, connecting to/disconnecting from a WLAN hotspot, applying for/releasing a **NetBuf**, and converting between the **pbuf** structure of Lightweight IP \(lwIP\) and a **NetBuf**. [Table 1](#table1521573319472) describes some APIs.
The WLAN driver module provides APIs that can be directly called by driver developers, such as creating/releasing a **WifiModule**, connecting to/disconnecting from a WLAN hotspot, applying for/releasing a **NetBuf**, and converting between the **pbuf** structure of Lightweight IP \(lwIP\) and a**NetBuf**. [Table 1](#table1521573319472) describes some APIs.
**Table 1**APIs that can be directly called by driver developers
**Table 1** APIs that can be directly called by driver developers
@@ -110,9 +110,9 @@ The WLAN driver module provides APIs that can be directly called by driver devel
</tbody>
</table>
The WLAN driver module provides APIs for driver developers, such as initializing/deregistering, opening/stopping a **NetDevice**, and obtaining the state of a **NetDevice**. [Table 2](#table74613501475) describes some APIs.
The WLAN driver module provides APIs for driver developers, such as initializing/deregistering, opening/stopping a **NetDevice**, and obtaining the state of a**NetDevice**. [Table 2](#table74613501475) describes some APIs.
**Table 2**APIs for driver developers of WLAN vendors to implement
**Table 2** APIs for driver developers of WLAN vendors to implement
@@ -158,9 +158,9 @@ The WLAN driver module provides APIs for driver developers, such as initializing
</tbody>
</table>
The WLAN driver provides the HDI layer with the APIs for creating and destroying an **IWiFi** object and setting the MAC address. [Table 3](#table141076311618) describes some APIs.
The WLAN driver provides the HDI layer with the APIs for creating and destroying an **IWiFi** object and setting the MAC address. [Table 3](#table141076311618) describes some APIs.
@@ -223,14 +223,14 @@ The WLAN driver provides the HDI layer with the APIs for creating and destroying
The WLAN driver is developed based on the HDF and PLATFORM. It provides a unified driver model for WLAN modules of different vendors regardless of the operating system \(OS\) and system on a chip \(SoC\).
1. Set hardware parameters such as **module**\(different features\) and **chip** in the **wifi\_config.hcs** file.
2. Parse the **wifi\_config.hcs** file and generate a structure with the configured parameters.
1. Set hardware parameters such as **module**\(different features\) and **chip** in the **wifi\_config.hcs** file.
2. Parse the **wifi\_config.hcs** file and generate a structure with the configured parameters.
>Some of the above adaptation steps have been provided. For details, see [Development Example](#section1395253612512). The steps waiting to be performed by developers include setting configuration parameters based on hardware attributes, adapting and mounting a chip, and performing tests and verification.
## Development Example<a name="section1395253612512"></a>
...
...
@@ -289,7 +289,7 @@ root {
}
```
2. Mount the **init** and **deinit** functions of the WLAN chip and WLAN chip driver.
2. Mount the **init** and **deinit** functions of the WLAN chip and WLAN chip driver.
```
/* WLAN module initialization and mount process */
3. During the chip initialization, call the **NetDeviceInit\(\)** function to initialize a network device, call the **NetDeviceAdd\(\)** function to add the network device to a protocol stack, and implement some function pointers of **netdev**.
3. During the chip initialization, call the **NetDeviceInit\(\)** function to initialize a network device, call the **NetDeviceAdd\(\)** function to add the network device to a protocol stack, and implement some function pointers of**netdev**.
@@ -50,17 +50,17 @@ Based on the attributes of the pins, interfaces on the touchscreens can be class
The interfaces shown in the figure are described as follows:
1.**Power interfaces**
-**Power interfaces**
- LDO\_1P8: 1.8 V digital circuits
- LDO\_3P3: 3.3 V analog circuits
Generally, the touchscreen driver IC is separated from the LCD driver IC. In this case, the touchscreen driver IC requires both 1.8 V and 3.3 V power supplies. Nowadays, the touchscreen driver IC and LCD driver IC can be integrated. Therefore, the touchscreen, requires only the 1.8 V power supply, and the 3.3 V power required internally is supplied by the LCD VSP power \(typical value: 5.5 V\) in the driver IC.
2.**I/O control interfaces**
-**I/O control interfaces**
- RESET: reset pin, which is used to reset the driver IC on the host when suspending or resuming the system.
- INT: interrupt pin, which needs to be set to the input direction and pull-up status during driver initialization. After detecting an external touch signal, the driver triggers the interrupt by operating the interrupt pin. The driver reads the touch reporting data in the ISR function.
3.**Communications interfaces**
-**Communications interfaces**
- I2C: Since only a small amount of touch data is reported by the touchscreen, I2C is used to transmit the reported data. For details about the I2C protocol and interfaces, see [I2C](driver-platform-i2c-des.md#section5361140416).
- SPI: In addition to touch reporting data coordinates, some vendors need to obtain basic capacitance data. Therefore, Serial Peripheral Interface \(SPI\) is used to transmit such huge amount of data. For details about the SPI protocol and interfaces, see [SPI](driver-platform-spi-des.md#section193356154511).