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 [2016/06/14 01:06]
over23
projects:gpio [2016/06/14 01:12] (current)
over23
Line 91: Line 91:
   to your compile line(s).   to your compile line(s).
  
 +</​code>​
 +
 +<​code>​
 +[root@picka_malinova wiringPi]# gpio -v
 +gpio version: 2.32
 +Copyright (c) 2012-2015 Gordon Henderson
 +This is free software with ABSOLUTELY NO WARRANTY.
 +For details type: gpio -warranty
 +
 +Raspberry Pi Details:
 +  Type: Model B, Revision: 03, Memory: 512MB, Maker: Sony 
 +  * Device tree is enabled.
 +  * This Raspberry Pi supports user-level GPIO access.
 +    -> See the man-page for more details
 +    -> ie. export WIRINGPI_GPIOMEM=1
 +</​code>​
 +
 +<​code>​
 +[root@picka_malinova wiringPi]# gpio readall
 + ​+-----+-----+---------+------+---+-Model B2-+---+------+---------+-----+-----+
 + | BCM | wPi |   ​Name ​ | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 + ​+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 + ​| ​    ​| ​    ​| ​   3.3v |      |   ​| ​ 1 || 2  |   ​| ​     | 5v      |     ​| ​    |
 + ​| ​  2 |   8 |   SDA.1 | ALT0 | 1 |  3 || 4  |   ​| ​     | 5V      |     ​| ​    |
 + ​| ​  3 |   9 |   SCL.1 | ALT0 | 1 |  5 || 6  |   ​| ​     | 0v      |     ​| ​    |
 + ​| ​  4 |   7 | GPIO. 7 |   IN | 0 |  7 || 8  | 0 | IN   | TxD     | 15  | 14  |
 + ​| ​    ​| ​    ​| ​     0v |      |   ​| ​ 9 || 10 | 1 | IN   | RxD     | 16  | 15  |
 + ​| ​ 17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |
 + ​| ​ 27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   ​| ​     | 0v      |     ​| ​    |
 + ​| ​ 22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
 + ​| ​    ​| ​    ​| ​   3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |
 + ​| ​ 10 |  12 |    MOSI | ALT0 | 0 | 19 || 20 |   ​| ​     | 0v      |     ​| ​    |
 + ​| ​  9 |  13 |    MISO | ALT0 | 0 | 21 || 22 | 1 | IN   | GPIO. 6 | 6   | 25  |
 + ​| ​ 11 |  14 |    SCLK | ALT0 | 0 | 23 || 24 | 1 | OUT  | CE0     | 10  | 8   |
 + ​| ​    ​| ​    ​| ​     0v |      |   | 25 || 26 | 1 | OUT  | CE1     | 11  | 7   |
 + ​+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 + ​| ​ 28 |  17 | GPIO.17 |   IN | 0 | 51 || 52 | 0 | IN   | GPIO.18 | 18  | 29  |
 + ​| ​ 30 |  19 | GPIO.19 |   IN | 0 | 53 || 54 | 0 | IN   | GPIO.20 | 20  | 31  |
 + ​+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 + | BCM | wPi |   ​Name ​ | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 + ​+-----+-----+---------+------+---+-Model B2-+---+------+---------+-----+-----+
 +[root@picka_malinova wiringPi]# ​
 +</​code>​
 +
 +
 +http://​wiringpi.com/​wiringpi-update-to-2-29/​
 +
 +<​code>​
 +vim /​etc/​udev/​rules.d/​20-gpio.rules
 +</​code>​
 +  * add there
 +<​code>​
 +SUBSYSTEM=="​bcm2835-gpiomem",​ KERNEL=="​gpiomem",​ GROUP="​gpio",​ MODE="​0660"​
 +SUBSYSTEM=="​gpio",​ KERNEL=="​gpiochip*",​ ACTION=="​add",​ PROGRAM="/​bin/​sh -c 'chown root:gpio /​sys/​class/​gpio/​export /​sys/​class/​gpio/​unexport ; chmod 220 /​sys/​class/​gpio/​export /​sys/​class/​gpio/​unexport'"​
 +SUBSYSTEM=="​gpio",​ KERNEL=="​gpio*",​ ACTION=="​add",​ PROGRAM="/​bin/​sh -c 'chown root:gpio /​sys%p/​active_low /​sys%p/​direction /sys%p/edge /​sys%p/​value ; chmod 660 /​sys%p/​active_low /​sys%p/​direction /sys%p/edge /​sys%p/​value'"</​code>​
 +</​code>​
 +
 +<​code>​
 +echo "​setenv WIRINGPI_GPIOMEM 1' >> ~/.bashrc
 </​code>​ </​code>​
  • projects/gpio.1465866385.txt.gz
  • Last modified: 2016/06/14 01:06
  • by over23