harmony(鸿蒙)Implementation of APIs at the HAL

  • 2022-08-09
  • 浏览 (735)

Implementation of APIs at the HAL

The HAL mainly aims to decouple OpenHarmony from the SoC. The following modules describe the dependency of OpenHarmony on the SoC APIs.

Utils

Introduction

The Utils subsystem provides common basic components that can be used by other subsystems and upper-layer applications. These basic components are implemented based on the file system of the SoC. The SoC platform must implement file operations such as opening, closing, reading data from, and writing data to a file, as well as obtaining the file size.

Description for HAL APIs of the Utils subsystem

The SoC needs to implement related APIs. For details about the dependency of OpenHarmony on the SoC file system APIs, see HAL header files of Utils.

IoT Peripheral Subsystem

Introduction

The IoT peripheral subsystem provides dedicated peripheral operation interfaces for OpenHarmony, including FLASH, GPIO, I2C, PWM, UART, and WATCHDOG APIs.

Description for HAL APIs of the IoT peripheral subsystem

The SoC needs to implement related APIs. For details about the dependency of OpenHarmony on the chip peripheral APIs, see HAL header files of IoT peripherals.

WLAN

Introduction

The WLAN service enables devices to access the WLAN in the following modes:

  • Station (STA) mode: allows your device to connect to the WLAN access point enabled on other devices and routers.

  • Access point (AP) mode: enables your device to function as a WLAN access point for other devices to connect to.

The WLAN service enables you to control the WLAN in the system, including enabling, disabling, scanning for, connecting to, and disconnecting from WLAN access points.

In addition, it supports event listening. You can listen to the WLAN status and immediately detect the status change.

Description for HAL APIs of the WLAN subsystem

The code path and API definition are as follows:

foundation/communication/interfaces/kits/wifi_lite/wifiservice/
├── station_info.h
├── wifi_device_config.h
├── wifi_device.h
├── wifi_error_code.h
├── wifi_event.h
├── wifi_hotspot_config.h
├── wifi_hotspot.h
├── wifi_linked_info.h
└── wifi_scan_info.h

The vendor needs to implement defined APIs in the vendor/***/***/***_adapter directory. The following example shows how to implement these APIs for the Hi3861 chip:

vendor/hisi/hi3861/hi3861_adapter/hals/communication/wifi_lite/wifiservice/
├── BUILD.gn
└── source
├── wifi_device.c
├── wifi_device_util.c
├── wifi_device_util.h
└── wifi_hotspot.c

The SoC needs to implement related APIs. For details about the dependency of OpenHarmony on the chip peripheral APIs, see header files of WLAN.

你可能感兴趣的鸿蒙文章

harmony(鸿蒙)Introduction

harmony(鸿蒙)Combo Solution – ASR Chip Porting Case

harmony(鸿蒙)Mini-System Devices with Screens — Bestechnic SoC Porting Case

harmony(鸿蒙)Third-party Module Adaptation

harmony(鸿蒙)System Modules

harmony(鸿蒙)Board-Level Driver Adaptation

harmony(鸿蒙)lwIP Module Adaptation

harmony(鸿蒙)Porting Overview

harmony(鸿蒙)XTS

harmony(鸿蒙)Board-Level OS Porting

0  赞