Private
Public Access
2
0
Commit Graph

1589 Commits

Author SHA1 Message Date
Alex Tereschenko
e7c3c17eb3 examples/aio: Added examples for mraa_aio_read_float()/readFloat()
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-05 10:43:26 +00:00
Alex Tereschenko
cd6701d604 aio.c: added normalized read returning a float in a 0.0-1.0 range
Closes #32.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-04 18:22:20 +00:00
Tanu Kaskinen
dbc64fbe86 minnow_max.md: work around bad rendering in GitHub
If a line starts with '#', GitHub will show the line as a heading.
That may be a GitHub bug (I'm not sure what the Markdown spec says
about this), but anyway, let's rewrap the text so that GitHub shows
the text as intended.

Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-04 14:12:27 +00:00
Brendan Le Foll
baa1a0ae03 mraa.c: Allow running mraa_init() as non root
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-31 09:26:24 +00:00
Brendan Le Foll
019b0a5e7e gpio.c: add pin number to export fail message
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-28 13:00:20 +00:00
Brendan Le Foll
4d81fec6c9 intel_minnow_max.c: define gpio.mux_total
Not defining this causes undefined behaviour leading to the check mux_total
sometimes being true and asking the kernel to export all sorts of garbage gpio

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-27 14:12:06 +00:00
Alex Tereschenko
e68546ad85 x86.c/mraa_x86_platform: added dedicated block for Galileo Gen1 init
Closes #99.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-26 15:16:32 +00:00
Alex Tereschenko
82bb1c573d mraa: we now log version and user ID into syslog upon init
Closes #98.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-26 15:09:47 +00:00
Thomas Ingleby
6c73a8adce setup_mux_mapped: use HIGH/LOW instead
Avoids on some platforms where when setting a mux will set it low when
it wouldn't be safe to.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-22 17:40:16 +00:00
Thomas Ingleby
e76d85eade gpio: add behaviour for pin without direction
If a gpio doesnt have a direction, like some muxes do, try and set value
if HIGH or LOW was passed.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-22 17:40:16 +00:00
Petrus J.v.Rensburg
d88da134af contributing.md: Fix typo
Signed-off-by: Petrus J.v.Rensburg <petrus.jvrensburg@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-22 10:52:20 +00:00
Thomas Ingleby
212be299fd api: remove internal strut from public API
Moved for internal use only

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-21 16:33:00 +00:00
Thomas Ingleby
94dd44a2d3 example/gpio.c: Remove extern to plat
Use exposed api functions to get board information.
Added version option for version and name

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-21 16:24:21 +00:00
Thomas Ingleby
fb54307939 raspberry_pi_b: add missing platform name
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-21 15:43:27 +00:00
Thomas Ingleby
e8bc227a92 api/platform_name: Change return when null platform
Easier to error check against

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-21 15:39:29 +00:00
Thomas Ingleby
53a9a7dce4 internal/platform_name: move to const char*
Instead of plain char* to avoid need to malloc and do all the needed
error checking needed that goes along with that.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-21 15:35:54 +00:00
Thomas Ingleby
067487f9ec mraa/platform: add mraa_get_pin_count()
Will return physical pin count.
Closes #75

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-21 15:17:34 +00:00
Brendan Le Foll
456646ca53 blink_onboard.c: explain use of calamari lure in example
Closes #96.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-20 23:50:43 +00:00
Brendan Le Foll
e23325d9dd docs: add debugging doc
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-20 23:25:39 +00:00
Thomas Ingleby
c3980c217c gpio: add function to get raw gpio number.
Will return the GPIO number used within SYSFS
Closes #63

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-20 18:33:12 +00:00
Brendan Le Foll
4e5991779a cov: add some explicit includes that where missing
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-20 17:15:13 +00:00
Brendan Le Foll
e3dba949b6 i2c.c: Fix resource leak when I2C_FUNCS ioctl fails
This isn't a true failure condition just assume we have no features and carry
on

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-20 17:15:13 +00:00
Thomas Ingleby
25bd897ec5 uart: use const char* instead of plain char*
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-20 17:14:12 +00:00
Thomas Ingleby
9cfbc87924 uart: add function mraa_uart_get_dev_path
Used for getting the path to the character device under linux for uart
device. i.e. "/dev/ttyS0"

