steps towards smarter gpio

This commit is contained in:
rusefi 2019-04-13 10:11:28 -04:00
parent 6fe36973e5
commit ea87042798
2 changed files with 8 additions and 1 deletions

View File

@ -115,6 +115,11 @@ const char *gpiochips_getPinName(unsigned int pin)
return NULL;
}
void gpiochip_use_gpio_base(int size) {
gpio_base_free += size;
}
/**
* @brief Register gpiochip
* @details should be called from board file. Can be called before os ready.
@ -155,7 +160,7 @@ int gpiochip_register(const char *name, struct gpiochip_ops *ops, size_t size, v
chip->size = size;
chip->priv = priv;
gpio_base_free += size;
gpiochip_use_gpio_base(size);
return (chip->base);
}

View File

@ -45,6 +45,8 @@ const char *gpiochips_getPinName(unsigned int pin);
/* register gpio cgip */
int gpiochip_register(const char *name, struct gpiochip_ops *ops, size_t size, void *priv);
void gpiochip_use_gpio_base(int size);
/* Set individual names for pins */
int gpiochips_setPinNames(brain_pin_e pin, const char **names);