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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
I2c class now uses more C like constructs for added efficiency when using C++
and no longer returns a binary string when doing read() calls. This change also
removes the use of std::string in the SWIG API for read/write which never
worked very well. This also renames single write/read calls to {write,read}Byte
as whilst overloading works in C++ well it's a little confusing and only works
because {write,read}() calls have 2 arguments which will not be the case in the
SWIG API where those calls take a single argument (bytearray or node::Buffer),
especially in js where functions have no explicit args this does not work well.
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit changes the mraa_i2c_read() API call behaviour, a register should
now always be set when using this call. The smbus helper library is no longer
required since the code is now all contained from i2c.c which avoids multiple
function calls
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Transfer command works with a uint8_t buffer that is written into, this does
not work in SWIG APIs and will cause a copy in either case, so the API call is
not useful. Remove to stop confusion.
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>