GPIO控制 ======== :: >作者:武壮壮(硬件) 汪远(软件) 更新时间:2020年8月8日 关键字:gpio 概述 ---- Air724UG模块引脚共支持29个GPIO,部分引脚上电前后状态不同,如使用这些管脚,需根据实际情况使用。 管脚定义: ---------- :: VLCD、VMMC、VSIM1相关引脚电压域会根据外部硬件,其内部自动调整其输出电压,为1.8V/3V/3.3V At reset, after reset 都默认指的就是function 0功能的状态(即GPIO 配置还没生效前的状态) GPIO0~5 电源域默认关闭,所以at reset, after reset状态都是L GPIO29~31电源域默认关闭,所以at reset, after reset状态都是L +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | | | | Pin | | | | | | | Fun | | Fun | | Fun | | | | | | S | | | | | | | ction | | ction | | ction | | | | | | tate | | | | | | | 0 | | 1 | | 2 | | +===+===+===+======+===+===+===+===+===+===+=======+===+=======+===+=======+====+ | A | G | N | At | | A | | P | P | P | Fun | T | Fun | T | Fun | Ty | | i | P | a | Re | | f | | o | u | u | ction | y | ction | y | ction | pe | | r | I | m | set( | | t | | w | l | l | 0 | p | 1 | p | 2 | | | 7 | O | e | H/L/ | | e | | e | l | l | | e | | e | | | | 2 | n | | Hiz) | | r | | r | - | - | | | | | | | | 4 | u | | | | R | | D | u | D | | | | | | | | U | m | | | | e | | o | p | o | | | | | | | | G | b | | | | s | | m | | w | | | | | | | | P | e | | | | e | | a | | n | | | | | | | | I | r | | | | t | | i | | | | | | | | | | N | | | | | ( | | n | | | | | | | | | | N | | | | | H | | | | | | | | | | | | O | | | | | / | | | | | | | | | | | | . | | | | | L | | | | | | | | | | | | | | | | | / | | | | | | | | | | | | | | | | | H | | | | | | | | | | | | | | | | | i | | | | | | | | | | | | | | | | | z | | | | | | | | | | | | | | | | | ) | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 4 | G | L | I | L | I | L | V | 2 | 5 | G | I | LCD | O | | | | 1 | P | C | NPUT | | N | | L | 0 | 0 | PIO_0 | / | _DATA | | | | | | I | D | | | P | | C | K | K | | O | | | | | | | O | _ | | | U | | D | / | | | | | | | | | | _ | D | | | T | | ( | 4 | | | | | | | | | | 0 | A | | | | | 1 | . | | | | | | | | | | | T | | | | | . | 7 | | | | | | | | | | | A | | | | | 8 | K | | | | | | | | | | | / | | | | | V | / | | | | | | | | | | | G | | | | | / | 1 | | | | | | | | | | | P | | | | | 3 | . | | | | | | | | | | | I | | | | | V | 8 | | | | | | | | | | | O | | | | | / | K | | | | | | | | | | | _ | | | | | 3 | | | | | | | | | | | | 0 | | | | | . | | | | | | | | | | | | | | | | | 3 | | | | | | | | | | | | | | | | | V | | | | | | | | | | | | | | | | | ) | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 5 | G | L | I | L | I | L | V | 2 | 5 | G | I | L | O | NET_S | O | | 8 | P | C | NPUT | | N | | L | 0 | 0 | PIO_1 | / | CD_DC | | TATUS | | | | I | D | | | P | | C | K | K | | O | | | | | | | O | _ | | | U | | D | / | | | | | | | | | | _ | D | | | T | | ( | 4 | | | | | | | | | | 1 | C | | | | | 1 | . | | | | | | | | | | | / | | | | | . | 7 | | | | | | | | | | | N | | | | | 8 | K | | | | | | | | | | | E | | | | | V | / | | | | | | | | | | | T | | | | | / | 1 | | | | | | | | | | | _ | | | | | 3 | . | | | | | | | | | | | S | | | | | V | 8 | | | | | | | | | | | T | | | | | / | K | | | | | | | | | | | A | | | | | 3 | | | | | | | | | | | | T | | | | | . | | | | | | | | | | | | U | | | | | 3 | | | | | | | | | | | | S | | | | | V | | | | | | | | | | | | / | | | | | ) | | | | | | | | | | | | G | | | | | | | | | | | | | | | | | P | | | | | | | | | | | | | | | | | I | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 1 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 4 | G | L | I | L | I | L | V | 2 | 5 | G | I | LC | O | A | I | | 0 | P | C | NPUT | | N | | L | 0 | 0 | PIO_2 | / | D_CLK | | P_WAK | | | | I | D | | | P | | C | K | K | | O | | | EUP_M | | | | O | _ | | | U | | D | / | | | | | | ODULE | | | | _ | C | | | T | | ( | 4 | | | | | | | | | | 2 | L | | | | | 1 | . | | | | | | | | | | | K | | | | | . | 7 | | | | | | | | | | | / | | | | | 8 | K | | | | | | | | | | | A | | | | | V | / | | | | | | | | | | | P | | | | | / | 1 | | | | | | | | | | | _ | | | | | 3 | . | | | | | | | | | | | W | | | | | V | 8 | | | | | | | | | | | A | | | | | / | K | | | | | | | | | | | K | | | | | 3 | | | | | | | | | | | | E | | | | | . | | | | | | | | | | | | U | | | | | 3 | | | | | | | | | | | | P | | | | | V | | | | | | | | | | | | _ | | | | | ) | | | | | | | | | | | | M | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | D | | | | | | | | | | | | | | | | | U | | | | | | | | | | | | | | | | | L | | | | | | | | | | | | | | | | | E | | | | | | | | | | | | | | | | | / | | | | | | | | | | | | | | | | | G | | | | | | | | | | | | | | | | | P | | | | | | | | | | | | | | | | | I | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 2 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 3 | G | L | I | L | I | L | V | 2 | 5 | G | I | L | O | WAKEU | O | | 9 | P | C | NPUT | | N | | L | 0 | 0 | PIO_3 | / | CD_CS | | P_OUT | | | | I | D | | | P | | C | K | K | | O | | | | | | | O | _ | | | U | | D | / | | | | | | | | | | _ | C | | | T | | ( | 4 | | | | | | | | | | 3 | S | | | | | 1 | . | | | | | | | | | | | / | | | | | . | 7 | | | | | | | | | | | W | | | | | 8 | K | | | | | | | | | | | A | | | | | V | / | | | | | | | | | | | K | | | | | / | 1 | | | | | | | | | | | E | | | | | 3 | . | | | | | | | | | | | U | | | | | V | 8 | | | | | | | | | | | P | | | | | / | K | | | | | | | | | | | _ | | | | | 3 | | | | | | | | | | | | O | | | | | . | | | | | | | | | | | | U | | | | | 3 | | | | | | | | | | | | T | | | | | V | | | | | | | | | | | | / | | | | | ) | | | | | | | | | | | | G | | | | | | | | | | | | | | | | | P | | | | | | | | | | | | | | | | | I | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 3 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 5 | G | L | I | L | I | L | V | 2 | 5 | G | I | LC | O | NET | O | | 7 | P | C | NPUT | | N | | L | 0 | 0 | PIO_4 | / | D_SEL | | _MODE | | | | I | D | | | P | | C | K | K | | O | | | | | | | O | _ | | | U | | D | / | | | | | | | | | | _ | S | | | T | | ( | 4 | | | | | | | | | | 4 | E | | | | | 1 | . | | | | | | | | | | | L | | | | | . | 7 | | | | | | | | | | | / | | | | | 8 | K | | | | | | | | | | | N | | | | | V | / | | | | | | | | | | | E | | | | | / | 1 | | | | | | | | | | | T | | | | | 3 | . | | | | | | | | | | | _ | | | | | V | 8 | | | | | | | | | | | M | | | | | / | K | | | | | | | | | | | O | | | | | 3 | | | | | | | | | | | | D | | | | | . | | | | | | | | | | | | E | | | | | 3 | | | | | | | | | | | | / | | | | | V | | | | | | | | | | | | G | | | | | ) | | | | | | | | | | | | P | | | | | | | | | | | | | | | | | I | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 4 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 4 | G | M | I | L | I | L | V | 2 | 4 | G | I | MOD | O | | | | 9 | P | O | NPUT | | N | 4 | D | 0 | 0 | PIO_5 | / | ULE_S | | | | | | I | D | | | P | 0 | D | K | K | | O | TATUS | | | | | | O | U | | | U | 0 | I | / | | | | | | | | | | _ | L | | | T | m | O | 4 | | | | | | | | | | 5 | E | | | | s | ( | . | | | | | | | | | | | _ | | | | 后 | 1 | 7 | | | | | | | | | | | S | | | | , | . | K | | | | | | | | | | | T | | | | 由 | 8 | | | | | | | | | | | | A | | | | 底 | V | | | | | | | | | | | | T | | | | 层 | ) | | | | | | | | | | | | U | | | | 软 | | | | | | | | | | | | | S | | | | 件 | | | | | | | | | | | | | / | | | | 控 | | | | | | | | | | | | | G | | | | 制 | | | | | | | | | | | | | P | | | | 为 | | | | | | | | | | | | | I | | | | O | | | | | | | | | | | | | O | | | | U | | | | | | | | | | | | | _ | | | | T | | | | | | | | | | | | | 5 | | | | P | | | | | | | | | | | | | | | | | U | | | | | | | | | | | | | | | | | T | | | | | | | | | | | | | | | | | 变 | | | | | | | | | | | | | | | | | H | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 8 | G | G | I | L | I | L | V | 2 | 4 | G | I | | | | | | 2 | P | P | NPUT | | N | | D | 0 | 0 | PIO_7 | / | | | | | | | I | I | | | P | | D | K | K | | O | | | | | | | O | O | | | U | | I | / | | | | | | | | | | _ | _ | | | T | | O | 4 | | | | | | | | | | 7 | 7 | | | | | ( | . | | | | | | | | | | | | | | | | 1 | 7 | | | | | | | | | | | | | | | | . | K | | | | | | | | | | | | | | | | 8 | | | | | | | | | | | | | | | | | V | | | | | | | | | | | | | | | | | ) | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 5 | G | S | I | L | I | L | V | 2 | 4 | G | I | SPI | I | | | | 2 | P | P | NPUT | | N | | D | 0 | 0 | PIO_9 | / | 1_CLK | / | | | | | I | I | | | P | | D | K | K | | O | | O | | | | | O | 1 | | | U | | I | / | | | | | | | | | | _ | _ | | | T | | O | 4 | | | | | | | | | | 9 | C | | | | | ( | . | | | | | | | | | | | L | | | | | 1 | 7 | | | | | | | | | | | K | | | | | . | K | | | | | | | | | | | / | | | | | 8 | | | | | | | | | | | | G | | | | | V | | | | | | | | | | | | P | | | | | ) | | | | | | | | | | | | I | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 9 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 5 | G | S | I | L | I | L | V | 2 | 4 | GP | I | SP | I | | | | 4 | P | P | NPUT | | N | | D | 0 | 0 | IO_10 | / | I1_CS | / | | | | | I | I | | | P | | D | K | K | | O | | O | | | | | O | 1 | | | U | | I | / | | | | | | | | | | _ | _ | | | T | | O | 4 | | | | | | | | | | 1 | C | | | | | ( | . | | | | | | | | | | 0 | S | | | | | 1 | 7 | | | | | | | | | | | / | | | | | . | K | | | | | | | | | | | G | | | | | 8 | | | | | | | | | | | | P | | | | | V | | | | | | | | | | | | I | | | | | ) | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 1 | | | | | | | | | | | | | | | | | 0 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 5 | G | S | I | L | I | L | V | 2 | 4 | GP | I | SPI1 | I | | | | 5 | P | P | NPUT | | N | | D | 0 | 0 | IO_11 | / | _DOUT | / | | | | | I | I | | | P | | D | K | K | | O | | O | | | | | O | 1 | | | U | | I | / | | | | | | | | | | _ | _ | | | T | | O | 4 | | | | | | | | | | 1 | D | | | | | ( | . | | | | | | | | | | 1 | O | | | | | 1 | 7 | | | | | | | | | | | U | | | | | . | K | | | | | | | | | | | T | | | | | 8 | | | | | | | | | | | | / | | | | | V | | | | | | | | | | | | G | | | | | ) | | | | | | | | | | | | P | | | | | | | | | | | | | | | | | I | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 1 | | | | | | | | | | | | | | | | | 1 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 5 | G | S | I | L | I | L | V | 2 | 4 | GP | I | SPI | I | | | | 3 | P | P | NPUT | | N | | D | 0 | 0 | IO_12 | / | 1_DIN | / | | | | | I | I | | | P | | D | K | K | | O | | O | | | | | O | 1 | | | U | | I | / | | | | | | | | | | _ | _ | | | T | | O | 4 | | | | | | | | | | 1 | D | | | | | ( | . | | | | | | | | | | 2 | I | | | | | 1 | 7 | | | | | | | | | | | N | | | | | . | K | | | | | | | | | | | / | | | | | 8 | | | | | | | | | | | | G | | | | | V | | | | | | | | | | | | P | | | | | ) | | | | | | | | | | | | I | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 1 | | | | | | | | | | | | | | | | | 2 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 4 | G | G | I | L | I | L | V | 2 | 4 | GP | I | | | | | | 3 | P | P | NPUT | | N | | D | 0 | 0 | IO_13 | / | | | | | | | I | I | | | P | | D | K | K | | O | | | | | | | O | O | | | U | | I | / | | | | | | | | | | _ | _ | | | T | | O | 4 | | | | | | | | | | 1 | 1 | | | | | ( | . | | | | | | | | | | 3 | 3 | | | | | 1 | 7 | | | | | | | | | | | | | | | | . | K | | | | | | | | | | | | | | | | 8 | | | | | | | | | | | | | | | | | V | | | | | | | | | | | | | | | | | ) | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 3 | G | I | I | L | I | L | V | 2 | 4 | GP | I | I2C | O | | | | 2 | P | 2 | NPUT | | N | | D | 0 | 0 | IO_14 | / | 2_SCL | | | | | | I | C | | | P | | D | K | K | | O | | | | | | | O | 2 | | | U | | I | / | | | | | | | | | | _ | _ | | | T | | O | 1 | | | | | | | | | | 1 | S | | | | | ( | . | | | | | | | | | | 4 | C | | | | | 1 | 8 | | | | | | | | | | | L | | | | | . | K | | | | | | | | | | | / | | | | | 8 | | | | | | | | | | | | G | | | | | V | | | | | | | | | | | | P | | | | | ) | | | | | | | | | | | | I | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 1 | | | | | | | | | | | | | | | | | 4 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 3 | G | I | I | L | I | L | V | 2 | 4 | GP | I | I2C | I | | | | 1 | P | 2 | NPUT | | N | | D | 0 | 0 | IO_15 | / | 2_SDA | / | | | | | I | C | | | P | | D | K | K | | O | | O | | | | | O | 2 | | | U | | I | / | | | | | | | | | | _ | _ | | | T | | O | 1 | | | | | | | | | | 1 | S | | | | | ( | . | | | | | | | | | | 5 | D | | | | | 1 | 8 | | | | | | | | | | | A | | | | | . | K | | | | | | | | | | | / | | | | | 8 | | | | | | | | | | | | G | | | | | V | | | | | | | | | | | | P | | | | | ) | | | | | | | | | | | | I | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 1 | | | | | | | | | | | | | | | | | 5 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 5 | G | C | I | H | I | H | V | 2 | 4 | GP | I | C | I | | | | 0 | P | A | NPUT | | N | | D | 0 | 0 | IO_17 | / | AMI2C | / | | | | | I | M | | | P | | D | K | K | | O | _SDA1 | O | | | | | O | I | | | U | | I | / | | | | | | | | | | _ | 2 | | | T | | O | 1 | | | | | | | | | | 1 | C | | | | | ( | . | | | | | | | | | | 7 | _ | | | | | 1 | 8 | | | | | | | | | | | S | | | | | . | K | | | | | | | | | | | D | | | | | 8 | | | | | | | | | | | | A | | | | | V | | | | | | | | | | | | 1 | | | | | ) | | | | | | | | | | | | / | | | | | | | | | | | | | | | | | G | | | | | | | | | | | | | | | | | P | | | | | | | | | | | | | | | | | I | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 1 | | | | | | | | | | | | | | | | | 7 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 3 | G | U | I | L | I | L | V | 2 | 4 | GP | I | UART | I | | | | 8 | P | A | NPUT | | N | | D | 0 | 0 | IO_18 | / | 1_CTS | | | | | | I | R | | | P | | D | K | K | | O | | | | | | | O | T | | | U | | I | / | | | | | | | | | | _ | 1 | | | T | | O | 4 | | | | | | | | | | 1 | _ | | | | | ( | . | | | | | | | | | | 8 | C | | | | | 1 | 7 | | | | | | | | | | | T | | | | | . | K | | | | | | | | | | | S | | | | | 8 | | | | | | | | | | | | / | | | | | V | | | | | | | | | | | | G | | | | | ) | | | | | | | | | | | | P | | | | | | | | | | | | | | | | | I | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 1 | | | | | | | | | | | | | | | | | 8 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 3 | G | U | I | L | I | L | V | 2 | 4 | GP | I | UART | O | | | | 7 | P | A | NPUT | | N | | D | 0 | 0 | IO_19 | / | 1_RTS | | | | | | I | R | | | P | | D | K | K | | O | | | | | | | O | T | | | U | | I | / | | | | | | | | | | _ | 1 | | | T | | O | 4 | | | | | | | | | | 1 | _ | | | | | ( | . | | | | | | | | | | 9 | R | | | | | 1 | 7 | | | | | | | | | | | T | | | | | . | K | | | | | | | | | | | S | | | | | 8 | | | | | | | | | | | | / | | | | | V | | | | | | | | | | | | G | | | | | ) | | | | | | | | | | | | P | | | | | | | | | | | | | | | | | I | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 1 | | | | | | | | | | | | | | | | | 9 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 3 | G | U | I | L | O | L | V | 2 | 4 | GP | I | UART | I | | | | | P | A | NPUT | | U | 5 | D | 0 | 0 | IO_20 | / | 2_RXD | | | | | | I | R | | | T | m | D | K | K | | O | | | | | | | O | T | | | P | s | I | / | | | | | | | | | | _ | 2 | | | U | 后 | O | 4 | | | | | | | | | | 2 | _ | | | T | 变 | ( | . | | | | | | | | | | 0 | R | | | | 为 | 1 | 7 | | | | | | | | | | | X | | | | H | . | K | | | | | | | | | | | D | | | | | 8 | | | | | | | | | | | | / | | | | | V | | | | | | | | | | | | G | | | | | ) | | | | | | | | | | | | P | | | | | | | | | | | | | | | | | I | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 2 | | | | | | | | | | | | | | | | | 0 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 4 | G | U | I | L | O | 输 | V | 2 | 4 | GP | I | UART | O | | | | | P | A | NPUT | | U | 出 | D | 0 | 0 | IO_21 | / | 2_TXD | | | | | | I | R | | | T | l | D | K | K | | O | | | | | | | O | T | | | P | o | I | / | | | | | | | | | | _ | 2 | | | U | g | O | 4 | | | | | | | | | | 2 | _ | | | T | , | ( | . | | | | | | | | | | 1 | T | | | | 不 | 1 | 7 | | | | | | | | | | | X | | | | 建 | . | K | | | | | | | | | | | D | | | | 议 | 8 | | | | | | | | | | | | / | | | | 使 | V | | | | | | | | | | | | G | | | | 用 | ) | | | | | | | | | | | | P | | | | | | | | | | | | | | | | | I | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 2 | | | | | | | | | | | | | | | | | 1 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 7 | G | Z | I | L | O | L | V | 2 | 4 | GP | I | ZS | O | | | | | P | S | NPUT | | U | 5 | D | 0 | 0 | IO_22 | / | P_UAR | | | | | | I | P | | | T | m | D | K | K | | O | T_TXD | | | | | | O | _ | | | P | s | I | / | | | | | | | | | | _ | U | | | U | 后 | O | 4 | | | | | | | | | | 2 | A | | | T | 变 | ( | . | | | | | | | | | | 2 | R | | | | 为 | 1 | 7 | | | | | | | | | | | T | | | | H | . | K | | | | | | | | | | | _ | | | | | 8 | | | | | | | | | | | | T | | | | | V | | | | | | | | | | | | X | | | | | ) | | | | | | | | | | | | D | | | | | | | | | | | | | | | | | / | | | | | | | | | | | | | | | | | G | | | | | | | | | | | | | | | | | P | | | | | | | | | | | | | | | | | I | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 2 | | | | | | | | | | | | | | | | | 2 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 8 | G | U | I | L | O | 输 | V | 2 | 4 | GP | I | US | I | | | | | P | S | NPUT | | U | 出 | D | 0 | 0 | IO_23 | / | IM_CD | | | | | | I | I | | | T | l | D | K | K | | O | | | | | | | O | M | | | P | o | I | / | | | | | | | | | | _ | _ | | | U | g | O | 4 | | | | | | | | | | 2 | C | | | T | , | ( | . | | | | | | | | | | 3 | D | | | | 不 | 1 | 7 | | | | | | | | | | | / | | | | 建 | . | K | | | | | | | | | | | G | | | | 议 | 8 | | | | | | | | | | | | P | | | | 使 | V | | | | | | | | | | | | I | | | | 用 | ) | | | | | | | | | | | | O | | | | | | | | | | | | | | | | | _ | | | | | | | | | | | | | | | | | 2 | | | | | | | | | | | | | | | | | 3 | | | | | | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 2 | G | M | I | H | I | H | V | 2 | 5 | GP | I | MMC | I | | | | 7 | P | M | NPUT | | N | | M | 0 | 0 | IO_24 | / | 1_CMD | / | | | | | I | C | | | P | | M | K | K | | O | | O | | | | | O | 1 | | | U | | C | / | | | | | | | | | | _ | _ | | | T | | ( | 4 | | | | | | | | | | 2 | C | | | | | 1 | . | | | | | | | | | | 4 | M | | | | | . | 7 | | | | | | | | | | | D | | | | | 8 | K | | | | | | | | | | | / | | | | | V | / | | | | | | | | | | | G | | | | | / | 1 | | | | | | | | | | | P | | | | | 3 | . | | | | | | | | | | | I | | | | | V | 8 | | | | | | | | | | | O | | | | | / | K | | | | | | | | | | | _ | | | | | 3 | | | | | | | | | | | | 2 | | | | | . | | | | | | | | | | | | 4 | | | | | 3 | | | | | | | | | | | | | | | | | V | | | | | | | | | | | | | | | | | ) | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 2 | G | M | I | H | I | H | V | 2 | 5 | GP | I | MMC1 | I | | | | 9 | P | M | NPUT | | N | | M | 0 | 0 | IO_25 | / | _DAT0 | / | | | | | I | C | | | P | | M | K | K | | O | | O | | | | | O | 1 | | | U | | C | / | | | | | | | | | | _ | _ | | | T | | ( | 4 | | | | | | | | | | 2 | D | | | | | 1 | . | | | | | | | | | | 5 | A | | | | | . | 7 | | | | | | | | | | | T | | | | | 8 | K | | | | | | | | | | | 0 | | | | | V | / | | | | | | | | | | | / | | | | | / | 1 | | | | | | | | | | | G | | | | | 3 | . | | | | | | | | | | | P | | | | | V | 8 | | | | | | | | | | | I | | | | | / | K | | | | | | | | | | | O | | | | | 3 | | | | | | | | | | | | _ | | | | | . | | | | | | | | | | | | 2 | | | | | 3 | | | | | | | | | | | | 5 | | | | | V | | | | | | | | | | | | | | | | | ) | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 3 | G | M | I | H | I | H | V | 2 | 5 | GP | I | MMC1 | I | | | | 0 | P | M | NPUT | | N | | M | 0 | 0 | IO_26 | / | _DAT1 | / | | | | | I | C | | | P | | M | K | K | | O | | O | | | | | O | 1 | | | U | | C | / | | | | | | | | | | _ | _ | | | T | | ( | 4 | | | | | | | | | | 2 | D | | | | | 1 | . | | | | | | | | | | 6 | A | | | | | . | 7 | | | | | | | | | | | T | | | | | 8 | K | | | | | | | | | | | 1 | | | | | V | / | | | | | | | | | | | / | | | | | / | 1 | | | | | | | | | | | G | | | | | 3 | . | | | | | | | | | | | P | | | | | V | 8 | | | | | | | | | | | I | | | | | / | K | | | | | | | | | | | O | | | | | 3 | | | | | | | | | | | | _ | | | | | . | | | | | | | | | | | | 2 | | | | | 3 | | | | | | | | | | | | 6 | | | | | V | | | | | | | | | | | | | | | | | ) | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 2 | G | M | I | H | I | H | V | 2 | 5 | GP | I | MMC1 | I | | | | 5 | P | M | NPUT | | N | | M | 0 | 0 | IO_27 | / | _DAT2 | / | | | | | I | C | | | P | | M | K | K | | O | | O | | | | | O | 1 | | | U | | C | / | | | | | | | | | | _ | _ | | | T | | ( | 4 | | | | | | | | | | 2 | D | | | | | 1 | . | | | | | | | | | | 7 | A | | | | | . | 7 | | | | | | | | | | | T | | | | | 8 | K | | | | | | | | | | | 2 | | | | | V | / | | | | | | | | | | | / | | | | | / | 1 | | | | | | | | | | | G | | | | | 3 | . | | | | | | | | | | | P | | | | | V | 8 | | | | | | | | | | | I | | | | | / | K | | | | | | | | | | | O | | | | | 3 | | | | | | | | | | | | _ | | | | | . | | | | | | | | | | | | 2 | | | | | 3 | | | | | | | | | | | | 7 | | | | | V | | | | | | | | | | | | | | | | | ) | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 2 | G | M | I | H | I | H | V | 2 | 5 | GP | I | MMC1 | I | | | | 6 | P | M | NPUT | | N | | M | 0 | 0 | IO_28 | / | _DAT3 | / | | | | | I | C | | | P | | M | K | K | | O | | O | | | | | O | 1 | | | U | | C | / | | | | | | | | | | _ | _ | | | T | | ( | 4 | | | | | | | | | | 2 | D | | | | | 1 | . | | | | | | | | | | 8 | A | | | | | . | 7 | | | | | | | | | | | T | | | | | 8 | K | | | | | | | | | | | 3 | | | | | V | / | | | | | | | | | | | / | | | | | / | 1 | | | | | | | | | | | G | | | | | 3 | . | | | | | | | | | | | P | | | | | V | 8 | | | | | | | | | | | I | | | | | / | K | | | | | | | | | | | O | | | | | 3 | | | | | | | | | | | | _ | | | | | . | | | | | | | | | | | | 2 | | | | | 3 | | | | | | | | | | | | 8 | | | | | V | | | | | | | | | | | | | | | | | ) | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 6 | G | S | OU | L | O | L | V | 2 | 5 | GP | I | SIM | O | | | | 9 | P | I | TPUT | | U | | S | 0 | 0 | IO_29 | / | 1_CLK | | | | | | I | M | | | T | | I | K | K | | O | | | | | | | O | 1 | | | P | | M | / | | | | | | | | | | _ | _ | | | U | | 1 | 4 | | | | | | | | | | 2 | C | | | T | | ( | . | | | | | | | | | | 9 | L | | | | | 1 | 7 | | | | | | | | | | | K | | | | | . | K | | | | | | | | | | | / | | | | | 8 | / | | | | | | | | | | | G | | | | | V | 1 | | | | | | | | | | | P | | | | | / | . | | | | | | | | | | | I | | | | | 3 | 8 | | | | | | | | | | | O | | | | | V | K | | | | | | | | | | | _ | | | | | / | | | | | | | | | | | | 2 | | | | | 3 | | | | | | | | | | | | 9 | | | | | . | | | | | | | | | | | | | | | | | 3 | | | | | | | | | | | | | | | | | V | | | | | | | | | | | | | | | | | ) | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 7 | G | S | I | L | I | L | V | 2 | 5 | GP | I | SIM1 | I | | | | 0 | P | I | NPUT | | N | | S | 0 | 0 | IO_30 | / | _DATA | / | | | | | I | M | | | P | | I | K | K | | O | | O | | | | | O | 1 | | | U | | M | / | | | | | | | | | | _ | _ | | | T | | 1 | 4 | | | | | | | | | | 3 | D | | | | | ( | . | | | | | | | | | | 0 | A | | | | | 1 | 7 | | | | | | | | | | | T | | | | | . | K | | | | | | | | | | | A | | | | | 8 | / | | | | | | | | | | | / | | | | | V | 1 | | | | | | | | | | | G | | | | | / | . | | | | | | | | | | | P | | | | | 3 | 8 | | | | | | | | | | | I | | | | | V | K | | | | | | | | | | | O | | | | | / | | | | | | | | | | | | _ | | | | | 3 | | | | | | | | | | | | 3 | | | | | . | | | | | | | | | | | | 0 | | | | | 3 | | | | | | | | | | | | | | | | | V | | | | | | | | | | | | | | | | | ) | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ | 7 | G | S | OU | L | O | L | V | 2 | 5 | GP | I | SIM | O | | | | 1 | P | I | TPUT | | U | | S | 0 | 0 | IO_31 | / | 1_RST | | | | | | I | M | | | T | | I | K | K | | O | | | | | | | O | 1 | | | P | | M | / | | | | | | | | | | _ | _ | | | U | | 1 | 4 | | | | | | | | | | 3 | R | | | T | | ( | . | | | | | | | | | | 1 | S | | | | | 1 | 7 | | | | | | | | | | | T | | | | | . | K | | | | | | | | | | | / | | | | | 8 | / | | | | | | | | | | | G | | | | | V | 1 | | | | | | | | | | | P | | | | | / | . | | | | | | | | | | | I | | | | | 3 | 8 | | | | | | | | | | | O | | | | | V | K | | | | | | | | | | | _ | | | | | / | | | | | | | | | | | | 3 | | | | | 3 | | | | | | | | | | | | 1 | | | | | . | | | | | | | | | | | | | | | | | 3 | | | | | | | | | | | | | | | | | V | | | | | | | | | | | | | | | | | ) | | | | | | | | | +---+---+---+------+---+---+---+---+---+---+-------+---+-------+---+-------+----+ 相关AT指令 ---------- AT指令不支持gpio接口操作 LUAT开发相关接口 ---------------- 相关示例,请参考:raw-latex:`\script`\_LuaTask_VX.X.X:raw-latex:`\demo`:raw-latex:`\gpio` pio --- 管脚操作 pio.pin.setdir() ~~~~~~~~~~~~~~~~ 设置管脚的描述 - 语法 ``pio.pin.setdir( direction,pin1,pin2,...,pinn)`` - 参数 ========== =============================================== 参数 释义 ========== =============================================== direction 管脚描述,可选pio.INPUT , pio.OUTPUT, pio.INT pin1 第一个管脚 pin2(可选) 第二个管脚 pinn(可选) 第n个管脚 ========== =============================================== - 返回值 无 pio.pin.setval() ~~~~~~~~~~~~~~~~ 设置管脚的值 - 语法 ``pio.pin.setval(value,pin1,pin2,...,pinn)`` - 参数 ========== ================ 参数 释义 ========== ================ value 管脚值,可选0或1 pin1 第一个管脚 pin2(可选) 第二个管脚 pinn(可选) 第n个管脚 ========== ================ - 返回值 无 pio.pin.getval() ~~~~~~~~~~~~~~~~ 读取管脚的值 - 语法 ``val1, val2, ..., valn = pio.pin.getval( pin1, pin2, ..., pinn )`` - 参数 ========== ========== 参数 释义 ========== ========== pin1 第一个管脚 pin2(可选) 第二个管脚 pinn(可选) 第n个管脚 ========== ========== - 返回值 number类型,0表示低电平,1表示高电平 pio.pin.sethigh() ~~~~~~~~~~~~~~~~~ 设置管脚为高电平(1) - 语法 ``pio.pin.sethigh(pin1,pin2,...,pinn)`` - 参数 ========== ========== 参数 释义 ========== ========== pin1 第一个管脚 pin2(可选) 第二个管脚 pinn(可选) 第n个管脚 ========== ========== - 返回值 无 pio.pin.setlow() ~~~~~~~~~~~~~~~~ 设置管脚为低电平(0) - 语法 ``pio.pin.setlow(pin1,pin2,...,pinn)`` - 参数 ========== ========== 参数 释义 ========== ========== pin1 第一个管脚 pin2(可选) 第二个管脚 pinn(可选) 第n个管脚 ========== ========== - 返回值 无 pio.pin.setpull() ~~~~~~~~~~~~~~~~~ 配置IO口默认状态 - 语法 ``pio.pin.setpull(method,pin)`` - 参数 ====== ================================================================= 参数 释义 ====== ================================================================= method pio.PULLUP:上拉模式 。pio.PULLDOWN:下拉模式。pio.NOPULL:高阻态 pin 配置管脚 ====== ================================================================= - 返回值 无 - 例子 .. code:: c pio.pin.setpull(pio.PULLUP,pio.P0_5) --配置为上拉 --pio.pin.setpull(pio.PULLDOWN,pio.P0_5) --配置为下拉 --pio.pin.setpull(pio.NOPULL,pio.P0_5) --不配置上下拉 .. rubric:: pio.pin.setdebounce() :name: pio.pin.setdebounce 配置IO口消抖时间 - 语法 ``pio.pin.setdebounce(ms)`` - 参数 ==== =============================================== 参数 释义 ==== =============================================== ms 延时消抖时间,0为关闭消抖功能,开机后默认为20ms ==== =============================================== - 返回值 无 - 例子 :: pio.pin.setdebounce(20) --延时消抖设置为20ms pio.pin.setdebounce(5) --延时消抖设置为5ms pio.pin.setdebounce(0) --关闭延时消抖功能 相关资料以及购买链接 -------------------- 相关开发板购买链接 `Air724UG开发板 `__ `Air724 开发板使用说明 `__ `相关软件资料下载 `__ 常见问题 -------- https://luatdoc.papapoi.com/638/ 1. 3V引脚和3.3V引脚之间通讯要串联多大电阻? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1K的电阻