Private
Public Access
2
0
Commit Graph

213 Commits

Author SHA1 Message Date
Brendan Le Foll
6c85b61daa mraa: Fix compiler warnings unused vars and useless statements
Should have 0 functionality effect, just cleans up a few things. Fixes #577

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-09-13 11:20:41 +01:00
Houman Brinjcargorabi
5d763cb7e5 Example: Added example json file for reference
Signed-off-by: Houman Brinjcargorabi <houman.brinjcargorabi@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-07-27 11:33:29 +01:00
Brendan Le Foll
6c9aeb9b9e mraa-i2c: stop switching on every platform type and assume linux
This patch makes mraa-i2c give sensible bus numbers

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-07-12 12:09:37 +01:00
Houman Brinjcargorabi
b5b84c6186 examples: Added examples for initio by description
Signed-off-by: Houman Brinjcargorabi <houman.brinjcargorabi@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-06-27 11:46:24 +01:00
Brendan Le Foll
5f515f7648 mraa-gpio.c: dont display pins set as not MRAA_PINS_VALID
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-06-20 12:18:38 +01:00
Brendan Le Foll
3d2163e2cb mraa-gpio.c: Fix raw gpio setting
setraw was not using mraa_gpio_init_raw so did not work

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-06-20 10:39:20 +01:00
Evgen48
800c89bfa4 examples/java: input pin number should be parsed in base 10, not in base 8, similar to c++ sample
Signed-off-by: Eugene Smirnov <o1o2o3o4o5@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-05-04 09:46:16 +01:00
Brendan Le Foll
c41c3b41d5 uart_ow: Better error handling in corner cases
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-04-15 12:03:32 +01:00
Brendan Le Foll
4a52ad6c4f uart_ow: Make onewire functionality optional but on by default
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-04-14 13:52:09 +01:00
Jon Trulson
a379eb7bf6 uart_ow: Initial support for Dallas 1-wire over UART support for MRAA
This commit introduces support for Dallas Semiconductor (DS) 1-wire
compliant device support using an available UART device.

The principle of operation is described in the following Application
note by Maxim Electronics:

https://www.maximintegrated.com/en/app-notes/index.mvp/id/214

with help (1-wire search) from:
https://www.maximintegrated.com/en/app-notes/index.mvp/id/187

It has been tested on Galileo 2 and Edison, with 2 DS 1-wire devices,
the DS18B20 and DS2413 connected to the bus.  A UPM driver for the
DS2413 is already complete and a PR will be submitted after this one.

It is important that you use a UART with CMOS/TTL level voltages
(3.3v/5v) RX and TX lines.  DO NOT use standard RS232 level voltages
or you are going to have a bad day.

In order for this to work, a simple interface circuit, using a single
diode must be constructed:

(forgive my "Asciihematic" :)

-|
U|
A| TX---|<--+
R|          |
T| RX-------o--------o 1-wire data bus
-|

The diode on TX is a 1N4148 (cheap and common), with the cathode
connected to TX, and the anode connected to RX and the 1-wire data
line.

The 1-wire data line requires a pull-up resistor, as the DS 1-wire
spec requires. 4.7-5K is typical for DS 1-wire buses.

NOTE: DHT-type (temp/humidity sensor) 1-wire devices ARE NOT DS 1-wire
compliant, and will not work with this code/circuit unfortunately.

Also note, this will use up one of your UARTs, which cannot be used
for any other purpose (ie: to access true UART-type serial devices).

