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>
Added minimum, maximum and default period settings to board definitions
PWM will now have a default period as defined in the board defintion.
When using pwm_write() writing 1.0f or above will default to 100%.
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
Header only C++ function definitions need to be static to avoid linking issues
when including the header multiple times.
Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
When using SPI, I prefer to not have to do malloc/free functions for each
transfer, so why not have a transfer function that you can pass in both
buffers. With my ILI9341 TFT display code that gave some perf wins, also more
of a win, you can pass in NULL for recv buffer and the underlying device driver
does not have to copy the data.
Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
* Exceptions only fired in constructor when it would initialise with a NULL
context causing segfaults if used any further
* Adds exception.i requirement to mraa.i for node.js and python support
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Syslog is now used for all error messages, return values in the code should be
used by programmers to see the status of the library/board and syslog can be
used to see quickly from a debugging perspective what has gone wrong. A few
cosmetics where improved as well as a mraa_set_log_level() call where the
syslog log mask can be set directly from libmraa.
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Functions inside namespace are tough to document, bypassing this by documenting
the namespace and then using the namespace doc as common.hpp doc in the index
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
* Allows user to set both at the same time. Will reset to previous if
* period for duty cycle fails to write
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>