Private
Public Access
2
0
Commit Graph

1477 Commits

Author SHA1 Message Date
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
Brendan Le Foll
6d004ca80d mraa.c: mraa_deinit make plat pointer NULL after freeing it
This fixes #698 where an application will crash after calling mraa_deinit and
later closing calling deinit again because of the gcc destructor argument
introduced with cac8f7a

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-06 20:40:18 +02:00
Brendan Le Foll
f911e0620e mraa: Update to v1.6.0
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-02 20:17:53 +02:00
Brendan Le Foll
bf548a3377 Android.mk: Remove defunct Android.mk file
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-02 20:06:49 +02:00
Noel Eck
cac8f7a47a common.h: Added destructor attribute for deinit
Currently, mraa_init is called when loading libmraa.  This commit
adds similar functionality to call mraa_deinit when unloading
libmraa.  This is a nice-to-have since it makes identifying other
memory leaks easier.

Signed-off-by: Noel Eck <noel.eck@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-02 20:03:19 +02:00
Noel Eck
65f7d2a250 mraa.c: Fix for various small memory leaks
In the process of using the mraa mock platform to identify memory leaks
in UPM libraries.  This commit fixes some non-critical places where
memory was getting lost in mraa.

Signed-off-by: Noel Eck <noel.eck@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-02 20:03:19 +02:00
Noel Eck
b937c521f6 Doxyfile.in: Use relative paths in generated docs
Updated Doxyfile to strip the full path to the base MRAA directory
from generated documentation.  This removes the build path from
MRAA documentation.

Old html:

aio_8h.html:<title>mraa: /iotdk/jenkins/workspace/upm-doc-stable/api/mraa/aio.h File Reference</title>

New html:

aio_8h.html:<title>mraa: api/mraa/aio.h File Reference</title>

Signed-off-by: Noel Eck <noel.eck@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-02 20:02:43 +02:00
Mihai Tudor Panu
48fe5cebbb de10-nano: minor readme update and added to types.hpp
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-02 20:00:56 +02:00
Stefan Andritoiu
d2bbfe376d java: bypass version check for packages that don't have version specified
Signed-off-by: Stefan Andritoiu <stefan.andritoiu@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-02 20:00:18 +02:00
Nicola Lunghi
a3f5db1d84 up.c: Removed dead code in up.c
Signed-off-by: Nicola Lunghi <nicola.lunghi@emutex.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-02 19:59:53 +02:00
Lunghi@Emutex
2a1590fdf1 platform_checks.py: Disable check on non edison platforms
Signed-off-by: Nicola Lunghi <nicola.lunghi@emutex.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-02 19:55:21 +02:00
Arun Ravindran
5e34a5cd3b intel_joule: Update doc with correct PIN behavior
GPIO and I2C functions of some PINs are not possible
with default BIOS configuration. Current documentation
wrongly shows that the PINs can work as both GPIO and I2C.

This patch fixes this issue and also updated pin conf for
I2C 1 and 2 to disable GPIO functionality.

Signed-off-by: Arun Ravindran <arun.ravindran@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-20 16:44:18 +00:00
Andrew Koroluk
6f4b333a31 docs(readme): add note about not supporting Node.js 7
Signed-off-by: Andrew Koroluk <koroluka@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-20 08:37:57 +00:00
Arun Ravindran
dd19634889 joule: Fixing descripencies in gpio numbers
The earlier patches did not fix the following issues.

1) gpio number used for ISH I2C 0 and I2C 1 were not correct
2) gpio number used in ISH I2C 1 and I2C 2 were not correct
3) ISH UART 0 gpio numbers were wrong

This patch fixes this issue and also update the doc.

Signed-off-by: Arun Ravindran <arun.ravindran@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-20 08:37:24 +00:00
Alex Tereschenko
21e0ff7c02 pwm.c: properly close duty file when disabling PWM
Fixes #669.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-16 11:15:35 +01:00
Simo Kuusela
b24e90db0c mraa.c: Fix strsep crash
Variable 'dup' doesn't get freed correctly as the pointer to it changes
after 'strsep' function is used. Also 'token' variable doesn't need to
be freed as freeing the original 'dup' already frees the same memory.

Signed-off-by: Simo Kuusela <simo.kuusela@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-16 11:11:06 +01:00
Arun Ravindran
1c4b1fc329 joule: Fix issue with ISH UART name
MRAA is using gpio 484, 483, 485 and 486 as ISH UART1.
But J13 expansion connector doesn't expose ISH UART1,
instead it exposes ISH UART0 as per dev kit hardware guide.

This patch fixes this descrpency and renames the UART and
also enables the GPIO usage.

