Imraa allows the automatic flashing and setup of arduino101 subplatforms as
well as the initial setup of GPIO/i2c devices
Signed-off-by: Longwei Su <lsu@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This fixes bugs when USBPLAT or FIRMATA is enabled when a NULL platform is
added or even a platform without ADC
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
INFO is not a valid cmake message mode, this commit cleans up a few messages to
use the correct cmake modes
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Add pin commands. Old mraa_setup_mux_mapped style is used for other boards
(pincmd = PINCMD_UNDEFINED) where pincmds are not defined.Remove useless
pullup_enable code, Galileo Gen2: review all pin mux and add commands Galileo
Gen2: remove doubled functionality: mraa_intel_galileo_gen2_i2c_init_pre and
mraa_intel_galileo_gen2_uart_init_pre. Galileo Gen2: fix "Invalid AIO pin
specified - do you have an ADC?" error. Galileo Gen2: pullup/pulldown
resistors are disabled during UART/GPIO/SPI/I2C/UIO initialization. Use
mraa_gpio_mode to enable resistors.
Signed-off-by: Eugene Bolshakov <pub@relvarsoft.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
We should throw exception but SWIG_Error causes a seg fault.
We should use syslog instead of stderr but syslog.h is not swigable
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
To ensure backwards comptability MRAA_ERROR_PLATFORM_ALREADY_INITIALISED
remains as member of mraa_result_t but now has same code as MRAA_SUCCESS
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
This is a partial replication of firmata branch commit 2f25468
as that patch would not apply to the javacheck2 branch
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
This is a re-design of commit 0041801. mraa_lang_func_t structure has been
added (similar in design to mraa_adv_func_t) that points to JNI functions
implemented in src/java/mraajni.c. Functions are set by libmraajava.so,
see wrapper entry in src/java/mraajava.i. As gpio.c now uses these
functions, language specific #ifdef code has been removed as JNI code
is only called if functions are defined (i.e. not NULL)
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
libmraajava.so was statically linking to mraa object files causing
duplicate mraa platform instances if a UPM Java module was also loaded.
JNI functionality has been moved into src/java/mraajni.c. JVM object is
now set when JVM is loaded; see updates to src/java/mraajava.i.
This was necessary as the JVM object cannot be directly referenced from
mraa as it will not be available when building C/C++ examples.
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
mraa.node was statically linking to mraa object files causing duplicate
mraa platform instances if a upm node.js module was also loaded.
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Refactored of I/O expander support to simplify addition of new devices.
This had added ISR support for PCA9555.
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
GPIO expander ISRs were dropping interrupts as each pin had its own
thread which cleared the INT signal when reading the GPIO register.
Thus pending interrupts for GPIO on threads waiting to be scheduled
were dropped. Now a single thread polls the GPIO register when INT goes
low and sets interrupt flags for each GPIO line. The threads created
by mraa_gpio_isr() now poll the appropriate interrupt flag.
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Synchronization must be done at "context" level so that i2c bus
cannot be unexpectedly changed by a different thread.
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Every 96Boards baseboard uses the same expansion connector, but the
current 96Boards initialization code assigns the SoC specific GPIO
numbers instead of being consistent across all boards. Change the code
to assign 96Boards GPIO-A through GPIO-L to MRAA GPIOs 23-34.
v2: Create info for all the LS connector pins, not just the GPIO pins.
This gives us room to describe other pins in the future.
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Adding cmake option to build for UP platform only:
-DMRAAPLATFORMFORCE=MRAA_UP
Signed-off-by: Dan O'Donovan <dan@emutex.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Add support for UP board (www.up-board.org), scoping
the following functions available via 40-pin header:
* GPIO (via sysfs)
* UART
* I2C
* SPI
* PWM
Validated on UP board v0.2, running ubilinux 3.0
Signed-off-by: Dan O'Donovan <dan@emutex.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>