You can however, connect as many DS 1-wire devices as feasible to this
UART, as it will function as a DS 1-wire bus master.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-04-14 13:41:31 +01:00
Alex Tereschenko
00a0abd030 isr.js: updated JS ISR example to avoid GPIO context being destroyed
Closes #403.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-04-11 15:28:22 +01:00
Fathi Boudra
e1c500414b docs: fix spelling errors
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-04-11 15:13:06 +01:00
Brendan Le Foll
21bea74b74 mraa-gpio.c: Add return to list_pins
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-03-24 09:46:31 +00:00
Houman Brinjcargorabi
6fc2bef13f hellomraa.c: Remove unused variables
Signed-off-by: Houman Brinjcargorabi <houman.brinjcargorabi@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-03-22 18:12:30 +00:00
deadprogram
c302269750 firmata: Call FirmataCurieIMU firmata plugin API to retrieve raw accelerometer data
Signed-off-by: Ron Evans <ron@hybridgroup.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-03-22 18:12:30 +00:00
deadprogram
de0b9e72c6 firmata: Add very simple mraa firmata examples for JS & Python
Signed-off-by: Ron Evans <ron@hybridgroup.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-03-22 18:12:30 +00:00
Brendan Le Foll
537a69923b examples: disable firmata examples if firmata disabled
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-03-22 18:12:29 +00:00
Brendan Le Foll
59107f0a29 firmata: add public firmata API to support custom firmata plugins
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-03-22 18:12:29 +00:00
Henry Bruce
6c83886a51 examples: gpio-tool.js now catches exception if invalid pin is specified
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
2016-03-22 18:04:57 +00:00
Henry Bruce
143bc38e47 examples: hello_isr.py now catches exception if invalid pin is specified
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
2016-03-22 18:04:57 +00:00
Henry Bruce
a51f3a939f examples: Isr.java now catches exception if invalid pin is specified
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
2016-03-22 18:04:57 +00:00
Henry Bruce
85a848960a examples: Java ISR example now displays pin number and level
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
2016-03-22 18:04:57 +00:00
Henry Bruce
237308898c examples: Added isrExit() call to gpio-tool.js for ISR shutdown testing
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-03-22 18:04:57 +00:00
Henry Bruce
b1fd66c561 examples: Updated python gpio isr example
Example now takes pin number from command line and displays gpio level
when it changes.

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-03-22 18:04:57 +00:00
Henry Bruce
d313ac0579 java: Allows Java GPIO ISR sample to exit so IsrExit() method can be tested
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-03-22 18:04:57 +00:00
Dan O'Donovan
f9501c5c78 up: add support for UP Board
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>
2016-02-24 15:10:20 +00:00
Petre Eftime
0899f1e995 examples: java: Add test for subplatform GPIO pins
Signed-off-by: Petre Eftime <petre.p.eftime@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-02-16 17:34:27 +00:00
Henry Bruce
839bdb9011 mraa-i2c: Added "repeated read" command for stress testing
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
2016-02-12 11:25:38 +00:00
Henry Bruce
43ae362be8 examples: Java GPIO ISR example now takes pin as command line argument
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
2016-02-12 11:25:38 +00:00
Henry Bruce
6bf706befb examples: Added JavaScript gpio tool
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
2016-02-12 11:25:38 +00:00
Henry Bruce
d2fcb88c4b cmake: Added INSTALLTOOLS option that installs both mraa-gpio and mraa-i2c
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
2016-02-12 11:25:38 +00:00
Brendan Le Foll
1f57c6c082 Blink-IO.cpp: fix dual include of stdlib for no reason
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-02-09 16:04:14 +00:00
Alex Tereschenko
c101117ece js examples: removed surplus char() helper function
Closes #226.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-02-08 11:16:10 +00:00
Petre Eftime
c63e38a57e java: Migrate IsrCallbacks to Java's Runnable class
Signed-off-by: Petre Eftime <petre.p.eftime@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-01-21 15:28:03 +00:00
Brendan Le Foll
0aed0003ff mraa.c: make mraa_get_platform_name use a const char
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-01-21 15:28:03 +00:00
Brendan Le Foll
0ebab9603e Blink-IO.js: Call the function after declaring it
This works ok if executing the whole file but the node.js interactive
interpreter gets confused when yoy copy and paste the code

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-01-06 16:37:15 +00:00
Pieterjan Camerlynck
a87a104efe CMakeLists.txt: do not require a C++ compiler
By default, CMake assumes both a C and C++ compiler are required.
This is not needed for mraa because it only provides C++ header
files. Note that if using SWIG you need one and if using node.js 3+ you'll need
a C++11 compiler

Signed-off-by: Pieterjan Camerlynck <pieterjan.camerlynck@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-01-06 10:42:40 +00:00
Henry Bruce
a708e08101 examples/mraa-i2c: Fixed physical bus id error in list command
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-01-06 10:38:51 +00:00
Brendan Le Foll
8862ebd9f2 mraa: Remove trailing whitespace/tabs from various parts
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-12-21 15:27:15 +00:00
Henry Bruce
8e4a809f12 iio: C API changes and C++ API enhancements
- C API read/write integer functions changed to int to match C types
- C API now has close function to release resources acquired during init
- iio internal type isr_event() function now has args param in signature
- C++ API now supports events with handler interface and new data structure
- C and C++ examples updated to use API changes

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-12-15 10:42:14 +00:00
Henry Bruce
3429b5383d examples: Converted iio dummy driver test app to C++
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
2015-12-15 10:42:06 +00:00
Henry Bruce
c1d081c783 examples: Extended iio_dummy_test to cover more cases.
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
2015-12-15 10:42:06 +00:00
Henry Bruce
448f14f41c examples: Added iio_dummy_test, a test app that uses iio_dummy driver
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
2015-12-15 10:42:06 +00:00
Lay, Kuan Loon
edb7f8a215 iio: iio consolidate read and write API
Signed-off-by: Lay, Kuan Loon <kuan.loon.lay@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-12-15 10:42:06 +00:00
Lay, Kuan Loon
078b6371d7 iio-example: printf take extra argument
Signed-off-by: Lay, Kuan Loon <kuan.loon.lay@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-12-15 10:42:06 +00:00
Lay, Kuan Loon
4c41d2c2df iio: added event api
Signed-off-by: Lay, Kuan Loon <kuan.loon.lay@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-12-15 10:42:06 +00:00
Brendan Le Foll
acfb74f04e iio: Improve iio channel parsing to add enabled channels
scale and other attributes have to be read individually as they vary quite alot
depending on the channel. We only care/take data from scan_elements

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-12-15 10:42:06 +00:00
Brendan Le Foll
2c97fd5953 iio: initial pass at getting channel information from scan_elements
This commit creates a new structure inside each _iio device when used and can
then be used to understand the data being read after a trigger is run/executed

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-12-15 10:42:06 +00:00
Brendan Le Foll
b192e7a223 iio_driver.c: remove weird API calls
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-12-15 10:42:06 +00:00
Brendan Le Foll
d8c2c7c483 iio: Find attributes and channels in iio device
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-12-15 10:42:06 +00:00