steps towards smarter gpio
This commit is contained in:
parent
2f5c20e4da
commit
834fce0828
|
@ -115,6 +115,11 @@ const char *gpiochips_getPinName(unsigned int pin)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gpiochip_use_gpio_base(int size) {
|
||||||
|
gpio_base_free += size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Register gpiochip
|
* @brief Register gpiochip
|
||||||
* @details should be called from board file. Can be called before os ready.
|
* @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->size = size;
|
||||||
chip->priv = priv;
|
chip->priv = priv;
|
||||||
|
|
||||||
gpio_base_free += size;
|
gpiochip_use_gpio_base(size);
|
||||||
|
|
||||||
return (chip->base);
|
return (chip->base);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,8 @@ const char *gpiochips_getPinName(unsigned int pin);
|
||||||
/* register gpio cgip */
|
/* register gpio cgip */
|
||||||
int gpiochip_register(const char *name, struct gpiochip_ops *ops, size_t size, void *priv);
|
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 */
|
/* Set individual names for pins */
|
||||||
int gpiochips_setPinNames(brain_pin_e pin, const char **names);
|
int gpiochips_setPinNames(brain_pin_e pin, const char **names);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue