Add mux_init_reg interface with different mux modes for GPIO, UART, SPI,
I2C, PWM, AIO.
Signed-off-by: Le Jin <le.jin@siemens.com>
Signed-off-by: Ivan Mikhaylov <ivan.mikhaylov@siemens.com>
This attribute is not part of gpio standard attributes
so it's necessary to implement a custom version of this function
Signed-off-by: Nicola Ponte <nicola.ponte@u-blox.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Added standard context validity check, another check for a replace function
and corrected a return statement to fit our standard code style.
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Mock platform allows one to use mraa without having any real HW.
This commit makes necessary foundational changes and implements
GPIO functionality as well as adds respective tests.
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
As described in issue #91, on Edison setting 0% duty doesn't
disable the PWM on a pin completely.
Therefore we add a couple of Edison-specific _pre functions
and an internal PWM state variable, which we use to toggle PWM
enabled/disabled based on what duty is set for the pin.
Closes#91.
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit changes also the _replace function and adds exceptions to the C++
API for errors in AIO read
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
- FT4222 GPIO ISR implementation was specific to C/C++ and ignored
language binding support. This is now fixed via adv_func updates.
- GPIO ISR code has been refactored to reduce i2c traffic when using
I/O expanders
- Added support for built-in FT4222 GPIO interrupts
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
mraa_adv_func_t->gpio_init_internal_replace() now has mraa_gpio_context
parameter so that override function can access both physical and logical
pin numbers.
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This could be generally useful and more specifically is a
prerequisite for issue #178.
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
current code in pwm does not work for beaglebone src/pwm/pwm.c Implemented
check for pwm_init_replace
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Instead of trying to have an implementation that covers most platforms
Leave all mmap up to platform definition. Through function pointers.
gpio_mmap_setup sets up the mmap
Within the internal gpio context struct two more function pointers now
exist mmap_read & mmap_write. They exist there so each context can its
own function for handling a write and read.
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
* Should allow for more platform quirks to be handled by mraa without
* massive conditional areas per platform.
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>