Chengdu Ebyte Electronic Technology Co., Ltd.
E104-BT20 User Manual
_________________________________________________________________________________________________
Copyright ©2012–2020, Chengdu Ebyte Electronic Technology Co., Ltd.
13
6.2.14 Setting GPIO multi-port output
Command
Answer
Parameter
AT+ MPIO =<param>
OK
param1: GPIO port sequence mask
combination (one byte-decimal number)
The module provides users with 7 IO port, GPIO1 ~ GPIO7, users can use to expand the input and output ports. The multi-port
output setting sets all pins to output mode.
GPIO serial number mask = (1 << GPIO serial number)
GPIO serial number mask combination = (GPIO serial number mask 1 | GPIO serial number mask 2 | ……)
Such as:
GPIO1 mask = (1 << 1) = 0x02
GPIO5 mask = (1 << 5) = 0x20
GPIO1 and GPIO5 mask combination = (0x010x20) = 0x22
for example:
1. GPIO1 and GPIO5 output high level, and the rest output low level
Command: AT + MPIO = 21
Answer: OK
2. GPIO3 outputs high level and the rest outputs low level
Command: AT + MPIO = 08
Answer: OK
3. GPIO7 outputs high level and the rest outputs low level
Command: AT + MPIO = 80
Answer: OK
4.All pins output low level
Command: AT + MPIO = 00
Answer: OK
6.2.15 Setting single GPIO input
Command
Answer
Parameter
AT+ PII =<param1>,
<param2>
OK
param1: GPIO port number (decimal number)
param2: GPIO port input
0—pull up
1—Drop down
6.2.16 Setting single multiple GPIO input
Command
Answer
Parameter
AT+ MPII =<param>
OK
param: GPIO port sequence mask
combination (hexadecimal number)
The multi-port input setting sets all pins to input mode.