1 Star 0 Fork 4.9K

bill / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
gpiooverview.md 5.67 KB
一键复制 编辑 原始数据 按行查看 历史
NEEN 提交于 2021-03-12 17:59 . !197 Docs Update version 1.0.1

GPIO Overview

Introduction

GPIO is short for general-purpose input/output. Generally, a GPIO controller manages all GPIO pins by group. Each group of GPIO pins is associated with one or more registers. The GPIO pins are operated by reading data from and writing data to the registers.

The GPIO APIs define a set of standard functions for performing operations on GPIO pins, including:

  • Setting the pin direction, which can be input or output (High impedance is not supported currently.)

  • Reading and writing level values, which can be low or high

  • Setting an interrupt service routine (ISR) function and interrupt trigger mode for a pin

  • Enabling or disabling a pin interrupt

Available APIs

Table 1 APIs available for the GPIO driver

Capability

Function

Description

GPIO read/write

GpioRead

Reads the level value of a GPIO pin.

GpioWrite

Writes the level value of a GPIO pin.

GPIO settings

GpioSetDir

Sets the direction for a GPIO pin.

GpioGetDir

Obtains the direction for a GPIO pin.

GPIO interrupt settings

GpioSetIrq

Sets the ISR function for a GPIO pin.

GpioUnSetIrq

Cancels the setting of the ISR function for a GPIO pin.

GpioEnableIrq

Enables a GPIO interrupt.

GpioDisableIrq

Disables a GPIO interrupt.

NOTE: All functions provided in this document can be called only in kernel mode.

1
https://gitee.com/ximeibaba/docs.git
git@gitee.com:ximeibaba/docs.git
ximeibaba
docs
docs
master

搜索帮助