doc/spi: correct description of SPI

SPI is not System Package Interface

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
x86/edison: only toggle tristate on physical pins

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
x86/galileo-gen2: correct SPI MOSI mux info

Fixes #67

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
mraa.c: do not check return value of mraa_gpio_dir when used on muxes

Doing so breaks galileo gen2 (gpio2) and others. Failing early is rather
pointless in any case so we may as well attempt the write, muxes do not
neccesarily have directions that work

Fixes #68

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
contributing.md: Add developer certificate of origin stuff

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
gpio.c: styling, avoid bracketless if statements

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
mraa.c: added user check into mraa_init() & increase verbosity

mraa_init() will now:
- print user name and EUID of the process instead of UID,
- print full platform text name in addition to numeric type,
- return, log and print an error if started by non-root user

Fixes #64

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
mraa.c: remove DEBUG define

debug DEFINE crept in from 6bc2b0fb53865c85c786f7f2a0393d88e7784c08

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
mraa.c: Fixed potential segfault on free()-ing NULL in mraa_deinit()

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
mraa.c: fix aio mraa_pin_mode_test

test was adding board gpio_count to pin so that 0 would use the info for pin 14
on some boards when asking for aio capability

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
mraa.c: fix uart mraa_pin_mode_test

switch statement was missing a clause for MRAA_PIN_UART meaning it always
returned False

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
mraa.c: add syslog msg in case we get an unknown pinmode

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
mraa.c: mraa_pin_mode_test should check against b->gpio_count -1

It's already the case for rpi & MMAX but it should be noted that on 1 indexed
boards gpio_count should be +1

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
contributing.md: fix styling issues

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
gpio.c: add advance_func->gpio_close_pre

Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
x86/edison: Speed up mraa_gpio_dir

Reasonable speed up in the mraa_gpio_dir on the Edison Arduino board

Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
x86/galileo-gen2: Speed up mraa_gpio_dir

Made like changes to Edison to cache the output enable.

Note: different than Edison as the pin structure holds enable pin number
instead of external array.

2nd note: noticed PU resistors are also in structure but there is also
external array.

Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
gpio: Add a function to get a pin number from mraa_gpio_context

Signed-off-by: Kenta Yonekura <yoneken@ieee.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
i2c: set_frequency now takes a mraa_i2c_mode_t

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
i2c: remove hz from context

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