Private
Public Access
2
0
Commit Graph

1584 Commits

Author SHA1 Message Date
Tapani Utriainen
04c5593cef uart.c: add function to return baudrate as an integer from a speed_t
Signed-off-by: Tapani Utriainen <tapani@technexion.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-28 08:11:21 +02:00
Tapani Utriainen
818ae995c2 uart.c: fix return value for invalid baudrates in uint2speed
This patch probably changes no functionality.

Before this patch the return value 0 was used for invalid baudrates in
uint2speed, but this is not a proper speed_t constant.
Instead the constant B0 is returned now, since on x86 and arm linux
architectures B0 is defined as 0.

Signed-off-by: Tapani Utriainen <tapani@technexion.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-28 08:11:21 +02:00
Alex Tereschenko
47c21e0b6c jsonplatform.c: fix automated and manual code analysis findings
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-18 20:42:32 +02:00
Alex Tereschenko
816be65ba0 gpio.c,aio.c,iio.c: misc fixes of static code analysis findings
SonarQube is awesome!

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-18 20:41:51 +02:00
Alex Tereschenko
b73fdff00d examples: be more defensive and replace strcmp() with strncmp()
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-17 19:45:05 +02:00
Alex Tereschenko
398b851144 mraa.c: be more defensive and replace strcmp() with strncmp()
Closes #731.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-17 19:34:53 +02:00
Tapani Utriainen
5ef3f3ea29 mraa.c: add a by-name lookup function also for UARTs
Signed-off-by: Tapani Utriainen <tapani@technexion.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-16 17:14:30 +02:00
Tapani Utriainen
9479843cde mraa.c: make lookup functions more robust with null pointer checks
Signed-off-by: Tapani Utriainen <tapani@technexion.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-16 17:14:30 +02:00
Tapani Utriainen
dc1255ad75 mraa.c: fix style of lookup functions
This patch has no changes in function. It fixes three style issues
to be more readable and in line to the rest of the codebase:
- return types are declared on a separate line
- reversal of Yoda conditionals
- initialize for loop variable inside loop declaration
- Fix styling of pwm lookup doxygen

Signed-off-by: Tapani Utriainen <tapani@technexion.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-16 17:14:30 +02:00
Alex Tereschenko
9545a2e320 stability: replace strcpy with strncpy to avoid potential overflows
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-15 21:04:18 +02:00
Alex Tereschenko
0654183b9a stability: replace sprintf with snprintf to avoid potential overflows
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-15 21:04:18 +02:00
Alex Tereschenko
918e2b18e2 spi.c: fix potential null pointer dereference
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-15 21:02:50 +02:00
Tapani Utriainen
e7b0a3e809 uart: add a null pointer check before dereferencing plat->adv_func
Signed-off-by: Tapani Utriainen <tapani@technexion.com>
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-15 21:00:34 +02:00
Brendan Le Foll
8ddbcde84e mraa: Update to v.1.7.0
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-12 05:16:20 -07:00
Brendan Le Foll
a0332b14b5 Revert "x86.c: add NUC5i7RYB to the list of known NUC5 platforms"
This reverts commit 2f51627d18.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-12 01:23:58 -07:00
Nicola Lunghi
def0a6aed1 up.c: Fixed pin name size on up board
Signed-off-by: Nicola Lunghi <nicola.lunghi@emutex.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-12 01:23:47 -07:00
Robert Wolff
9d65d6e0f0 master/README.md: Add 96Boards option/link to ARM supported boards.
Added 96Boards option to list of ARM supported boards
with relative link.

Signed-off-by: Robert Wolff <robert.wolff@linaro.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-09 08:41:41 +02:00
Mark van der Pol
4b08887c54 minnow_max.md: Added the Minnow Turbot, replaced broken links
MinnowMax is obsoleted, replaced with the Minnow Turbot - updated the web links
to point to the legacy board pages, and the new board where appropriate.  Pin
26 - Added a pin function for the I2S MCLK

There is more work to do to capture and document all the changes.

Signed-off-by: |\/|ark van der Pol <markx.van.der.pol@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-09 08:41:02 +02:00
Jon Trulson
e0a0dac47b uart: add tcsendbreak support
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-08 21:15:33 +02:00
Alex Tereschenko
6d5b2c0642 .travis.yml: remove Node.js 0.10 and 0.12 - no longer supported
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-06 14:44:48 +02:00
Kas Perch
075a7b1225 JS examples: refactor for clarity and consistent style
Signed-off-by: Kassandra Perch <the@nodebotani.st>
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-06 14:38:54 +02:00
Mihai Tudor Panu
43d9f6c400 readme.md: minor formatting and content changes
Clarified the need for explicit call to addSubplatform when libmraa is installed from NPM, fixed heading, added link to Firmata subplatforms.

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-05-05 16:52:44 -07:00
Noel Eck
1379c1fe33 types.hpp: Added Platform type for PIO
MRAA C++ getPlatformType casts the return from mraa_get_platform_type()
to a Platform enum (which did not exist in C++ for AT).  Added enum type
to types.hpp which corresponds to the C enum type.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-05-04 11:10:08 -07:00
Sanrio Alvares
80335b18b6 peripheralman: i2c_read_bytes_data returns length of read bytes
Return length of read bytes rather than 0 on success.
MRAA calls I2C_RDWR ioctl which returns number of bytes read.
PIO is yet to implement that API so currently does I2C_SMBUS
ioctl instead, which returns 0 in case of success.

Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
2017-05-04 02:29:34 -07:00
Robert Wolff
be2bd63223 docs/96Boards.md: Created and populate 96boards.md
First submission for 96Boards markdown in docs folder. Currently
hosts information and resources for three Consumer Edition
96Boards including DragonBoard 410c, HiKey, and Bubblegum-96.
Plans to expand on this doc as more boards are enabled. Will also
highlight any notes as things come up.

