Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
projects:gpio-bb [2015/01/07 22:32]
darron
projects:gpio-bb [2023/11/05 16:20] (current)
darron [Armbian]
Line 1: Line 1:
 ==== GPIO bit-bang driver for Linux ==== ==== GPIO bit-bang driver for Linux ====
  
-=== Void Linux for Raspberry Pi ===+The GPIO bit-bang driver creates an interface to Linux GPIOs using the IOCTL API.
  
-First install development tools and the kernel headers.+Basic 1-bit input and output is available along with accelerated multiple bit shift I/O. 
 + 
 +GPIO bit-bang is well suited to PICMicro ICSP but not exclusively. 
 + 
 +=== Build === 
 + 
 +This module is built out of kernel and depends on the header files and tools found locally or may be cross compiled. 
 + 
 +For cross compilation, an example Makefile named `cross-compile.mk' is provided which should work for Raspberry PI OS as explained [[:tools:raspbian#kernel|here]]. 
 + 
 +If the linux source directory was cross compiled and then copied to the target system to build the module, `scripts.sh' is provided to rebuild certain kernel header scripts locally. This is needed because some scripts are actually binary files on the foreign architecture. 
 + 
 + 
 + 
 +=== Raspberry Pi OS=== 
 + 
 +First install development tools and the kernel headers when using a regular kernel.
 <code> <code>
-xbps-install mercurial make gcc rpi-kernel-headers +apt-get install raspberrypi-kernel-headers 
 +</code> 
 + 
 +If you updated the kernel with rpi-update, install [[https://github.com/RPi-Distro/rpi-source|rpi-source]] 
 + 
 +Now install headers for kernel installed with rpi-update. 
 +<code> 
 +rpi-source --skip-space
 </code> </code>
  
Line 12: Line 35:
 hg clone http://hg.kewl.org/pub/gpio-bb hg clone http://hg.kewl.org/pub/gpio-bb
 cd gpio-bb cd gpio-bb
-./install.sh+make 
 +make install
 </code> </code>
  
-== /etc/modprobe.d/modprobe.conf == +=== Armbian === 
-Update modprobe configuration to create the gpio-bb device node when the module is loaded.+ 
 +==BPI== 
 + 
 +<code> 
 +apt install linux-headers-current-sunxi 
 +hg clone http://hg.kewl.org/pub/gpio-bb 
 +cd gpio-bb 
 +make 
 +make install 
 +</code> 
 + 
 +=== Configuration === 
 +Update the modprobe configuration to create the gpio-bb device node when the module is loaded. For example, add the following to /etc/modprobe.d/modprobe.conf 
 +<code> 
 +install gpio-bb modprobe --ignore-install gpio-bb && modprobe gpio-bb && mknod /dev/gpio-bb c 180 0 && chmod 666 /dev/gpio-bb 
 +</code> 
 +Lastly, add the following to /etc/modules and reboot.
 <code> <code>
-install gpio-bb modprobe --ignore-install gpio-bb && modprobe gpio-bb && mknod /dev/gpio-bb c 180 0+gpio-bb
 </code> </code>
  
-=== OpenWRT === +=== Obsolete documentation === 
-[[projects:gpio-bb:openwrt|GPIO bit-bang driver for OpenWRT]]+[[projects:gpio-bb:armbian|Armbian]] 
 +[[projects:gpio-bb:bananian|Bananian]] 
 +[[projects:gpio-bb:openwrt|OpenWRT]] 
 +[[projects:gpio-bb:raspbian|Raspbian]]
  
-=== Raspbian ===+=== Troubleshooting ===
  
-[[projects:gpio-bb:raspbian|GPIO bit-bang driver for Raspbian]]+gpio-bb uses the kernel API to access pins, this API demands exclusive access to a pin per process. This means you cannot use gpio-bb and sysfs export simultaneously for a single pin.
  
 +=== Resources ===
  
 +[[https://www.pedalpc.com/blog/program-pic-raspberry-pi/#gpio-bb|Using gpio-bb]]