Private
Public Access
2
0

39 Commits

Author SHA1 Message Date
Ivan Mikhaylov
307a6f3bdd mux: add mux interface
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>
2022-08-05 12:04:23 -07:00
Thomas Ingleby
170bdd104f spdx: add spdx tags to most files
Large change that removes the duplicated MIT notice withe a spdx tag

Signed-off-by: Thomas Ingleby <thomas.ingleby@intel.com>
2019-05-23 10:09:12 -07:00
Nicola Ponte
7d6164c136 gpio: Add support for push-pull/open-drain output mode
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>
2017-07-04 10:12:03 +02:00
Jon Trulson
e0a0dac47b uart: add tcsendbreak support
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-08 21:15:33 +02:00
Sanrio Alvares
35e17ee25a periphmraa: fix pwm calls to PIO
Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-30 16:39:22 -07:00
Sanrio Alvares
ef2fddc1e1 periphmraa: fix pwm init sequence
Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-28 10:54:58 -07:00
Sanrio Alvares
beaba463f7 peripheralman.c: Added PWM
Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:55 -07:00
Alex Tereschenko
8a9efd1bcc uart.c: add replace functions used by mock
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-10-25 12:04:04 +01:00
Alex Tereschenko
9030ae2eeb spi.c: added replace functions for all basic actions
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-08-19 16:00:53 +01:00
Alex Tereschenko
917a1bd371 aio: added context validity and replace function checks to aio_close()
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>
2016-07-11 10:48:43 +01:00
Alex Tereschenko
bcb6adc551 mock: added mraa mock platform infra and GPIO implementation
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>
2016-07-05 16:19:05 +01:00
Alex Tereschenko
8af6843566 PWM: added workaround for Edison's problem with 0% duty
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>
2016-06-16 14:12:33 +01:00
Brendan Le Foll
c1465bd694 i2c: Make i2c advance function match new prototypes
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-04-22 11:59:17 +01:00
Brendan Le Foll
0b74aa68ab aio: Change mraa_aio_read to use int and return -1
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>
2016-04-22 11:57:26 +01:00
Brendan Le Foll
334a57be11 gpio.c: Add close replace function hook
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-03-22 18:12:30 +00:00
Mihai Tudor Panu
603834461f pwm: added hooks for subplatform support
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-03-22 18:12:29 +00:00
Brendan Le Foll
78caa990f1 firmata: initial work
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-03-22 18:12:29 +00:00
Henry Bruce
1fd4ed5736 ftdi_ft4222: Added GPIO interrupt support for language bindings.
- 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>
2016-02-12 11:25:38 +00:00
Henry Bruce
ed0124cc70 mraa_adv_func: Updated signature of gpio_init_internal_replace()
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>
2016-01-06 10:38:51 +00:00
Brendan Le Foll
07343e2ee7 mraa: Remove global advance_func struct and place it in platform configuration
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-09-08 14:42:04 +01:00
Henry Bruce
453eefc56a usb: Added gpio isr support to ft4222
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-09-08 14:42:03 +01:00
Henry Bruce
802c5af986 usb: Added gpio read/write support for ft4222 with i/o expander
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-09-08 14:42:03 +01:00
Henry Bruce
8f48df0533 usb: Skeleton platform code for FTDI FT4222 USB to i2c bridge
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-09-08 14:42:03 +01:00
Brendan Le Foll
f080a74497 gpio: all gpio enums prefixed with _mraa
Enum C types for gpio where not all prefixed with mraa correctly, now fixed

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-07-01 10:59:03 +01:00
Alex Tereschenko
5adc951f57 spi.c: introduced a _replace hook for spi_lsbmode()
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>
2015-06-15 09:55:54 +01:00
Michael Ring
d0c466e81c mraa_adv_func.h: Added pwm initialization replace
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>
2015-04-04 17:29:24 +01:00
Brendan Le Foll
cc9a4f59b5 edison: add mraa_i2c_frequency replace hook for i2c-6
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-05 14:38:50 +00:00
Kurt Eckhardt
21d88d15eb gpio.c: add advance_func->gpio_close_pre
Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-19 14:40:01 +00:00
Thomas Ingleby
3865bebe8d mmap: remove implementation of mmap gpio
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>
2014-11-17 17:41:47 +00:00
Thomas Ingleby
77be6da29c uart: add pre uart hook
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-10-20 18:43:58 +01:00
Thomas Ingleby
071951e926 uart: add init post hook
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-10-19 16:14:24 +01:00
Thomas Ingleby
fb1034b2b0 hook: add spi init hooks
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-09 18:01:23 +01:00
Thomas Ingleby
dd9129d411 hook: add pwm hook around init
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-09 18:01:23 +01:00
Thomas Ingleby
92cbb6097c aio: add init hooks, and fp hook
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-09 18:00:23 +01:00
Thomas Ingleby
715863cd28 pwm: add period write replace hook
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-07-24 14:20:01 +01:00
Thomas Ingleby
57d58b66ca i2c: add init(pre-post) hooks
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-07-14 18:19:07 +01:00
Thomas Ingleby
b74759e973 mraa: rename internal adv func mraa_adv_func_t
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-07-14 15:12:08 +01:00
Thomas Ingleby
1fafd97f5e hook: rename from declared struct to adance_func
* Removed bitfield, now checks if pointer NULL.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-07-11 09:14:49 +01:00
Thomas Ingleby
d0ea43f8d1 mraa: initial implementation of "hooks"
* 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>
2014-06-27 15:37:48 +01:00