contrib/mraa.git
9 years agointel_minnow_max.c: Add support for spi
Brendan Le Foll [Fri, 13 Mar 2015 16:29:33 +0000 (16:29 +0000)]
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>
9 years agoi2c: flip the msg flags for mraa_i2c_read_bytes_data
Brendan Le Foll [Fri, 13 Mar 2015 16:01:59 +0000 (16:01 +0000)]
i2c: flip the msg flags for mraa_i2c_read_bytes_data

Fixes 168.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoi2c.hpp: Remove tab
Gabriel Smith [Tue, 3 Mar 2015 16:31:47 +0000 (16:31 +0000)]
i2c.hpp: Remove tab

Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoi2c: Add functions for bulk read from register
Gabriel Smith [Tue, 3 Mar 2015 16:26:19 +0000 (16:26 +0000)]
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>
9 years agospi: return int instead of uint8_t in mraa_spi_write
Brendan Le Foll [Tue, 3 Mar 2015 16:20:29 +0000 (16:20 +0000)]
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>
9 years agointel_edison_fab_c.c: let the edison spi driver select the correct method for CS
Brendan Le Foll [Tue, 3 Mar 2015 14:27:54 +0000 (14:27 +0000)]
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>
9 years agoREADME.md: add -dev repository information
Brendan Le Foll [Sun, 1 Mar 2015 17:31:17 +0000 (17:31 +0000)]
README.md: add -dev repository information

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agointel_edison_fab_c.c: Fix frequency setting on edison r2 images
Brendan Le Foll [Sun, 1 Mar 2015 17:15:19 +0000 (17:15 +0000)]
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>
9 years agoraspberry_pi.c: Wrong pin number used for Raspberry Pi in default case
Michael Ring [Sat, 21 Feb 2015 11:31:48 +0000 (12:31 +0100)]
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>
9 years agomraa.c: stop C constructor calling mraa_init() in SWIG builds
Brendan Le Foll [Sun, 1 Mar 2015 10:22:13 +0000 (10:22 +0000)]
mraa.c: stop C constructor calling mraa_init() in SWIG builds

Closes #65

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agox86.c: unknown init now returns MRAA_UNKNOWN_PLATFORM
Brendan Le Foll [Sun, 1 Mar 2015 10:12:04 +0000 (10:12 +0000)]
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>
9 years agospi.h: fix docstring style
Brendan Le Foll [Fri, 27 Feb 2015 16:53:16 +0000 (16:53 +0000)]
spi.h: fix docstring style

Function doc should not start on comment start line since every other header
doesn't do it

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agocontributing.md: amend project contribution goals
Brendan Le Foll [Fri, 27 Feb 2015 16:51:26 +0000 (16:51 +0000)]
contributing.md: amend project contribution goals

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoedison.md: add some SPI limitations
Brendan Le Foll [Fri, 27 Feb 2015 16:50:55 +0000 (16:50 +0000)]
edison.md: add some SPI limitations

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agospi: styling & docstring fix
Brendan Le Foll [Fri, 27 Feb 2015 16:17:00 +0000 (16:17 +0000)]
spi: styling & docstring fix

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agospi.c: change spi mode to a uint32_t
Brendan Le Foll [Fri, 27 Feb 2015 16:14:19 +0000 (16:14 +0000)]
spi.c: change spi mode to a uint32_t

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agomraa: update to API version 0.6.1 v0.6.1
Brendan Le Foll [Thu, 26 Feb 2015 09:39:24 +0000 (09:39 +0000)]
mraa: update to API version 0.6.1

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agopython-mraa.i: ValueError when expecting bytearray but dont get it
Brendan Le Foll [Wed, 25 Feb 2015 19:23:25 +0000 (19:23 +0000)]
python-mraa.i: ValueError when expecting bytearray but dont get it

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoi2c_HM5883.py: remove old python example
Brendan Le Foll [Wed, 25 Feb 2015 16:01:11 +0000 (16:01 +0000)]
i2c_HM5883.py: remove old python example

