
Orange Pi 2G-IOT User Manual
Copy right by Shenzhen Xunlong Software Co., Ltd
www.orangepi.org
www.xunlong.tv
49
Please note that: On OrangePi 2G-IOT, GPIOA, GPIOB and GPIOD tract as general
GPIO, but GPIOC as non-general GPIO. Because of some hardware design. The host of
GPIOC is modem not CPU. So, If CPU wanna control GPIOC, it must send message to
Modem, and Moden get message and control GPIOC, it's not good news. In other words.
on version 0.1, GPIOC only support "OUTPUT" mode.
The size of GPIOx group is 32, so we can get gpio map:
GPIOA: 0 - 31
GPIOB: 32 - 63
GPIOC: 64 - 95
GPIOD: 96 - 127
Each gpio have a unique ID, and the way of caculate as follow:
GPIO_A_x: ID = 0 + x
GPIO_B_x: ID = 32 + x
GPIO_C_x: ID = 64 + x
GPIO_D_x: ID = 96 + x
1) Set gpio as Input mode
As General GPIO, we only offer the number of GPIOx. then, use library of wiringPi,
User can easily to control GPIO. GPIOC can not support "Input" mode.
#include <wiringPi.h>
/* Defind unique ID */
#define PA1
1
#define PB5
37
#define PD2
98
int main(void)
{