Private
Public Access
2
0

mmap: added mmap io to gpio

* added function to gpio to use mmap
* changed board definition format around mmap io (fast-gpio)
* Intel Galileo Rev D updated to follow changed definitions

* Example performing mmap io to pin 2 added.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
Thomas Ingleby
2014-05-29 16:30:07 +01:00
parent b9352a9e8c
commit 7af6a96a13
8 changed files with 182 additions and 11 deletions

View File

@@ -312,3 +312,22 @@ maa_pin_mode_test(int pin, maa_pinmodes_t mode)
}
return 0;
}
maa_mmap_pin_t*
maa_setup_mmap_gpio(int pin)
{
if (plat == NULL)
return NULL;
if (plat->pins[pin].capabilites.fast_gpio != 1)
return NULL;
if (plat->pins[pin].mmap.gpio.mux_total > 0)
if (maa_setup_mux_mapped(plat->pins[pin].mmap.gpio) != MAA_SUCCESS)
return NULL;
if (maa_setup_mux_mapped(plat->pins[pin].mmap.gpio) != MAA_SUCCESS)
return NULL;
maa_mmap_pin_t *ret = &(plat->pins[pin].mmap);
return ret;
}