Signed-off-by: Arun Ravindran <arun.ravindran@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-13 22:11:40 +01:00
Jon Trulson
f6f124a35f uart_ow: prevent possible infinite loop in _ow_read_byte()
With a broken device, or a broken interface circuit, it is possible
for _ow_read_byte() to spin forever.  This patch arranges for it to
timeout after 5 seconds if it cannot read a valid byte from the UART.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-13 21:55:40 +01:00
Arun Ravindran
c7a4a6db34 intel_joule_expansion.c: Fix issue with gpio-339 mapping
The mapping for gpio-339 went away with commit

gpio-339 is available as LED102 or ISH_IO2

Signed-off-by: Arun Ravindran <arun.ravindran@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-13 21:54:27 +01:00
root
0004dfeefb de10-nano: added initial support for Terasic DE10-Nano-SoC kit
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-09 17:27:17 +01:00
Arun Ravindran
0470aebee6 joule: Fix issues with gpio mapping
The GPIOs are not mapped correctly in MRAA for tuchuk board.

This patch corrects the GPIO maps and the PIN assignments.

Note:
1) There are nothing called I2S(x)SDO and I2S(x)SDI available over breakout
   pins, the usage is commented now.
2) There is nothing called SPP0FS3, is now commented, what we have is SPP1FS3.
3) I2C1SDA available twise 15 and 71. PIN 71 as per gpio used should be renamed as ISHI2C0SDA
4) I2C1SCL available twise 17 and 73. PIN 73 as per gpio used should be renamed as ISHI2C0SCL
5) UART1TX available twise 22 and 74. PIN 74 as per gpio used is ISHUART1TXD
   and is not available in breakout.
6) UART1RX available twise 24 and 76. PIN 76 as per gpio used is ISHUART1RXD
   and is not available in breakout.
7) I2C2SDA available twise 19 and 75. PIN 75 as per gpio used is ISHI2C1SDA
   and is not available in breakout pins
8) I2C2SCL available twise 21 and 77. PIN 75 as per gpio used is ISHI2C1SCL
   and is not available in breakout pins
9) PIN 78 UART1RT as per GPIO used is ISHUART1RT and is not available in breakout pins
10) PIN 80 UART1CT as per GPIO is ISHUART1CT and is not available in breakout pins

BIOS used is 193

Signed-off-by: Arun Ravindran <arun.ravindran@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-09 17:25:07 +01:00
Cédric Bosdonnat
23fd11c4f7 README.md: Add install instructions for openSUSE
Signed-off-by: Cédric Bosdonnat <cbosdonnat@suse.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-02 18:17:05 +01:00
Cédric Bosdonnat
875289ab94 rpi: take care of gpiochip base
The gpio pins numbers aren't just matching the physical pin numbers...
on some distros like raspbian, with a kernel explicitly setting the
base to 0, it works, but for kernels using the first free slot it
doesn't (see gpiochip_find_base() in kernel's gpiolib.c).

To get the proper gpio pin value, we thus need to find the base for
the corresponding gpiochip. For the raspberry pi, we search for the
chip with a label containing 'bcm2835'.

Signed-off-by: Cédric Bosdonnat <cbosdonnat@suse.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-02 08:32:10 -08:00
Cédric Bosdonnat
c69b6312fa raspberrypi: add 3 model B support
Signed-off-by: Cédric Bosdonnat <cbosdonnat@suse.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-02 08:32:10 -08:00
Cédric Bosdonnat
b20fe9163a rpi: use /proc/device-tree/compatible
While some distributions have a modified /proc/cpuinfo including
the board revision for raspberry pi, most distributions don't
have this.

In order to guess the raspberry pi version in such cases, use
the /proc/device-tree/compatible content as a fallback solution.
The values expected from this file have been taken from
upstream kernel documentation:

Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt

Signed-off-by: Cédric Bosdonnat <cbosdonnat@suse.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-02 08:32:10 -08:00
Cédric Bosdonnat
b453f6633b arm: prefer /proc/device-tree
As per Documentation/ABI/testing/sysfs-firmware-ofw, perfer
/proc/device-tree over /sys/firmware/devicetree/base as this
is the stable one.

Signed-off-by: Cédric Bosdonnat <cbosdonnat@suse.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-02 08:32:10 -08:00
Cédric Bosdonnat
06359e39cd examples: add return in spi_max7219.c
Some compilers are raising an error if no value is returned in main.
Add a return 0 in spi_max7219.c main to quiet them.

Signed-off-by: Cédric Bosdonnat <cbosdonnat@suse.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-02 08:32:10 -08:00
Cédric Bosdonnat
68c6a8df49 rpi: fix PLATFORM_RASPBERRY_PI_ZERO value
Change PLATFORM_RASPBERRY_PI_ZERO into an integer to avoid
build error when comparing it to integer platform_detected.