Example was using old string based read API which is deprecated in python and
gives confusing advice, there are enough python i2c examples so removing this
one

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agocommon: add C++ init() call and explain reason to call again
Brendan Le Foll [Wed, 25 Feb 2015 15:43:38 +0000 (15:43 +0000)]
common: add C++ init() call and explain reason to call again

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoexamples: add uart examples for js & py
Brendan Le Foll [Fri, 20 Feb 2015 15:02:46 +0000 (15:02 +0000)]
examples: add uart examples for js & py

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agogpio.c: change check to allow fd 0
Jon Trulson [Fri, 20 Feb 2015 13:36:42 +0000 (13:36 +0000)]
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>
9 years agogpio.c: check fd before attempting to use it
Jon Trulson [Fri, 20 Feb 2015 13:35:26 +0000 (13:35 +0000)]
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>
9 years agouart.c: mraa_uart_get_dev_path return NULL on error
Jon Trulson [Wed, 18 Feb 2015 19:38:44 +0000 (12:38 -0700)]
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>
9 years agoisr.js: add node.js isr example
Brendan Le Foll [Wed, 18 Feb 2015 14:30:22 +0000 (14:30 +0000)]
isr.js: add node.js isr example

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agonodejs: Add isr support to node.js
Brendan Le Foll [Wed, 18 Feb 2015 14:27:50 +0000 (14:27 +0000)]
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>
9 years agoexamples/spi_max7219.c: Example for 16bit wide convenience functions
Michael Ring [Sat, 14 Feb 2015 17:51:56 +0000 (18:51 +0100)]
examples/spi_max7219.c: Example for 16bit wide convenience functions

Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agospi.hpp: Fix indentation of comment
Michael Ring [Tue, 17 Feb 2015 15:34:27 +0000 (15:34 +0000)]
spi.hpp: Fix indentation of comment

Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agospi: Add 16bit wide convenience functions for spi
Michael Ring [Tue, 17 Feb 2015 15:34:01 +0000 (15:34 +0000)]
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>
9 years agospi.c: Initialization of spi is necessary on Beaglebone Black
Michael Ring [Sat, 14 Feb 2015 17:14:55 +0000 (18:14 +0100)]
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>
9 years agodocs/galileorevd.md: add doc for pin13 on gen1
Brendan Le Foll [Tue, 17 Feb 2015 14:40:06 +0000 (14:40 +0000)]
docs/galileorevd.md: add doc for pin13 on gen1

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agomraa: update to API version 0.6.0
Brendan Le Foll [Wed, 11 Feb 2015 10:40:16 +0000 (10:40 +0000)]
mraa: update to API version 0.6.0

Note that v0.6.0 is in the branch with the same name, so this commit is not
0.6.0

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoraspberry_pi.md: Update docs to reflect latest rpi changes
Brendan Le Foll [Sun, 15 Feb 2015 22:57:24 +0000 (22:57 +0000)]
raspberry_pi.md: Update docs to reflect latest rpi changes

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoarm: added support for all models of Raspbery Pi A/B/A+/B+ & 2B
Michael Ring [Sun, 15 Feb 2015 11:55:15 +0000 (12:55 +0100)]
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>
9 years agoinclude/arm/raspberry_pi.h Added pincount defines for all supported devices
Michael Ring [Sun, 15 Feb 2015 11:51:45 +0000 (12:51 +0100)]
include/arm/raspberry_pi.h Added pincount defines for all supported devices

Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoapi/mraa/types.h renamed enum for raspberry to make it more global
Michael Ring [Sun, 15 Feb 2015 11:50:37 +0000 (12:50 +0100)]
api/mraa/types.h renamed enum for raspberry to make it more global

Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agomraa.c added internal helper functions to support globbing and link analysis
Michael Ring [Sun, 15 Feb 2015 11:47:11 +0000 (12:47 +0100)]
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>
9 years agoAdd options for nodejs include directory
yoneken [Tue, 10 Feb 2015 18:41:29 +0000 (03:41 +0900)]
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>
9 years agoexamples/gpio.c Added support for mmap access to gpio
Michael Ring [Sat, 14 Feb 2015 16:26:06 +0000 (17:26 +0100)]
examples/gpio.c Added 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>
9 years agoexamples/gpio.c Added whitespace to better align gpio list output
Michael Ring [Sat, 14 Feb 2015 14:46:56 +0000 (15:46 +0100)]
examples/gpio.c Added whitespace to better align gpio list output

Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoexamples/gpio.c: Fix some formatting & code style
Brendan Le Foll [Tue, 10 Feb 2015 16:16:30 +0000 (16:16 +0000)]
examples/gpio.c: Fix some formatting & code style

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoexamples/gpio.c: fix getchar() not working in ssh term
Brendan Le Foll [Tue, 10 Feb 2015 15:50:59 +0000 (15:50 +0000)]
examples/gpio.c: fix getchar() not working in ssh term

