Private
Public Access
2
0
Commit Graph

482 Commits

Author SHA1 Message Date
Michael Ring
0d15d3a38c banana.c: Fixed Pin assignment for Banana Pi and wrong names for SPI devices
Signed-off-by: Michael Ring <michael.ring@swisscom.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-08 22:19:14 +01:00
Michael Ring
095ff894a7 mraa.c: Remove mraa_init() from mraa_pin_mode_test
If platform is not initalised at this stage then there is no need to attempt
again

Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-08 22:19:14 +01:00
Michael Ring
56ba08a98f banana: Add bananapi support
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-08 22:19:14 +01:00
Michael Ring
bff7b558eb mraa.c: Add _contains helper functions
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-08 22:19:14 +01:00
Michael Ring
d2fcadc8d5 mraa.c: change helper functions to use const char*
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-08 22:19:14 +01:00
Brendan Le Foll
4599f3c12a tests: add cmake ctest infrastructure so make test can run
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-07 23:52:39 +01:00
Michael Ring
d9d55e42bc beaglebone.h: added Beaglebone Black Platform
src/arm/CMakeLists.txt added beaglebone.c as a dependency src/arm/arm.c added
initialization of beaglebone black platform src/arm/beaglebone.c mraa support
for the Beaglebone Black Rev B+C includes support for mmap access to gpio

Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-04 17:29:24 +01:00
Michael Ring
d0c466e81c mraa_adv_func.h: Added pwm initialization replace
current code in pwm does not work for beaglebone src/pwm/pwm.c Implemented
check for pwm_init_replace

Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-04 17:29:24 +01:00
Brendan Le Foll
2138802b59 docs: Improve python docs
This commit adds a bunch of includes from the C/C++ doxygen doc into the
sphinx/python doc to make it more useful. It also splits out the doc of the
classes using autoclass instead of autodoc to make it nicer to navigate.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-03 21:42:31 +01:00
Brendan Le Foll
6aa601cd1d javascript/CMakeLists.txt: stop requiring doc_i files for node.js
These files are required when building docs for python but are never used for
the node.js module

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-02 14:01:06 +01:00
Brendan Le Foll
eb894033c5 mraa.i: add idef for SWIGPYTHON on doc interface files
This fixes compilation of node.js module with doxygen

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-02 13:51:00 +01:00
Thomas Ingleby
be4312e506 pwm: add syslog warning when value greater than 100% used
Resolves #121

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-03-24 16:51:56 +00:00
Thomas Ingleby
64f962d15c pwm: add calls for getting PWM max and min period
Resolves #176

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-03-24 16:48:06 +00:00
Thomas Ingleby
2388fb9a2a swig/python: rename python-mraa.i to mraa.i
Seemed to be a problem when generating python swig module when using
cmake version 3.2.1

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-03-23 17:07:54 +00:00
Brendan Le Foll
ffcf3d7d07 clang-format: run clang-format on C/C++ code
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-23 15:15:48 +00:00
Brendan Le Foll
2174ee1673 package.json.cmake: use 0.10.x is the minimum version to compile
Note that if you compile a 0.12.x version it'll still have 0.10.x as a min req
but will likely not work with a 0.10.x interpreter

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-19 18:26:06 +00:00
Brendan Le Foll
c1ac6f1928 binding.gyp.cmake: get v8 version from node and export to c++ compiler
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-19 18:26:06 +00:00
Brendan Le Foll
35d1dc10c7 mraajs.i: use SWIG_V8_VERSION from C++ preprocessor not swig
SWIG's preprocessor will not handle the SWIG_V8_VERSION these will go in the
wrapper code so that someone compiling with npm will use his version of node

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-19 18:26:06 +00:00
Brendan Le Foll
f0b3035337 package.json.cmake: create node version specific package.json
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-19 18:26:05 +00:00
Brendan Le Foll
406acb61b3 src/CMakeLists.txt: warn if swig is less than 3.0.5
The SWIG js module cannot build on SWIG 2.x, it also now requires macros
defined in SWIG 3.0.4 and above but there are python issues in everything
3.0.2-3.0.4 so we force a requirement on 3.0.5 and above

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-19 18:26:05 +00:00
Brendan Le Foll
128f0a22da nodejs: add infra to detect nodejs version
This introduces FindNodes.cmake which finds the v8 version and the nodejs
interp version and passes the information to SWIG via SWIG_V8_VERSION

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-19 18:26:05 +00:00
Brendan Le Foll
824618ccf1 mraajs: update for node.js 0.12 API differences
This requires setting #define SWIG_V8_VERSION 0x032873 in the
mraajsJAVASCRIPT_wrap.cxx file. Note most v8 APIs now require v8::Isolate and
v8::Persistent is no longer a v8::Handle so the gpio.hpp for ISR support is
also modified by this change

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-19 18:26:05 +00:00
Michael Ring
827e1974bf api/mraa: add mraa_get_pin_name
Add mraa_get_pin_name to get the real world name of the pin.

Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-03-19 00:16:32 +00:00
Kevron Rees
62213fad77 python: build with python 2.7 in the correct python site dir
This commit also introduces BUILDPYTHON3 option, by default mraa will look for
a python 2 installation

