> From: "Stephen Graf" <[email protected]> > Date: Sat, 19 Aug 2017 18:29:59 -0700 > > I continue to bang away at my orangepi one. > > Now my problem is how to set up the gpio. First off, the boot shows multiple > gpio devices: > > ampintc0 at simplebus0 nirq 160, ncpu 4 > sxirtc0 at simplebus0 > gpio0 at sxipio0: 32 pins > gpio1 at sxipio0: 32 pins > gpio2 at sxipio0: 32 pins > gpio3 at sxipio0: 32 pins > gpio4 at sxipio0: 32 pins > gpio5 at sxipio0: 32 pins > gpio6 at sxipio0: 32 pins > gpio7 at sxipio1: 32 pins > agtimer0 at mainbus0: tick rate 24000 KHz > > One would be sufficient!
You'll need to have some understanding of ow the hardware works to use the gpio pins. The pins are subdivided in groups of up to 32 pins. These groups correspond to letters in the hardware documentation. So for example, hardware pin PA0 corresponds to pin 0 on gpio0 and hardware pin PF6 corresponds to pin 6 on gpio5. Not all pins in each group actually exist. Many pins are multiplexed. Only pins that are configured as gpio_in or gpio_out are available through the gpio(4) interface. Pins used by device drivers (for example the pin used to detect whether an SD card is inserted) are not made available either. > Next I have not been able to determine how to set up the pin definitions. > The documentation that I read says it has to be done at run level 0, but how > that happens is still a mystery to me. Put something like: /usr/sbin/gpioctl gpio7 24 set out green_led in /etc/rc.securelevel. On my Banana Pi this makes pin PH24 available and configures it as an output to control the green LED that is on the board. Be very careful what you put in there. Configuring the wrong pin might damage your hardware.
