Private
Public Access
2
0
Commit Graph

38 Commits

Author SHA1 Message Date
Manivannan Sadhasivam
e562c774cf examples: cleanup examples directory
Following changes are done as a part of cleanup:

1. Moved the platform specific `C` examples from top level examples/
directory to platform/ subdirectory and renamed helloedison.c to
gpio_edison.c

2. C specific examples are moved to a new c/ subdirectory. As a part
of this process, examples are modified to follow same standards
and few new examples are also added.

3. Include the newly added C examples to relevant API documentation

4. Ran clang-format for all source files in c/, c++/, platform/
subdirectories

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2018-01-18 14:12:08 +01:00
Manivannan Sadhasivam
ec26f92fe6 tools: add new tools directory
This is the start of the series of commits focussed on
cleaning up the exmaples/ directory.

This commit moves mraa-gpio, mraa-i2c, mraa-uart files
out of examples directory into new tools directory. Moved
files are the good cadidates to be treated as tools
instead of examples.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-11-02 10:00:35 +01:00
Tapani Utriainen
56d5666ae9 mraa-uart: add a tool for testing, using and debugging UARTs using MRAA
This patch introduces examples/mraa-uart that can be used as a general tool
for UART communication and UART settings.

The syntax mimics the one used for mraa-gpio.

This is an initial version, beware of insects.

Signed-off-by: Tapani Utriainen <tapani@technexion.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-28 08:12:18 +02:00
Brendan Le Foll
69fcd861a7 android-things: Peripheralmanager target build
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:54 -07: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
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
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
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
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
Brendan Le Foll
8c19105309 iio_driver.c: Add example for iio interface
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-12-15 10:42:06 +00:00
Kevron Rees
c7a405a531 cmake: use cmake includedir
We need to use CMake variables to avoid installing things in the wrong places on
systems that have multilib enabled.

Signed-off-by: Kevron Rees <kevron.m.rees@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-12-01 15:07:36 +00:00
Henry Bruce
1c9b87bfd3 cmake: add FTDI FT4222 support
Existing FTDI D2xx support is just for serial comms library
but FT4222 needs a different library for i2c operation.

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-09-08 14:42:03 +01:00
Henry Bruce
6dfe6ff6bc examples: Created mraa-i2c tool for i2c layer testing.
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-09-08 14:42:03 +01:00
Brendan Le Foll
e481026227 examples/uart.c: Add a _read call to example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-07-19 12:39:45 +01:00
Henry Bruce
a1c5bd8742 CMakeLists.txt: Added option to install mraa-gpio tool
This commit renames gpio.c to mraa-gpio.c to make installation in bin/ less
annoying

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-31 13:56:29 +01:00
Michael Ring
ffe40033d4 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>
2015-02-17 15:39:54 +00:00
Henry Bruce
27f22d077b gpio.c: Added gpio list/set/get utility
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-11-21 20:06:37 +00:00
Thomas Ingleby
9f2f5be20a uart_setup: add example on current uart use.
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-07-10 09:33:36 +01:00
Thomas Ingleby
6853997a92 mraa: rename from maa to mraa
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-06-24 17:24:54 +01:00
Brendan Le Foll
475a692638 maa: add maa_get_platform_type function and move swig common to type.h
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-06-20 18:00:19 +01:00
Thomas Ingleby
7af6a96a13 mmap: added mmap io to gpio
* added function to gpio to use mmap
* changed board definition format around mmap io (fast-gpio)
* Intel Galileo Rev D updated to follow changed definitions

* Example performing mmap io to pin 2 added.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-05-29 16:30:07 +01:00
Brendan Le Foll
fb7da58139 cmake: install examples in ${prefix}/share/maa/examples
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-22 14:26:11 +01:00
Thomas Ingleby
41f619048d spi: added example for use with mcp4261
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-05-16 14:31:44 +01:00
Brendan Le Foll
554505b640 aio.hpp: Add C++ wrapper around Aio
* maa_aio_context becomes an opaque pointer
* C++ wrapper class Aio created
* examples/c++ with a sample for Aio created
* swig now uses C++ wrapper Aio to generate an API
* python generated code is now C++

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-16 14:31:30 +01:00
Brendan Le Foll
e84406d697 cmake: make maa link against pthreads directly
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-15 16:40:40 +01:00
Brendan Le Foll
126b1314b0 gpio: rework of gpio - using open() for value_fp
* fixes maa_gpio_read by using simple posix file io
* fixes blink sample to have much more error checking
* blink sample now takes an argument

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-13 15:35:27 +01:00
Brendan Le Foll
37b5d9f0cc gpio: initial implementation of interupt handling on gpio
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-07 14:48:21 +01:00
Nandkishor Sonar
207c54a5e7 aio: add initial analog input support
Signed-off-by: Nandkishor Sonar <nandkishor.sonar@intel.com>
Reviewed-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-01 16:38:17 +01:00
Brendan Le Foll
ed0a1f6085 maa: change the linking of maa and make gpio functions match maa_ spec
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-04-27 23:11:31 +01:00
Brendan Le Foll
a5a407e4b5 MAA version 0.2.0 moves to a standard C API
* Removed all C++ code and renamed all .cxx extensions to .c
* All functions are renamed to maa_ and modules are for example called maa_pwm
* Cmake can now 'make doc' using a Doxyfile.in to create documentation
* examples/ have been updated but swig generated API is untested

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-04-27 21:17:54 +01:00
Brendan Le Foll
184b94e9e5 examples: make C++ examples follow src/ extension convention
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-04-22 15:54:34 +01:00
Brendan Le Foll
f011102ce6 basic HMC5883L magnometer sample
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-04-22 15:32:22 +01:00
Thomas Ingleby
fbd863ca39 pwm: Fully Functional.
* C++ example included

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-04-14 16:55:19 +01:00
Brendan Le Foll
9994ea855c maa: Refactor maa build system and partly implement i2c
* API headers moved to api/
* smbus file added from libi2c and kernel i2c header cleaned up
* fix compilation of swig and use i2c.h header

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-04-10 16:53:19 +01:00
Brendan Le Foll
0ec04b6fd3 examples: fix include path 2014-04-10 11:04:02 +01:00
Brendan Le Foll
00ba95bac0 maa: Initial commit of maa, a python and nodejs I2C skeleton only 2014-04-08 18:45:30 +01:00