LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 01-17-2016, 12:05 AM   #1
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 878

Rep: Reputation: 120Reputation: 120
BananaPro, WiringLMK, i2c and GPIO pins


I had inferred in this thread http://www.linuxquestions.org/questions/slackware-arm-108/%5B-lemaker-bananapi-%5D-usb-ports-seem-to-be-doa-4175561846/ that I did not have access to i2c on the arm7 kernel.

It turns out this is not the case. I had tried to access i2c using a command from the Lemaker from the WiringPi C library.
Code:
# gpio load i2c
modprobe: FATAL: Module i2c-sunxi not found in directory /lib/modules/4.2.6-armv7
gpio: Unable to load i2c-sunxi
However, after building/installing i2c-tools from a slackbuild and powering up a ds2482 i2c/one wire bridge connected to a ds2438 and the SDC/SCL pins on the Pro, the the arm7-4.2.6 i2c-dev module was loaded and the ds2482 was detected.
Code:
# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --
Note that I had no problem using WiringLMK to access GPIO pins using but I haven't done much more than test by flashing LEDs yet.

WiringLMK by default installs in /usr/local but you can edit the makefile in the directory wiringLMK and change PREFIX to /usr and the DESTDIR to /somewhere/build to make a slackpkg.

I'd prefer to use a system numbering scheme for GPIO pins as I have done in bash scripts on Pi's but I haven't figured out the numbering (yet).... time.....?
 
Old 01-17-2016, 01:09 AM   #2
louigi600
Member
 
Registered: Dec 2013
Location: Italy
Distribution: Slackware
Posts: 635
Blog Entries: 20

Rep: Reputation: 81
I remember reading something about the gpio pin numbering on linux-sunxi.org.
There's a formula .... I've no idea how much of that still holds on newer kernels but here's the link anyway ... and here's what you should be looking for
Quote:
E.g for PH18 this would be ( 8 - 1) * 32 + 18 = 224 + 18 = 242 (since 'h' is the 8th letter).
 
Old 01-17-2016, 02:49 AM   #3
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 878

Original Poster
Rep: Reputation: 120Reputation: 120
Thanks fo that, I just replied to your post in the other thread

Cheers
 
Old 01-18-2016, 02:35 AM   #4
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 878

Original Poster
Rep: Reputation: 120Reputation: 120
Quote:
There's a formula .... I've no idea how much of that still holds on newer kernels
That's it. I remember now noting it on the back of a docket that went walkabout, couldn't remember where I saw it. This works with slackwarearm's arm7-4.2.6 kernel..... at least with physical pins 7 and 13, PH2 and PI18 which I have tested. For example: PH2=(8-1)*32=224+2=226
Code:
# echo "226" > /sys/class/gpio/export
# echo "out" > /sys/class/gpio/gpio226/direction
# echo "1" > /sys/class/gpio/gpio226/value
# echo "0" > /sys/class/gpio/gpio226/value and the following will swicth an LED on/off.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Get started using the GPIO pins in RasPi issue 2! LXer Syndicated Linux News 0 09-12-2014 09:33 PM
LXer: Raspberry Pi GPIO pins the Python column LXer Syndicated Linux News 0 06-03-2014 11:16 PM
How to use i2c-gpio driver sajnanazeer Linux - Newbie 1 03-03-2011 06:21 PM
[SOLVED] How to reverse sda/scl pins in s3c2410 i2c drivers? mj1856 Linux - Embedded & Single-board computer 8 11-23-2010 12:15 AM
[SOLVED] Accessing GPIO-pins on a MPC8308E RDB (powerpc) Amys Linux - Embedded & Single-board computer 4 09-10-2010 07:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 06:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration