Modify the C++ examples to be of same coding standard like C. As a
part of this cleanup, a new LED example is also added.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
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>
Small cleanup of MRAA C++ examples. Switched from heap allocation to
stack allocation when possible. This simplifies the samples since it
removes the need for explicit memory management.
Signed-off-by: Noel Eck <noel.eck@intel.com>
* Use docker images from docker hub instead of building them on Travis
* Fix doxygen warnings for C/C++ Documentation
* Fix examples inclusion in documentation
* Modify Travis build matrix to include stages and additional jobs
* Update doxygen2jsdoc submodule
* Add doxyport submodule
* Generate documentation for each language in Travis
* Add sonar.java.binaries to sonar-scan.sh
Signed-off-by: Nicolas Oliver <dario.n.oliver@intel.com>
.c_str() works accidentally, but is technically incorrect as these
"strings" can have embedded 0 bytes in them.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
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>
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>
- 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>
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>
When using SPI, I prefer to not have to do malloc/free functions for each
transfer, so why not have a transfer function that you can pass in both
buffers. With my ILI9341 TFT display code that gave some perf wins, also more
of a win, you can pass in NULL for recv buffer and the underlying device driver
does not have to copy the data.
Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
* pkg-config now only sees maa.h & maa.hpp
* usage of maa/*.{h,hpp} is still allowed
* examples updated to use maa.{h,hpp}
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
* 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>