Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for standard GPIO - not just raspberry pi #17

Open
sammcj opened this issue Mar 15, 2023 · 0 comments
Open

Support for standard GPIO - not just raspberry pi #17

sammcj opened this issue Mar 15, 2023 · 0 comments

Comments

@sammcj
Copy link

sammcj commented Mar 15, 2023

Hey, it would be awesome if this could support standard GPIO rather than being locked down to the Raspberry Pi only (which are really expensive now).

For example a commonly used alternative/upgrade is the RockPi series SBCs.

The RockPi 4 and newer use the exact same GPIO pin outs and are supported by mraa - https://wiki.radxa.com/Rockpi4/hardware/gpio.

I see you're currently using the gpiozero library which is somewhat hardcoded to only work with raspberry pis likewise with the fallback pigpiod.

There is a rpi.gpio drop-in replacement for SBCs other than the Raspberry Pi - https://github.com/rm-hull/OPi.GPIO

You can query the GPIO using libmraa and related tooling:

mraa-gpio list
01         3V3:
02          5V:
03        SDA7: GPIO I2C
04          5V:
05        SCL7: GPIO I2C
06         GND:
07    SPI2_CLK: GPIO SPI
08        TXD2: GPIO UART
09         GND:
10        RXD2: GPIO UART
11        PWM0: GPIO PWM
12    GPIO4_A3: GPIO
13        PWM1: GPIO PWM
14         GND:
15    GPIO4_C5: GPIO
16    GPIO4_D2: GPIO
17         3V3:
18    GPIO4_D4: GPIO
19 SPI1TX,TXD4: GPIO SPI  UART
20         GND:
21 SPI1RX,RXD4: GPIO SPI  UART
22    GPIO4_D5: GPIO
23     SPI1CLK: GPIO SPI
24      SPI1CS: GPIO SPI
25         GND:
26     ADC_IN0: AIO
27        SDA2: GPIO I2C
28        SCL2: GPIO I2C
29 SCL6,SPI2RX: GPIO I2C  SPI
30         GND:
31 SDA6,SPI2TX: GPIO I2C  SPI
32    GPIO3_C0: GPIO
33      SPI2CS: GPIO SPI
34         GND:
35    GPIO4_A5: GPIO
36    GPIO4_A4: GPIO
37    GPIO4_D6: GPIO
38    GPIO4_A6: GPIO
39         GND:
40    GPIO4_A7: GPIO
crw------- 1 root root 254, 0 Mar  9 07:25 /dev/gpiochip0
crw------- 1 root root 254, 1 Mar  9 07:25 /dev/gpiochip1
crw------- 1 root root 254, 2 Mar  9 07:25 /dev/gpiochip2
crw------- 1 root root 254, 3 Mar  9 07:25 /dev/gpiochip3
crw------- 1 root root 254, 4 Mar  9 07:25 /dev/gpiochip4