Signed-off-by: Kevron Rees <tripzero.kev@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-18 10:30:17 +00:00
Brendan Le Foll
c621fad5f3 intel_minnow_max.c: Add support for spi
This commit also adds a bit of documentation on the low speed spi kernel module
required

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-13 16:29:36 +00:00
Brendan Le Foll
228b7b672d i2c: flip the msg flags for mraa_i2c_read_bytes_data
Fixes 168.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-13 16:02:04 +00:00
Gabriel Smith
caf1383325 i2c: Add functions for bulk read from register
Functions issue a write command for the register to read from and then a read
command without a stop signal in between

Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-03 16:26:57 +00:00
Brendan Le Foll
f854a2b410 spi: return int instead of uint8_t in mraa_spi_write
This stops the error code getting lost since -1 wraps around to 0xFF when cast
to a uint8_t. This fixes #146

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-03 16:20:30 +00:00
Brendan Le Foll
7375146295 intel_edison_fab_c.c: let the edison spi driver select the correct method for CS
Gpio 111 controls the use of hardware CS by the edison kernel's SPI driver.
This is an issue as that CS will go high between every byte transmitted. The
solution is to let gpio 111 alone and let the driver decide what is best. This
fixes #137

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-03 14:29:21 +00:00
Brendan Le Foll
677af126aa intel_edison_fab_c.c: Fix frequency setting on edison r2 images
This reworks the mraa_intel_edison_i2c_freq() function. i2c_dw_sysnode is a
folder not a file so we need to grab the mode file from that folder. We now
also support i2c-1 frequency changing

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-01 17:17:53 +00:00
Michael Ring
2c74ba72a7 raspberry_pi.c: Wrong pin number used for Raspberry Pi in default case
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-01 10:30:00 +00:00
Brendan Le Foll
76ffa35cec mraa.c: stop C constructor calling mraa_init() in SWIG builds
Closes #65

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-01 10:22:14 +00:00
Brendan Le Foll
10f450b3f6 x86.c: unknown init now returns MRAA_UNKNOWN_PLATFORM
This stops the legacy beahviour that was to initialise as a gen1 galileo if we
failed to find a valid dmi name. Closes #142

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-01 10:12:06 +00:00
Brendan Le Foll
a747c80f63 spi: styling & docstring fix
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-27 16:17:04 +00:00
Brendan Le Foll
bd9eeb11ab spi.c: change spi mode to a uint32_t
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-27 16:14:19 +00:00
Brendan Le Foll
a2220e3636 python-mraa.i: ValueError when expecting bytearray but dont get it
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-25 19:23:25 +00:00
Jon Trulson
9d80b12521 gpio.c: change check to allow fd 0
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-20 13:36:47 +00:00
Jon Trulson
ee05b49ea2 gpio.c: check fd before attempting to use it
mraa_gpio_wait_interrupt needs to check fd before using it

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-20 13:35:34 +00:00
Jon Trulson
dd807308ac uart.c: mraa_uart_get_dev_path return NULL on error
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-19 10:48:02 +00:00
Brendan Le Foll
008184c305 nodejs: Add isr support to node.js
This commit adds isr support to node.js mraa module, it also forces
SWIGJAVASCRIPT to be set at compile time by cmake (SWIG uses SWIGJAVASCRIPT and
not SWIGNODE in it's preprocessor). This uses libuv uv_queue_work to call v8isr
and is all done at a C++ level unlike the python isr, so this reuses the
mraa_gpio_isr call. This closes #110

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-18 16:41:01 +00:00
Michael Ring
55ac2e8996 spi: Add 16bit wide convenience functions for spi
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-17 15:39:54 +00:00
Michael Ring
3a5b992524 spi.c: Initialization of spi is necessary on Beaglebone Black
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-17 15:39:54 +00:00
Michael Ring
3597d8a805 arm: added support for all models of Raspbery Pi A/B/A+/B+ & 2B
Includes SPI,I2C,GPIO and mmap access to GPIO. This commit removes the _b
suffix to the rpi board file

Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-15 22:50:55 +00:00
Michael Ring
8e305a1032 mraa.c added internal helper functions to support globbing and link analysis
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-15 22:38:36 +00:00
yoneken
2965665fee Add options for nodejs include directory
Signed-off-by: Kenta Yonekura <yoneken@ieee.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-15 21:15:24 +00:00
Brendan Le Foll
c1b96680c9 gpio.c: add DEBUG message for owner flag
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-10 15:40:02 +00:00
Henry Bruce
7b213b6393 gpio.c: fix spelling in comment
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-10 15:40:09 +00:00
Henry Bruce
75138c90ce gpio.c: mraa_gpio_wait_interrupt() now waits for subsequent interrupts
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-10 15:39:21 +00:00
Thomas Ingleby
459ecc0c1c src/mraa.c: mux mapped
Don't own gpio of muxes, so it isnt unexported.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-02-05 16:20:09 +00:00
Brendan Le Foll
8ccefe95e5 Revert "setup_mux_mapped: use HIGH/LOW instead"
This reverts commit 6c73a8adce as it breaks
galileo gen1 muxing.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-05 15:17:50 +00:00