GithubHelp home page GithubHelp logo

96boards / 96boardsgpio Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 20.0 100 KB

A library to make GPIO use across 96Boards uniform

License: GNU Lesser General Public License v2.1

C 6.99% Python 3.88% Shell 84.33% Makefile 1.16% M4 0.83% C++ 2.81%

96boardsgpio's People

Contributors

dmandala avatar pfalcon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

96boardsgpio's Issues

libsoc autogen.sh

libsoc doesn't have a file called: autogen.sh

You need to run: autoreconf -i

So I think you should fix the docs

Make error

I try to build it on the dragonboard 410c, but I get a build error:

error: 'LS_SHARED' undeclared; did you mean 'LS_GPIO_SHARED'?

make fails due to ‘LS_SHARED’ undeclared. [again]

same problem as here
#15

@jguilfoy solution works but its not pushed to repository
current code is still

gpio *g = libsoc_gpio_request(gpio_id, LS_SHARED);
if (!g)
return rc;
if (!strcmp(direction, "in"))
rc = libsoc_gpio_set_direction(g, INPUT);
else
rc = libsoc_gpio_set_direction(g, OUTPUT);

[make ERROR] Makefile:459: recipe for target 'lib96BoardsGPIO_la-gpio.lo' failedMakefile:459: recipe for target 'lib96BoardsGPIO_la-gpio.lo' failed

Trying to configure 96BoardsGPIO and getting error:

linaro@linaro-alip:~/Desktop/dev/96BoardsGPIO$ make
Making all in lib
make[1]: Entering directory '/home/linaro/Desktop/dev/96BoardsGPIO/lib'
/bin/bash ../libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME="96BoardsGPIO" -DPACKAGE_TARNAME="96boardsgpio" -DPACKAGE_VERSION="0.1" -DPACKAGE_STRING="96BoardsGPIO\ 0.1" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -DPACKAGE="96boardsgpio" -DVERSION="0.1" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=".libs/" -I. -I../lib -g -O2 -MT lib96BoardsGPIO_la-gpio.lo -MD -MP -MF .deps/lib96BoardsGPIO_la-gpio.Tpo -c -o lib96BoardsGPIO_la-gpio.lo test -f 'gpio.c' || echo './'gpio.c
libtool: compile: gcc -DPACKAGE_NAME="96BoardsGPIO" -DPACKAGE_TARNAME="96boardsgpio" -DPACKAGE_VERSION="0.1" "-DPACKAGE_STRING="96BoardsGPIO 0.1"" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -DPACKAGE="96boardsgpio" -DVERSION="0.1" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=".libs/" -I. -I../lib -g -O2 -MT lib96BoardsGPIO_la-gpio.lo -MD -MP -MF .deps/lib96BoardsGPIO_la-gpio.Tpo -c gpio.c -fPIC -DPIC -o .libs/lib96BoardsGPIO_la-gpio.o
gpio.c: In function ‘gpio_id’:
gpio.c:63:17: warning: implicit declaration of function ‘strdup’ [-Wimplicit-function-declaration]
char *fixed = strdup(pin_name);
^~~~~~
gpio.c:63:17: warning: incompatible implicit declaration of built-in function ‘strdup’
gpio.c: In function ‘gpio_open’:
gpio.c:98:41: error: ‘LS_SHARED’ undeclared (first use in this function)
gpio *g = libsoc_gpio_request(gpio_id, LS_SHARED);
^~~~~~~~~
gpio.c:98:41: note: each undeclared identifier is reported only once for each function it appears in
gpio.c:101:7: warning: implicit declaration of function ‘strcmp’ [-Wimplicit-function-declaration]
if (!strcmp(direction, "in"))
^~~~~~
Makefile:459: recipe for target 'lib96BoardsGPIO_la-gpio.lo' failed
make[1]: *** [lib96BoardsGPIO_la-gpio.lo] Error 1
make[1]: Leaving directory '/home/linaro/Desktop/dev/96BoardsGPIO/lib'
Makefile:459: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

linaro@linaro-alip:~/Desktop/dev/96BoardsGPIO$ uname -a
Linux linaro-alip 4.9.27-linaro-lt-qcom #1 SMP PREEMPT Wed May 10 19:59:33 UTC 2017 aarch64 GNU/Linux

GPIO names different to spec

Slightly pedantic maybe ...

The spec uses (-) and the python bindings use underscores (_)

So should:
GPIO_A = GPIO.gpio_id('GPIO_A')

be:
GPIO_A = GPIO.gpio_id('GPIO-A')

Makefile is embarassing

I won't like all the issues, but:

  • 'cp' instead of 'install'
  • no DESTDIR support
  • /usr/local hardcoded
  • not located in the top-level

License.

You have an ambiguous mix of GPL (COPYING) and LGPL (LICENSE, and other file headers) in the archive. Which is it?

Python bindings

Hello,

I appear to be having issues using the Python bindings on the Dragonboard 410c. I'm getting the following message when importing the library in to Python:

OSError: lib96BoardsGPIO.so: cannot open shared object file: No such file or directory

The file does exist in /usr/local/lib

Is it possible that you could create a Python Package and put it on PyPi?

Thanks,
Barry

Linking errors

Hello, I don't know if this is really the place to ask this but I have searched elsewhere and didn't find anything, sorry if this is not to be posted here.

I am trying to build the example blink.c, have installed 96boards and its dependencies (via the autoreconf -i option), but it won't compile the script.

I am using this command : g++ blink.c -o Blink -lsoc -l96BoardsGPIO

I am getting these errors :
main.c:(.text+0x8c4): undefined reference togpio_id(char const_)'
main.c:(.text+0x8dc): undefined reference to gpio_open(unsigned int, char const_)' main.c:(.text+0x904): undefined reference to digitalWrite(unsigned int, unsigned int)'
main.c:(.text+0x91c): undefined reference todigitalWrite(unsigned int, unsigned int)' collect2: error: ld returned 1 exit status

Would you have any idea how to correct this error please ? Sorry if this is a newbie question

Cheers, Pierre

GPIO names: dash or underscore?

gpio.c converts dashes to underscores in GPIO names and translates pin numbers and letters to names with underscore. However it appears that libsoc configuration uses the dash convention by default: https://github.com/jackmitch/libsoc/blob/master/contrib/board_files/dragonboard410c.conf

Which one is more right? :)

If one tries to get a GPIO using gpio_by_pin(23) libsoc is eventually asked for GPIO_A which is not in the above configuration.

Couldn't find the packaged libsoc for e.g. the Linaro Debian release for the DragonBoard right now to check, so it could be fixed there.

One idea is to include both dashed and underscored mappings in libsoc configuration as aliases.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.