Private
Public Access
2
0
Commit Graph

208 Commits

Author SHA1 Message Date
Brendan Le Foll
1c4be07aac i2c: fix return value doc for _read_bytes_data
Closes #218

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-06-09 08:25:41 +01:00
Brendan Le Foll
91c56917c7 spi.hpp: fix wrong docstrings data -> txBuf
Closes #215

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-06-02 14:28:37 +01:00
Brendan Le Foll
359cad0336 uart: Add c++ uart example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-06-02 08:43:14 +01:00
Brendan Le Foll
e0ce5454bd uart: move string funcs to {read,write}Str
This commit adds raw binary read/write functions using the same typemaps as I2c
functions

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-06-01 10:58:11 +01:00
Brendan Le Foll
40c52784ad spi.hpp: mraa_spi_write_buf_word cannot be used from SWIG bindings
In order for this to work we need to provide a typemap for it

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-06-01 10:56:48 +01:00
Brendan Le Foll
236a8e9586 uart: make mraa_uart_get_dev_path return const char*
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-06-01 10:54:40 +01:00
Brendan Le Foll
347fd449f9 uart: Make C API use const where appropriate
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-06-01 09:36:00 +01:00
Brendan Le Foll
4628f3f2a0 uart.hpp: Use std::string constructor which lets use set a size parameter
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-06-01 09:32:44 +01:00
Brendan Le Foll
ea71308702 uart.hpp: trust c_str() instead of making copies
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-06-01 09:32:14 +01:00
Thomas Ingleby
fa57cee2e7 uart: update C++ API
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-05-28 23:31:12 +01:00
Thomas Ingleby
b982160ec5 uart: update C API
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-05-28 23:31:12 +01:00
Brendan Le Foll
19cad5cf24 uart: bunch of small changes to make C api work
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-05-28 23:31:11 +01:00
Thomas Ingleby
522a4feea1 uart: change hpp, use new names of functions
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-05-28 23:31:11 +01:00
Thomas Ingleby
4d86860e0c uart: remove un-needed includes from uart.h
No need for many included

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-05-28 23:31:11 +01:00
Brendan Le Foll
0a516ef3bf uart: make initial dump of uart module
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-05-28 23:31:11 +01:00
Jon Trulson
88f3052d99 uart: use an unsigned int for baud rate rather than speed_t
uart.c contains a static conversion function that will translate known
baud rates into their speed_t counter parts.  If an unsupported baud
rate is selected, a diagnostic will be emitted via syslog and a
default of B9600 will be chosen.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-05-28 23:31:11 +01:00
Jon Trulson
c30457e434 uart: add capability to check if data can be read from device
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-05-28 23:31:11 +01:00
Jon Trulson
cf14939cca uart: add uart device read and write functionality
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-05-28 23:31:11 +01:00
Jon Trulson
6d269eeabd uart: add uart device open and close functionality
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-05-28 23:31:11 +01:00
Brendan Le Foll
2679a916be gpio.c: mraa_gpio_get_* now return -1 in error cases
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-24 16:07:17 +01:00
Alexander Komarov
4302f0d0c3 java: Added Java SWIG binding creation
%init directive is not supported in java so move %init to js/py interface files

Signed-off-by: Alexander Komarov <alexander.komarov@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-24 12:12:11 +01:00
Michael Ring
56ba08a98f banana: Add bananapi support
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-08 22:19:14 +01:00
Michael Ring
d9d55e42bc beaglebone.h: added Beaglebone Black Platform
src/arm/CMakeLists.txt added beaglebone.c as a dependency src/arm/arm.c added
initialization of beaglebone black platform src/arm/beaglebone.c mraa support
for the Beaglebone Black Rev B+C includes support for mmap access to gpio

Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-04 17:29:24 +01:00
Brendan Le Foll
5fa47dd4ab gpio.hpp: fix typo in docstring for isr
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-03 21:42:31 +01:00
Thomas Ingleby
64f962d15c pwm: add calls for getting PWM max and min period
Resolves #176

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-03-24 16:48:06 +00:00
Thomas Ingleby
52c53760b2 api: introduce define for pin name size
MRAA_PIN_NAME_SIZE currently set at 12.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-03-23 17:25:27 +00:00
Brendan Le Foll
ffcf3d7d07 clang-format: run clang-format on C/C++ code
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-23 15:15:48 +00:00
Brendan Le Foll
824618ccf1 mraajs: update for node.js 0.12 API differences
This requires setting #define SWIG_V8_VERSION 0x032873 in the
mraajsJAVASCRIPT_wrap.cxx file. Note most v8 APIs now require v8::Isolate and
v8::Persistent is no longer a v8::Handle so the gpio.hpp for ISR support is
also modified by this change

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-19 18:26:05 +00:00
Brendan Le Foll
e03eec3ce1 common: fix documentation string on mraa_init
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-19 09:30:25 +00:00
Michael Ring
827e1974bf api/mraa: add mraa_get_pin_name
Add mraa_get_pin_name to get the real world name of the pin.

Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-03-19 00:16:32 +00:00
Gabriel Smith
0dd03950e4 i2c.hpp: Remove tab
Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-03 16:31:47 +00:00
Gabriel Smith
caf1383325 i2c: Add functions for bulk read from register
Functions issue a write command for the register to read from and then a read
command without a stop signal in between

Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-03 16:26:57 +00:00
Brendan Le Foll
f854a2b410 spi: return int instead of uint8_t in mraa_spi_write
This stops the error code getting lost since -1 wraps around to 0xFF when cast
to a uint8_t. This fixes #146

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-03 16:20:30 +00:00
Brendan Le Foll
3b3b940000 spi.h: fix docstring style
Function doc should not start on comment start line since every other header
doesn't do it

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-27 16:54:23 +00:00
Brendan Le Foll
a747c80f63 spi: styling & docstring fix
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-27 16:17:04 +00:00
Brendan Le Foll
efdbf4b0a8 common: add C++ init() call and explain reason to call again
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-25 15:44:06 +00:00
Brendan Le Foll
d6891e8bd7 isr.js: add node.js isr example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-18 16:41:31 +00:00
Brendan Le Foll
008184c305 nodejs: Add isr support to node.js
This commit adds isr support to node.js mraa module, it also forces
SWIGJAVASCRIPT to be set at compile time by cmake (SWIG uses SWIGJAVASCRIPT and
not SWIGNODE in it's preprocessor). This uses libuv uv_queue_work to call v8isr
and is all done at a C++ level unlike the python isr, so this reuses the
mraa_gpio_isr call. This closes #110

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-18 16:41:01 +00:00
Michael Ring
921e27ac22 spi.hpp: Fix indentation of comment
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-17 15:39:54 +00:00
Michael Ring
55ac2e8996 spi: Add 16bit wide convenience functions for spi
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-17 15:39:54 +00:00
Michael Ring
f9ae045697 api/mraa/types.h renamed enum for raspberry to make it more global
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-15 22:39:56 +00:00
Brendan Le Foll
fca0efa254 pwm.hpp: fix pin/chipid order in raw init
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-09 16:40:09 +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
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
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
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
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