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>
This commit is contained in:
19
src/mraa.c
19
src/mraa.c
@@ -264,25 +264,6 @@ mraa_pin_mode_test(int pin, mraa_pinmodes_t mode)
|
||||
return 0;
|
||||
}
|
||||
|
||||
mraa_mmap_pin_t*
|
||||
mraa_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 (mraa_setup_mux_mapped(plat->pins[pin].mmap.gpio) != MRAA_SUCCESS)
|
||||
return NULL;
|
||||
|
||||
if (mraa_setup_mux_mapped(plat->pins[pin].mmap.gpio) != MRAA_SUCCESS)
|
||||
return NULL;
|
||||
mraa_mmap_pin_t *ret = &(plat->pins[pin].mmap);
|
||||
return ret;
|
||||
}
|
||||
|
||||
mraa_platform_t mraa_get_platform_type()
|
||||
{
|
||||
return platform_type;
|
||||
|
||||
Reference in New Issue
Block a user