How to write Kconfig menu to select GPIO pin as gpio_num_t
Posted: Mon Aug 23, 2021 7:15 pm
Hello,
I am trying to write a Kconfig menu to be able to choose the GPIO pin for a given use.
But it seems that I can only choose an integer value, e.g. :
And then I cannot call the gpio api because of wrong type.
Now, is there a mean to make this selection so that CONFIG_PIN_STATUS_MAIN will be e.g. GPIO_NUM_23 with the default value ?
Otherwise I plan to have a function that do the mapping, called to initialize a constant, but it's my last resort.
I am trying to write a Kconfig menu to be able to choose the GPIO pin for a given use.
But it seems that I can only choose an integer value, e.g. :
Code: Select all
config PIN_STATUS_MAIN
int "Main LED GPIO number"
range 0 34
default 23
help
GPIO number (IOxx) for the 'Main status' LED.
Now, is there a mean to make this selection so that CONFIG_PIN_STATUS_MAIN will be e.g. GPIO_NUM_23 with the default value ?
Otherwise I plan to have a function that do the mapping, called to initialize a constant, but it's my last resort.