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>
Gpio 111 controls the use of hardware CS by the edison kernel's SPI driver.
This is an issue as that CS will go high between every byte transmitted. The
solution is to let gpio 111 alone and let the driver decide what is best. This
fixes#137
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This reworks the mraa_intel_edison_i2c_freq() function. i2c_dw_sysnode is a
folder not a file so we need to grab the mode file from that folder. We now
also support i2c-1 frequency changing
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This stops the legacy beahviour that was to initialise as a gen1 galileo if we
failed to find a valid dmi name. Closes#142
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>
Includes SPI,I2C,GPIO and mmap access to GPIO. This commit removes the _b
suffix to the rpi board file
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
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>
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>
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>
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>
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>
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 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>
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>
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>
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>