This is obviously not a nice way to do input handling but it avoids having more
code in the samples than is really needed

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agogpio.c: add DEBUG message for owner flag
Brendan Le Foll [Tue, 10 Feb 2015 15:39:45 +0000 (15:39 +0000)]
gpio.c: add DEBUG message for owner flag

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoexamples/gpio.c: Added command to monitor pin level changes using ISR
Henry Bruce [Thu, 5 Feb 2015 23:48:42 +0000 (15:48 -0800)]
examples/gpio.c: Added command to monitor pin level changes using ISR

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agogpio.c: fix spelling in comment
Henry Bruce [Tue, 10 Feb 2015 15:40:00 +0000 (15:40 +0000)]
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>
9 years agogpio.c: mraa_gpio_wait_interrupt() now waits for subsequent interrupts
Henry Bruce [Tue, 10 Feb 2015 15:39:21 +0000 (15:39 +0000)]
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>
9 years agodocs: fix some poor spelling & phrasing in docs
Brendan Le Foll [Mon, 9 Feb 2015 16:40:47 +0000 (16:40 +0000)]
docs: fix some poor spelling & phrasing in docs

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agopwm.hpp: fix pin/chipid order in raw init
Brendan Le Foll [Mon, 9 Feb 2015 16:40:09 +0000 (16:40 +0000)]
pwm.hpp: fix pin/chipid order in raw init

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agosrc/mraa.c: mux mapped
Thomas Ingleby [Thu, 5 Feb 2015 16:20:09 +0000 (16:20 +0000)]
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>
9 years agoRevert "setup_mux_mapped: use HIGH/LOW instead"
Brendan Le Foll [Thu, 5 Feb 2015 15:00:27 +0000 (15:00 +0000)]
Revert "setup_mux_mapped: use HIGH/LOW instead"

This reverts commit 6c73a8adceb2b59e1868dc57737be9b2ea51cec7 as it breaks
galileo gen1 muxing.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoexamples/aio: Added examples for mraa_aio_read_float()/readFloat()
Alex Tereschenko [Wed, 4 Feb 2015 19:09:56 +0000 (20:09 +0100)]
examples/aio: Added examples for mraa_aio_read_float()/readFloat()

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoaio.c: added normalized read returning a float in a 0.0-1.0 range
Alex Tereschenko [Sun, 1 Feb 2015 19:54:13 +0000 (20:54 +0100)]
aio.c: added normalized read returning a float in a 0.0-1.0 range

Closes #32.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agominnow_max.md: work around bad rendering in GitHub
Tanu Kaskinen [Wed, 4 Feb 2015 13:44:51 +0000 (15:44 +0200)]
minnow_max.md: work around bad rendering in GitHub

If a line starts with '#', GitHub will show the line as a heading.
That may be a GitHub bug (I'm not sure what the Markdown spec says
about this), but anyway, let's rewrap the text so that GitHub shows
the text as intended.

Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agomraa.c: Allow running mraa_init() as non root
Brendan Le Foll [Sat, 31 Jan 2015 09:26:24 +0000 (09:26 +0000)]
mraa.c: Allow running mraa_init() as non root

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agogpio.c: add pin number to export fail message
Brendan Le Foll [Wed, 28 Jan 2015 13:00:20 +0000 (13:00 +0000)]
gpio.c: add pin number to export fail message

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agointel_minnow_max.c: define gpio.mux_total
Brendan Le Foll [Tue, 27 Jan 2015 14:11:59 +0000 (14:11 +0000)]
intel_minnow_max.c: define gpio.mux_total

