Brendan Le Foll
ecb53c8501
raspberry_pi.c: Remove max spi freq by adding replace func
...
Closes #255
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2017-05-31 12:01:04 +02:00
Alex Tereschenko
722b83b95c
intel_edison_fab_c.c: fix unused variables
...
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2017-05-29 18:47:45 +02:00
Alex Tereschenko
822160b7de
uart.c: fix potential use of uninitialized variable
...
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2017-05-29 18:47:45 +02:00
Alex Tereschenko
98e755d147
pwm.c: remove surplus variable assignment
...
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2017-05-29 18:47:45 +02:00
Alex Tereschenko
2980e211db
doxy2swig.py: remove/explain 'do-nothing' blocks
...
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2017-05-29 18:47:45 +02:00
Alex Tereschenko
69f7d09103
mraa.c: remove surplus variables, correct memory allocations
...
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2017-05-29 18:47:45 +02:00
Tapani Utriainen
a6f2464bb1
uart: add a function to query current UART settings
...
This patch adds a function to query UART settings in an unintrusive way.
It can be used using a uart index or a devpath and it strives to just
read out the settings without affecting the state of the UART.
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
d6edf76680
mraa: add accessor functions to return counts of spi, pwm, gpio and adcs
...
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
b7e8d96945
mraa: add a function that returns the number of uarts available
...
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
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
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
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
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
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
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
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
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
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
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
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
4c7616fe91
android-things: Prep for peripheralmanager support
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2017-04-24 14:42:54 -07:00
Mihai Tudor Panu
2f51627d18
x86.c: add NUC5i7RYB to the list of known NUC5 platforms
...
While the NUC5i7RYB doesn't provide any built-in IO, this change will at least allow it to be used with a subplatform from IDEs that filter out unknown devices (e.g. Intel XDK).
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com >
2017-04-19 15:31:07 -07:00
Mihai Tudor Panu
791fe0c05a
de-nano-soc: renamed platform to avoid ambiguity
...
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2017-04-06 23:53:44 +02:00
g-vidal
ecc64da418
rpi3: Adding detection of raspberrypi3
...
Signed-off-by: g-vidal <gerard.vidal@ens-lyon.fr >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2017-04-06 20:42:22 +02:00