Adds paths to existing platforms.
Closes #84

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-20 16:08:49 +00:00
Thomas Ingleby
ed4c68eba1 uart: cleanup and bring inline with standard
Removed mraa_setup_uart from core mraa.c moved logic within init
function
Add more syslog output for easier debugging.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-20 14:44:28 +00:00
Kurt Eckhardt
20d229168b gpio: mraa_gpio_dir allow output to set val
There is an issue that when you take an IO pin that has an external PU
resistor and switch it from INPUT to OUTPUT the state of the pin will go
down before you can set it back high.

Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-20 10:43:16 +00:00
Brendan Le Foll
66eb476620 building.md: fix clang/clang++ arg
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-17 10:22:36 +00:00
Brendan Le Foll
5daad72fe0 docs: add more information to builds & contributing
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-16 14:01:43 +00:00
Brendan Le Foll
50ca84b600 mraajs.i: add %include carrays.i to fix generation with SWIG 3.0.4
Fixes #97

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-16 13:45:04 +00:00
Brendan Le Foll
c3e43e5984 cmake: make licensing of cmake modules really clear
Cmake modules have varying licensing, to make the distinctions clearer all
original licenses have been included and TargetArch.cmake has been explicitly
marked as LGPL 2.1 as it is based off work comming from qtbase

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-14 22:29:18 +00:00
Brendan Le Foll
21962f4d87 internals.md: add more internals documentation
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-14 15:56:29 +00:00
Brendan Le Foll
26106a2fb4 building.md: add more building information
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-14 15:56:07 +00:00
Brendan Le Foll
5af11978ca spi: add mraa_spi_init_raw
This lets you access a spidev device directly without any checking in the style
of mraa_i2c_init_raw

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-14 11:52:36 +00:00
Brendan Le Foll
16fc50bc31 spi.hpp: styling/identation fix
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-14 11:52:15 +00:00
Brendan Le Foll
c28eea88f7 i2c.hpp: fix doxygen comment for return of read()
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-14 11:52:13 +00:00
Brendan Le Foll
f51afc1fbc pwm.hpp: Pwm constructor optional arg order change
This means that you can initialise a non raw Pwm pin without having to redefine
chipid as -1 (anything but -1 enables raw mode for Pwm)

Fixes #93.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-14 11:52:13 +00:00
Brendan Le Foll
b7a0856f51 spi: Make Spi write() work from SWIG with typemaps
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>
2015-01-14 11:52:12 +00:00
Philippe Coval
17ee0c9669 mraa.c: fix FTBFS on printf by adding format
gcc-4.8.2 fails to build from source and complains :

  error: format not a string literal and no format arguments

Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-12 18:12:37 +00:00
Brendan Le Foll
219eeed5f8 x86.c: remove duplicate case statement
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2001-01-01 02:53:16 +00:00
Brendan Le Foll
c45e3c8c58 x86/intel_minnow_max.c: remove definitions duplication
Since gpios are +256 in 3.18+ kernels this stops dual definitions and possible
issues later on if errors are found

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2001-01-01 02:53:16 +00:00
Brendan Le Foll
5dc28d9800 x86/intel_minnow_max.c: add board gpio count
Whilst this value is not used because it's only required by the aio module it
is interesting to have this information if we want to expose it to the user

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2001-01-01 02:53:16 +00:00
John 'Warthog9' Hawley
d8bef92bbe x86/intel_minnow_max.c: Adjust gpio pins based on kernel version
This should adjust the pinouts, at runtime, based on the current
kernel that's in use.  The Linux kernel made a change between
3.17 and 3.18 ( specifically ea584595fc85e65796335033dfca25ed655cd0ed )
that changed the numbering for GPIOs.  This obviously breaks everything
for mraa on the MinnowBoard MAX if you have a 3.18 or newer kernel.

Signed-off-by: John 'Warthog9' Hawley <john.hawley@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2001-01-01 02:53:16 +00:00
Thomas Ingleby
62c3264b2c api/spi: Add Spi_Modes to CPP headers.
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-09 17:14:50 +00:00
Thomas Ingleby
a76061a981 x86/galileo_gen2: correct mistake on IO11 for SPI
Fixes #89

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-09 16:47:01 +00:00
Kurt Eckhardt
3efb7a03e1 intel_edison_fab_c.c: move gpio_close_pre to miniboard
The gpio_close_pre was put on the wrong board definition. So calling close of
GPIO pin on mini-board caused a fault

Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-06 17:49:51 +00:00
Brendan Le Foll
ec5c09fe37 I2c-compass.cpp: fix incorrect usage of write/writeByte
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-06 11:37:07 +00:00
Brendan Le Foll
461015a22f bmp85.js: add i2c read/write example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-06 11:24:56 +00:00
Brendan Le Foll
f14654a120 mraajs.i: add i2c read/write function typemaps
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-06 11:24:56 +00:00
Brendan Le Foll
23fca714e1 bmp85.py: add simple example of new i2c read func
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-06 11:24:55 +00:00
Brendan Le Foll
31b16735e9 python-mraa.i: Add typemaps to make I2c::{read,write} natural
Typemaps now make uint8_t *data, int length map to a bytearray

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-06 11:24:55 +00:00