Not defining this causes undefined behaviour leading to the check mux_total
sometimes being true and asking the kernel to export all sorts of garbage gpio

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agox86.c/mraa_x86_platform: added dedicated block for Galileo Gen1 init
Alex Tereschenko [Sun, 25 Jan 2015 18:52:40 +0000 (19:52 +0100)]
x86.c/mraa_x86_platform: added dedicated block for Galileo Gen1 init

Closes #99.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
9 years agomraa: we now log version and user ID into syslog upon init
Alex Tereschenko [Sun, 25 Jan 2015 14:38:48 +0000 (15:38 +0100)]
mraa: we now log version and user ID into syslog upon init

Closes #98.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
9 years agosetup_mux_mapped: use HIGH/LOW instead
Thomas Ingleby [Thu, 22 Jan 2015 17:36:16 +0000 (17:36 +0000)]
setup_mux_mapped: use HIGH/LOW instead

Avoids on some platforms where when setting a mux will set it low when
it wouldn't be safe to.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
9 years agogpio: add behaviour for pin without direction
Thomas Ingleby [Thu, 22 Jan 2015 17:33:46 +0000 (17:33 +0000)]
gpio: add behaviour for pin without direction

If a gpio doesnt have a direction, like some muxes do, try and set value
if HIGH or LOW was passed.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
9 years agocontributing.md: Fix typo
Petrus J.v.Rensburg [Wed, 21 Jan 2015 15:44:10 +0000 (17:44 +0200)]
contributing.md: Fix typo

Signed-off-by: Petrus J.v.Rensburg <petrus.jvrensburg@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoapi: remove internal strut from public API
Thomas Ingleby [Wed, 21 Jan 2015 16:33:00 +0000 (16:33 +0000)]
api: remove internal strut from public API

Moved for internal use only

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
9 years agoexample/gpio.c: Remove extern to plat
Thomas Ingleby [Wed, 21 Jan 2015 16:24:21 +0000 (16:24 +0000)]
example/gpio.c: Remove extern to plat

Use exposed api functions to get board information.
Added version option for version and name

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
9 years agoraspberry_pi_b: add missing platform name
Thomas Ingleby [Wed, 21 Jan 2015 15:43:27 +0000 (15:43 +0000)]
raspberry_pi_b: add missing platform name

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
9 years agoapi/platform_name: Change return when null platform
Thomas Ingleby [Wed, 21 Jan 2015 15:39:29 +0000 (15:39 +0000)]
api/platform_name: Change return when null platform

Easier to error check against

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
9 years agointernal/platform_name: move to const char*
Thomas Ingleby [Wed, 21 Jan 2015 15:35:54 +0000 (15:35 +0000)]
internal/platform_name: move to const char*

Instead of plain char* to avoid need to malloc and do all the needed
error checking needed that goes along with that.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
9 years agomraa/platform: add mraa_get_pin_count()
Thomas Ingleby [Wed, 21 Jan 2015 15:11:03 +0000 (15:11 +0000)]
mraa/platform: add mraa_get_pin_count()

Will return physical pin count.
Closes #75

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
9 years agoblink_onboard.c: explain use of calamari lure in example
Brendan Le Foll [Tue, 20 Jan 2015 23:50:40 +0000 (23:50 +0000)]
blink_onboard.c: explain use of calamari lure in example

Closes #96.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agodocs: add debugging doc
Brendan Le Foll [Tue, 20 Jan 2015 23:25:31 +0000 (23:25 +0000)]
docs: add debugging doc

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agogpio: add function to get raw gpio number.
Thomas Ingleby [Tue, 20 Jan 2015 18:24:57 +0000 (18:24 +0000)]
gpio: add function to get raw gpio number.

Will return the GPIO number used within SYSFS
Closes #63

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
9 years agocov: add some explicit includes that where missing
Brendan Le Foll [Tue, 20 Jan 2015 17:14:51 +0000 (17:14 +0000)]
cov: add some explicit includes that where missing

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoi2c.c: Fix resource leak when I2C_FUNCS ioctl fails
Brendan Le Foll [Tue, 20 Jan 2015 17:12:57 +0000 (17:12 +0000)]
i2c.c: Fix resource leak when I2C_FUNCS ioctl fails