Signed-off-by: Robert Wolff <robert.wolff@linaro.org>
2017-05-04 17:10:49 +02:00
Sanrio Alvares
35e17ee25a periphmraa: fix pwm calls to PIO
Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-30 16:39:22 -07:00
Sanrio Alvares
ef2fddc1e1 periphmraa: fix pwm init sequence
Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-28 10:54:58 -07:00
Sanrio Alvares
ce0edf0f62 periphmraa: set pin capabilities
Peripheral Manager provides mutual exclusion between pins
multiple functionalities. This feature in MRAA is redundant for
this platform.

Once the API to retrieve pin functionality from PIO is available
use it to update each pins capabilities.

Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-26 14:43:26 -07:00
Noel Eck
038a7c542a building.md: Small updates to format for AT
Added a bit of formatting to the AT peripheral manager instructions.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-24 16:24:18 -07:00
Noel Eck
aeb293a163 Peripheralman: Update peripheralman API docs
* Update documentation for C methods
    * Update documentation for CXX methods
    * Update build instructions for building on AT Peripheral Manager Client

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-24 16:04:33 -07:00
Noel Eck
87fda62759 peripheralman.c: Allocate pwm context for spi
Updated the mraa_pman_pwm_init_replace method to allocate heap space for the
mraa_pwm_context (returned by this method.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-24 14:42:55 -07:00
Noel Eck
3e19a58710 pio: Remove pio headers from MRAA
The Native PIO API provides both the libraries and headers for use with
the Android Things Peripheralanager client.  This commit removes these
from the MRAA repo in favor of the FindAndroidThings.cmake provided by
the Native PIO API.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-24 14:42:55 -07:00
Noel Eck
380d2cf638 CMakeLists.txt: Find AT-specific jni.h
Updated the java CMakeLists file to set the JAVA_INCLUDE_PATH for
Android Things.  The JAVA SWIG wrapper will require the jni.h from the
Android NDK.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-24 14:42:55 -07:00
Noel Eck
1d200840f4 src/CMakeLists.txt: Use AndroidThings find_package
Use the cmake module provided by AndroidThings for setting libs/hdrs
instead of the hard-coded path to the AndroidThings library.  This
requires adding a path to CMAKE_MODULE_PATH which contains
FindAndroidThings.cmake.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-24 14:42:55 -07:00
Vineela Tummalapalli
34b4d4a97b Periphmraa: Bypass version check if version is 0.0
Signed-off-by: Vineela Tummalapalli <vineela.tummalapalli@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:55 -07:00
Vineela Tummalapalli
913eaf2440 periphmraa: Create IndexLookup functions for GPIO, I2C, SPI, PWM
These lookups provide the MRAA index with the Pin/Bus name as input

Signed-off-by: Vineela Tummalapalli <vineela.tummalapalli@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:55 -07:00
Sanrio Alvares
7bc069a8fd periphmraa: Fix compilation errors in PWM
config PERIPHERALMAN fails to compile with PWM. Fix it.

Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-24 14:42:55 -07:00
Sanrio Alvares
beaba463f7 peripheralman.c: Added PWM
Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:55 -07:00
Stefan Andritoiu
567a92fde5 periphmraa: Added explicit casts for (implicit) casts that were causing errors in periphmraa build, in the wrapper code
Signed-off-by: Stefan Andritoiu <stefan.andritoiu@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:55 -07:00
Stefan Andritoiu
4270e7a743 periphmraa: Corrected typo in documentation
Signed-off-by: Stefan Andritoiu <stefan.andritoiu@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:55 -07:00
Vineela Tummalapalli
a2ee056c7d peripheralman.c: Updating GPIO, SPI, I2C bus structures for all the available buses
Signed-off-by: Vineela Tummalapalli <vineela.tummalapalli@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:55 -07:00
Sanrio Alvares
e607beedda periphmraa: Rename B* -> A*
Fixes compilation issues introduced earlier

Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:55 -07:00
Sanrio Alvares
c4555bc4e5 peripheralman: Update APIs in accordance with Android Things
Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:55 -07:00
Vineela Tummalapalli
1cec6705d1 peripheralman.c: Updating the mraa_i2c_bus_t structure for all the available i2c busses
Signed-off-by: Vineela Tummalapalli <vineela.tummalapalli@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:55 -07:00
Vineela Tummalapalli
9a306fc1f5 peripheralman.c: Fix Gpio pin map value to be valid
Signed-off-by: Vineela Tummalapalli <vineela.tummalapalli@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:55 -07:00
Brendan Le Foll
8a1c58bc7f peripheralman: Remove stray source files from pmraa
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:55 -07:00
Brendan Le Foll
76850eb0f4 peripheralman.c: Added UART
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:55 -07:00
Brendan Le Foll
0ec90a3138 peripheralman.c: Added SPI & I2C
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:55 -07:00
Brendan Le Foll
60ca81a3e1 android-things: Possibly working gpio
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:55 -07:00
Brendan Le Foll
533517a864 mraa.c: Fix elif without statement
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:54 -07:00