Browse Source

Support Orange Pi R1

pull/11/head
leeboby 5 years ago
parent
commit
975bbdba63
  1. 4
      examples/blink.c
  2. 5
      gpio/Makefile
  3. 34
      gpio/OrangePi.c
  4. 4
      wiringPi/Makefile

4
examples/blink.c

@ -1,8 +1,8 @@
#include <stdio.h>
#include <wiringPi.h>
//#define NUM 17
#define NUM 28
#define NUM 17
//#define NUM 28
int main (void)
{

5
gpio/Makefile

@ -47,6 +47,7 @@ ifeq ($(PLATFORM),)
#PLATFORM = OrangePi_A64
#PLATFORM = OrangePi_H5
#PLATFORM = OrangePi_ZERO
#PLATFORM = OrangePi_R1
#PLATFORM = OrangePi_H3
#PLATFORM = OrangePi_LITE2
PLATFORM = OrangePi_ONEPLUS
@ -86,7 +87,7 @@ EXTRA_CFLAGS = -DCONFIG_ORANGEPI_A64
EXTRA_CFLAGS += -DCONFIG_ORANGEPI
endif
ifeq ($(PLATFORM), OrangePi_ZERO)
ifneq ($(findstring $(PLATFORM), "OrangePi_ZERO" "OrangePi_R1"),)
EXTRA_CFLAGS = -DCONFIG_ORANGEPI_ZERO
EXTRA_CFLAGS += -DCONFIG_ORANGEPI
endif
@ -150,7 +151,7 @@ ifneq ($(findstring $(PLATFORM), "OrangePi_ONE_H3" "OrangePi_LITE_H3" "OrangePi_
SRC += OrangePi.c
endif
ifeq ($(PLATFORM), OrangePi_ZERO)
ifneq ($(findstring $(PLATFORM), "OrangePi_ZERO" "OrangePi_R1"),)
SRC += OrangePi.c
endif

34
gpio/OrangePi.c

@ -518,7 +518,7 @@ char *physNames[64] =
" 3.3V", "SCK.1 ",
" MOSI.1", "GND ",
" MISO.1", "RTS.2 ",
" SCLK.1", "CS.1 ",
" SCLK.1", "CE.1 ",
" GND", "PA10 ",
NULL, NULL,
@ -575,12 +575,12 @@ char *physNames [64] =
" SCL.1", "GND ",
" PWM1", "PD21 ",
" GND", "PD22 ",
" RXD3", "PC09 ",
" TXD3", "GND ",
" CTS3", "PC08 ",
" RXD.3", "PC09 ",
" TXD.3", "GND ",
" CTS.3", "PC08 ",
" 3.3V", "PC07 ",
" MOSI.0", "GND ",
" MISO.0", "RTS3 ",
" MISO.0", "RTS.3 ",
" SCLK.0", "CE.0 ",
" GND", "PH03 ",
@ -636,10 +636,10 @@ char *physNames [64] =
" 3.3V", "5V ",
" SDA.0", "5V ",
" SCL.0", "GND ",
" PWM0", "PL02 ",
" PWM.0", "PL02 ",
" GND", "PL03 ",
" RXD3", "PD18 ",
" TXD3", "GND ",
" RXD.3", "PD18 ",
" TXD.3", "GND ",
" PL10", "PD15 ",
" 3.3V", "PD16 ",
" MOSI.1", "GND ",
@ -693,6 +693,7 @@ int pinToGpioOrangePi [64] =
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 47
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,// ... 63
};
int physToWpi[64] =
{
-1, // 0
@ -876,11 +877,14 @@ void OrangePiReadAll(void)
#elif CONFIG_ORANGEPI_ZEROPLUS2_H3
printf (" +------+-----+----------+------+---+ZEROPLUS 2+---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_ZERO
printf (" +------+-----+----------+------+---+ OPi Zero +---+------+----------+-----+------+\n");
printf (" +------+-----+----------+------+---+ OPi H2 +---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_A64
printf (" +------+-----+----------+------+---+ OPi Win +---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_LITE2 || CONFIG_ORANGEPI_3
printf (" +------+-----+----------+------+---+OrangePiH6+---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_LITE2
printf (" +------+-----+----------+------+---+ OPi H6 +---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_3
printf (" +------+-----+----------+------+---+ OPi 3 +---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_RK3399
#elif CONFIG_ORANGEPI_RK3399
printf (" +------+-----+----------+------+---+OPi RK3399+---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_4
@ -916,11 +920,13 @@ void OrangePiReadAll(void)
#elif CONFIG_ORANGEPI_ZEROPLUS2_H3
printf (" +------+-----+----------+------+---+ZEROPLUS 2+---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_ZERO
printf (" +------+-----+----------+------+---+ OPi Zero +---+------+----------+-----+------+\n");
printf (" +------+-----+----------+------+---+ OPi H2 +---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_A64
printf (" +------+-----+----------+------+---+ OPi Win +---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_LITE2 || CONFIG_ORANGEPI_3
printf (" +------+-----+----------+------+---+OrangePiH6+---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_LITE2
printf (" +------+-----+----------+------+---+ OPi H6 +---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_3
printf (" +------+-----+----------+------+---+ OPi 3 +---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_RK3399
printf (" +------+-----+----------+------+---+OPi RK3399+---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_4

4
wiringPi/Makefile

@ -90,7 +90,7 @@ EXTRA_CFLAGS = -DCONFIG_ORANGEPI_H3
EXTRA_CFLAGS += -DCONFIG_ORANGEPI
endif
ifeq ($(PLATFORM), OrangePi_ZERO)
ifneq ($(findstring $(PLATFORM), "OrangePi_ZERO" "OrangePi_R1"),)
EXTRA_CFLAGS = -DCONFIG_ORANGEPI_ZERO
EXTRA_CFLAGS += -DCONFIG_ORANGEPI
endif
@ -170,7 +170,7 @@ ifneq ($(findstring $(PLATFORM), "OrangePi_ONE_H3" "OrangePi_LITE_H3" "OrangePi_
SRC += OrangePi.c
endif
ifeq ($(PLATFORM), OrangePi_ZERO)
ifneq ($(findstring $(PLATFORM), "OrangePi_ZERO" "OrangePi_R1"),)
SRC += OrangePi.c
endif

Loading…
Cancel
Save