This isn't a true failure condition just assume we have no features and carry
on

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agouart: use const char* instead of plain char*
Thomas Ingleby [Tue, 20 Jan 2015 16:22:04 +0000 (16:22 +0000)]
uart: use const char* instead of plain char*

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
9 years agouart: add function mraa_uart_get_dev_path
Thomas Ingleby [Tue, 20 Jan 2015 15:10:47 +0000 (15:10 +0000)]
uart: add function mraa_uart_get_dev_path

Used for getting the path to the character device under linux for uart
device. i.e. "/dev/ttyS0"

Adds paths to existing platforms.
Closes #84

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
9 years agouart: cleanup and bring inline with standard
Thomas Ingleby [Tue, 20 Jan 2015 14:44:28 +0000 (14:44 +0000)]
uart: cleanup and bring inline with standard

Removed mraa_setup_uart from core mraa.c moved logic within init
function
Add more syslog output for easier debugging.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
9 years agogpio: mraa_gpio_dir allow output to set val
Kurt Eckhardt [Mon, 5 Jan 2015 23:03:17 +0000 (15:03 -0800)]
gpio: mraa_gpio_dir allow output to set val

There is an issue that when you take an IO pin that has an external PU
resistor and switch it from INPUT to OUTPUT the state of the pin will go
down before you can set it back high.

Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agobuilding.md: fix clang/clang++ arg
Brendan Le Foll [Sat, 17 Jan 2015 10:22:36 +0000 (10:22 +0000)]
building.md: fix clang/clang++ arg

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agodocs: add more information to builds & contributing
Brendan Le Foll [Fri, 16 Jan 2015 14:01:43 +0000 (14:01 +0000)]
docs: add more information to builds & contributing

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agomraajs.i: add %include carrays.i to fix generation with SWIG 3.0.4
Brendan Le Foll [Fri, 16 Jan 2015 13:45:04 +0000 (13:45 +0000)]
mraajs.i: add %include carrays.i to fix generation with SWIG 3.0.4

Fixes #97

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agocmake: make licensing of cmake modules really clear
Brendan Le Foll [Wed, 14 Jan 2015 22:29:18 +0000 (22:29 +0000)]
cmake: make licensing of cmake modules really clear

Cmake modules have varying licensing, to make the distinctions clearer all
original licenses have been included and TargetArch.cmake has been explicitly
marked as LGPL 2.1 as it is based off work comming from qtbase

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agointernals.md: add more internals documentation
Brendan Le Foll [Wed, 14 Jan 2015 15:56:29 +0000 (15:56 +0000)]
internals.md: add more internals documentation

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agobuilding.md: add more building information
Brendan Le Foll [Wed, 14 Jan 2015 15:56:07 +0000 (15:56 +0000)]
building.md: add more building information

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agospi: add mraa_spi_init_raw
Brendan Le Foll [Tue, 13 Jan 2015 17:20:54 +0000 (17:20 +0000)]
spi: add mraa_spi_init_raw

This lets you access a spidev device directly without any checking in the style
of mraa_i2c_init_raw

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agospi.hpp: styling/identation fix
Brendan Le Foll [Wed, 14 Jan 2015 11:47:47 +0000 (11:47 +0000)]
spi.hpp: styling/identation fix

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoi2c.hpp: fix doxygen comment for return of read()
Brendan Le Foll [Wed, 14 Jan 2015 11:46:33 +0000 (11:46 +0000)]
i2c.hpp: fix doxygen comment for return of read()

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agopwm.hpp: Pwm constructor optional arg order change
Brendan Le Foll [Wed, 14 Jan 2015 11:43:40 +0000 (11:43 +0000)]
pwm.hpp: Pwm constructor optional arg order change

This means that you can initialise a non raw Pwm pin without having to redefine
chipid as -1 (anything but -1 enables raw mode for Pwm)

Fixes #93.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agospi: Make Spi write() work from SWIG with typemaps
Brendan Le Foll [Wed, 14 Jan 2015 11:41:43 +0000 (11:41 +0000)]
spi: Make Spi write() work from SWIG with typemaps