Signed-off-by: Cédric Bosdonnat <cbosdonnat@suse.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-02 08:32:10 -08:00
Brendan Le Foll
03fb882ce2 types.h: Remove deprecated attribute as there are too many problems
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-03-02 08:08:40 -08:00
Brendan Le Foll
ff2eba732e types.h: Add C99 guards around duplicat & deprecated enm value
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-02-27 18:17:30 +01:00
Brendan Le Foll
694e6eab23 joule.md: Fix i2c bus number in documentation
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-02-27 18:07:51 +01:00
Brendan Le Foll
4264aa5a3b blink_onboard.c: Blink LED101 on Joule
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-02-27 18:07:51 +01:00
Wai Lun
0092e13f57 Joule: Update references to the Intel Joule
GT/GrosseTete -> Joule. This commit deprecates the MRAA_INTEL_GT_TUCHUCK
mraa_platform_t value and links the grossetete.md page to joule.md.

Signed-off-by: Wai Lun Poon <wai.lun.poon@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-02-27 18:06:40 +01:00
Fan Jiang
2c529689ed 96boards.c: Fixed wrong i2c port numbers and array length in bubblegum 96 board
Signed-off-by: Fan Jiang <i@fanjiang.me>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-02-22 08:55:50 +00:00
Brendan Le Foll
fc03ea4816 docs/building.md: add note about forcing a static build of mraa
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-02-21 17:27:04 +00:00
Nicola Lunghi
caabca37be iio.hpp: Added an empty destructor to get rid of a warning
Signed-off-by: Nicola Lunghi <nicola.lunghi@emutex.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-02-21 12:13:17 +00:00
Nicola Lunghi Emutex
2ea68105f0 uart.c: Simple compiler error fixes
Signed-off-by: Nicola Lunghi Emutex <nicola.lunghi@emutex.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-02-06 21:34:13 +00:00
Nicola Lunghi
6fabccf131 x86: Normalized function names in up & byt platform
Signed-off-by: Nicola Lunghi Emutex <nicola.lunghi@emutex.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-02-06 21:32:54 +00:00
Norbert Wesp
19d69b71da phyboard.c: set each length of snprintf() to defined MAX_SIZE
Signed-off-by: Norbert Wesp <nwesp@phytec.de>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-01-31 21:26:21 +00:00
Machiel Bruinink
e606d1d615 i2c.c: added close of file handle on mraa_i2c_stop
Signed-off-by: Machiel Bruinink <m.bruinink@robotcaresystems.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-01-31 21:25:57 +00:00
Norbert Wesp
4472ff1629 phyboard-wega: Added platform support for phyBOARD-Wega
Like the beaglebone, the phyBOARD-Wega also got an am335x.
So I merged the four mmap-functions for gpio_context and some
identical defines in a separate header and c-file.
The new platform support-files are based on beaglebone-files.

The documentation of phyBOARD-Wega is still in process,
but for now there are enough informations.
At this time it is possible to use GPIO-Pins and Uart0
(tested via python with mraa). The code for using SPI, I2C and
PWM is also still in process and not tested yet.

Signed-off-by: Norbert Wesp <nwesp@phytec.de>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-01-26 22:11:46 +01:00
Mihai Tudor Panu
72261d61bd joule: enable ISH_GPIOs and GPIO_22 exposed on J12 header
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-01-24 19:43:19 +01:00
Jon Trulson
e38630097e UartOW.cpp example: Use .data() string accessor instead of .c_str().
.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>
2017-01-19 08:04:45 +00:00
Jon Trulson
c3332f5542 uart_ow.hpp: Correct a logic bug, and 2 questionable uses of c_str()
The command() function had a logic error that caused a command to be
broadcast to all devices on the DS OW bus when a proper ID was
specified.  This should only be done when NO ID is specified.

This fixes UPM issue #502.

In addition, there were two cases where the C++ string accessor method
.c_str() was used when .data() should be used instead.  This worked
anyway (accidentally), but is improper since the strings can have
embedded 0 bytes.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-01-19 08:04:45 +00:00
Abhishek Malik
3bd590c18c Firmata: I2C read bytes data array size mismatch fix
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-12-29 18:51:35 +00:00
Abhishek Malik
17b147ba82 Firmata: Reducing wait time
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-12-29 18:49:24 +00:00
Abhishek Malik
4b22a923cf Firmata: Increasing iterations to allow more precise readings and allow more time for response
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-12-29 18:49:24 +00:00
Alex Tereschenko
af051d820a intel_edison_fab_c.c: further fix for PWM disable problem
This adds logic to save PWM duty when disabling the pin (which sets
the duty to 0), and restore it when re-enabling the pin.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-12-29 18:48:53 +00:00
belugon
2558866d4a intel_edison_fab_c.c: Fix edison disabled pwm stuck at high
Edison pwm can stuck at high if pin is disabled during ON pwm peroid.
Workaround is to force zero duty time before disabling the pin.

Signed-off-by: Billy Bai <belugon@outlook.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-12-29 18:48:41 +00:00