crw-rw---- 1 root i2c 89, 0 Mar  9 07:25 /dev/i2c-0
crw-rw---- 1 root i2c 89, 1 Mar  9 07:25 /dev/i2c-1
crw-rw---- 1 root i2c 89, 3 Mar  9 07:25 /dev/i2c-3
crw-rw---- 1 root i2c 89, 4 Mar  9 07:25 /dev/i2c-4
gpioinfo
gpiochip0 - 32 lines:
	line   0:      unnamed       unused   input  active-high
	line   1:      unnamed       unused   input  active-high
	line   2:      unnamed       unused   input  active-high
	line   3:      unnamed       unused   input  active-high
	line   4:      unnamed "host-wakeup" input active-high [used]
	line   5:      unnamed       unused   input  active-high
	line   6:      unnamed       unused   input  active-high
	line   7:      unnamed         "cd"   input   active-low [used]
	line   8:      unnamed       unused   input  active-high
	line   9:      unnamed   "shutdown"  output  active-high [used]
	line  10:      unnamed      "reset"  output   active-low [used]
	line  11:      unnamed       unused   input  active-high
	line  12:      unnamed       unused   input  active-high
	line  13:      unnamed       unused   input  active-high
	line  14:      unnamed       unused   input  active-high
	line  15:      unnamed       unused   input  active-high
	line  16:      unnamed       unused   input  active-high
	line  17:      unnamed       unused   input  active-high
	line  18:      unnamed       unused   input  active-high
	line  19:      unnamed       unused   input  active-high
	line  20:      unnamed       unused   input  active-high
	line  21:      unnamed       unused   input  active-high
	line  22:      unnamed       unused   input  active-high
	line  23:      unnamed       unused   input  active-high
	line  24:      unnamed       unused   input  active-high
	line  25:      unnamed       unused   input  active-high
	line  26:      unnamed       unused   input  active-high
	line  27:      unnamed       unused   input  active-high
	line  28:      unnamed       unused   input  active-high
	line  29:      unnamed       unused   input  active-high
	line  30:      unnamed       unused   input  active-high
	line  31:      unnamed       unused   input  active-high
gpiochip1 - 32 lines:
	line   0:      unnamed       unused   input  active-high
	line   1:      unnamed       unused   input  active-high
	line   2:      unnamed       unused   input  active-high
	line   3:      unnamed "vcc5v0-typec-regulator" output active-high [used]
	line   4:      unnamed       unused   input  active-high
	line   5:      unnamed       unused   input  active-high
	line   6:      unnamed       unused   input  active-high
	line   7:      unnamed       unused   input  active-high
	line   8:      unnamed       unused   input  active-high
	line   9:      unnamed       unused   input  active-high
	line  10:      unnamed       unused   input  active-high
	line  11:      unnamed       unused   input  active-high
	line  12:      unnamed       unused   input  active-high
	line  13:      unnamed       unused   input  active-high
	line  14:      unnamed       unused   input  active-high
	line  15:      unnamed       unused   input  active-high
	line  16:      unnamed       unused   input  active-high
	line  17:      unnamed       unused   input  active-high
	line  18:      unnamed       unused   input  active-high
	line  19:      unnamed       unused   input  active-high
	line  20:      unnamed       unused   input  active-high
	line  21:      unnamed       unused   input  active-high
	line  22:      unnamed       unused   input  active-high
	line  23:      unnamed       unused   input  active-high
	line  24:      unnamed       unused   input  active-high
	line  25:      unnamed       unused   input  active-high
	line  26:      unnamed       unused   input  active-high
	line  27:      unnamed       unused   input  active-high
	line  28:      unnamed       unused   input  active-high
	line  29:      unnamed       unused   input  active-high
	line  30:      unnamed       unused   input  active-high
	line  31:      unnamed       unused   input  active-high
gpiochip2 - 32 lines:
	line   0:      unnamed       unused   input  active-high
	line   1:      unnamed       unused   input  active-high
	line   2:      unnamed       unused   input  active-high
	line   3:      unnamed       unused   input  active-high
	line   4:      unnamed       unused   input  active-high
	line   5:      unnamed       unused   input  active-high
	line   6:      unnamed       unused   input  active-high
	line   7:      unnamed       unused   input  active-high
	line   8:      unnamed       unused   input  active-high
	line   9:      unnamed       unused   input  active-high
	line  10:      unnamed       unused   input  active-high
	line  11:      unnamed       unused   input  active-high
	line  12:      unnamed       unused   input  active-high
	line  13:      unnamed       unused   input  active-high
	line  14:      unnamed       unused   input  active-high
	line  15:      unnamed       unused   input  active-high
	line  16:      unnamed       unused   input  active-high
	line  17:      unnamed       unused   input  active-high
	line  18:      unnamed       unused   input  active-high
	line  19:      unnamed       unused   input  active-high
	line  20:      unnamed       unused   input  active-high
	line  21:      unnamed       unused   input  active-high
	line  22:      unnamed       unused   input  active-high
	line  23:      unnamed       unused   input  active-high
	line  24:      unnamed       unused   input  active-high
	line  25:      unnamed       unused   input  active-high
	line  26:      unnamed "vcc3v3-pcie-regulator" output active-high [used]
	line  27:      unnamed "device-wakeup" output active-high [used]
	line  28:      unnamed       unused   input  active-high
	line  29:      unnamed       unused   input  active-high
	line  30:      unnamed       unused   input  active-high
	line  31:      unnamed       unused   input  active-high