This change also changes the C++ API write(char) call to writeByte(uint8_t) and
the write() call now takes a uint8_t* instead of a char*. This should not alter
any code significantly and does not affect the C API.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agomraa.c: fix FTBFS on printf by adding format
Philippe Coval [Mon, 12 Jan 2015 17:03:14 +0000 (18:03 +0100)]
mraa.c: fix FTBFS on printf by adding format

gcc-4.8.2 fails to build from source and complains :

  error: format not a string literal and no format arguments

Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
23 years agox86.c: remove duplicate case statement
Brendan Le Foll [Fri, 9 Jan 2015 12:46:09 +0000 (12:46 +0000)]
x86.c: remove duplicate case statement

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
23 years agox86/intel_minnow_max.c: remove definitions duplication
Brendan Le Foll [Fri, 9 Jan 2015 12:05:34 +0000 (12:05 +0000)]
x86/intel_minnow_max.c: remove definitions duplication

Since gpios are +256 in 3.18+ kernels this stops dual definitions and possible
issues later on if errors are found

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
23 years agox86/intel_minnow_max.c: add board gpio count
Brendan Le Foll [Fri, 9 Jan 2015 12:04:37 +0000 (12:04 +0000)]
x86/intel_minnow_max.c: add board gpio count

Whilst this value is not used because it's only required by the aio module it
is interesting to have this information if we want to expose it to the user

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
23 years agox86/intel_minnow_max.c: Adjust gpio pins based on kernel version
John 'Warthog9' Hawley [Fri, 9 Jan 2015 00:22:49 +0000 (16:22 -0800)]
x86/intel_minnow_max.c: Adjust gpio pins based on kernel version

This should adjust the pinouts, at runtime, based on the current
kernel that's in use.  The Linux kernel made a change between
3.17 and 3.18 ( specifically ea584595fc85e65796335033dfca25ed655cd0ed )
that changed the numbering for GPIOs.  This obviously breaks everything
for mraa on the MinnowBoard MAX if you have a 3.18 or newer kernel.

Signed-off-by: John 'Warthog9' Hawley <john.hawley@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoapi/spi: Add Spi_Modes to CPP headers.
Thomas Ingleby [Fri, 9 Jan 2015 17:00:17 +0000 (17:00 +0000)]
api/spi: Add Spi_Modes to CPP headers.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
9 years agox86/galileo_gen2: correct mistake on IO11 for SPI
Thomas Ingleby [Fri, 9 Jan 2015 16:43:34 +0000 (16:43 +0000)]
x86/galileo_gen2: correct mistake on IO11 for SPI

Fixes #89

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
9 years agointel_edison_fab_c.c: move gpio_close_pre to miniboard
Kurt Eckhardt [Tue, 6 Jan 2015 16:42:39 +0000 (08:42 -0800)]
intel_edison_fab_c.c: move gpio_close_pre to miniboard

The gpio_close_pre was put on the wrong board definition. So calling close of
GPIO pin on mini-board caused a fault

Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agoI2c-compass.cpp: fix incorrect usage of write/writeByte
Brendan Le Foll [Tue, 6 Jan 2015 11:37:07 +0000 (11:37 +0000)]
I2c-compass.cpp: fix incorrect usage of write/writeByte

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agobmp85.js: add i2c read/write example
Brendan Le Foll [Tue, 6 Jan 2015 11:11:13 +0000 (11:11 +0000)]
bmp85.js: add i2c read/write example

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agomraajs.i: add i2c read/write function typemaps
Brendan Le Foll [Tue, 6 Jan 2015 11:11:00 +0000 (11:11 +0000)]
mraajs.i: add i2c read/write function typemaps

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agobmp85.py: add simple example of new i2c read func
Brendan Le Foll [Mon, 5 Jan 2015 15:48:38 +0000 (15:48 +0000)]
bmp85.py: add simple example of new i2c read func

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
9 years agopython-mraa.i: Add typemaps to make I2c::{read,write} natural
Brendan Le Foll [Tue, 6 Jan 2015 11:22:32 +0000 (11:22 +0000)]
python-mraa.i: Add typemaps to make I2c::{read,write} natural

Typemaps now make uint8_t *data, int length map to a bytearray

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>