gpiochip3 - 32 lines:
	line   0:      unnamed       unused   input  active-high
	line   1:      unnamed       unused   input  active-high
	line   2:      unnamed       unused   input  active-high
	line   3:      unnamed       unused   input  active-high
	line   4:      unnamed       unused   input  active-high
	line   5:      unnamed       unused   input  active-high
	line   6:      unnamed       unused   input  active-high
	line   7:      unnamed       unused   input  active-high
	line   8:      unnamed       unused   input  active-high
	line   9:      unnamed       unused   input  active-high
	line  10:      unnamed       unused   input  active-high
	line  11:      unnamed       unused   input  active-high
	line  12:      unnamed       unused   input  active-high
	line  13:      unnamed       unused   input  active-high
	line  14:      unnamed       unused   input  active-high
	line  15:      unnamed "snps,reset"  output   active-low [used]
	line  16:      unnamed       unused   input  active-high
	line  17:      unnamed       unused   input  active-high
	line  18:      unnamed       unused   input  active-high
	line  19:      unnamed       unused   input  active-high
	line  20:      unnamed       unused   input  active-high
	line  21:      unnamed       unused   input  active-high
	line  22:      unnamed       unused   input  active-high
	line  23:      unnamed       unused   input  active-high
	line  24:      unnamed       unused   input  active-high
	line  25:      unnamed       unused   input  active-high
	line  26:      unnamed       unused   input  active-high
	line  27:      unnamed       unused   input  active-high
	line  28:      unnamed       unused   input  active-high
	line  29:      unnamed     "status"  output  active-high [used]
	line  30:      unnamed       unused   input  active-high
	line  31:      unnamed       unused   input  active-high
gpiochip4 - 32 lines:
	line   0:      unnamed       unused   input  active-high
	line   1:      unnamed       unused   input  active-high
	line   2:      unnamed       unused   input  active-high
	line   3:      unnamed       unused   input  active-high
	line   4:      unnamed       unused   input  active-high
	line   5:      unnamed       unused   input  active-high
	line   6:      unnamed       unused   input  active-high
	line   7:      unnamed       unused   input  active-high
	line   8:      unnamed       unused   input  active-high
	line   9:      unnamed       unused   input  active-high
	line  10:      unnamed       unused   input  active-high
	line  11:      unnamed       unused   input  active-high
	line  12:      unnamed       unused   input  active-high
	line  13:      unnamed       unused   input  active-high
	line  14:      unnamed       unused   input  active-high
	line  15:      unnamed       unused   input  active-high
	line  16:      unnamed       unused   input  active-high
	line  17:      unnamed       unused   input  active-high
	line  18:      unnamed       unused   input  active-high
	line  19:      unnamed       unused   input  active-high
	line  20:      unnamed       unused   input  active-high
	line  21:      unnamed       unused   input  active-high
	line  22:      unnamed       unused   input  active-high
	line  23:      unnamed       unused   input  active-high
	line  24:      unnamed       unused   input  active-high
	line  25:      unnamed "vcc5v0-host-regulator" output active-high [used]
	line  26:      unnamed       unused   input  active-high
	line  27:      unnamed         "ep"  output  active-high [used]
	line  28:      unnamed       unused   input  active-high
	line  29:      unnamed       unused   input  active-high
	line  30:      unnamed       unused   input  active-high
	line  31:      unnamed       unused   input  active-high
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant