But yeah all the touch screen and backlight logic is behind the STMP811 touch/gpio expander. https://www.solder.party/docs/keyboard-featherwing/schematics_keyboard_featherwing.png
That shouldn't be too bad. I wrote the STMPE811 driver. It is a multi-function chip and does GPIO, ADC, Touch, temperature sensing. I have only used it for touch so it resides in the an odd location. It us under drivers/input:
drivers/input/stmpe811.h drivers/input/stmpe811_adc.c drivers/input/stmpe811_base.c drivers/input/stmpe811_gpio.c drivers/input/stmpe811_temp.c drivers/input/stmpe811_tsc.c With support for something like this how do you think it is best
organized in the board folder layout and do you think it would make sense to have a logical block for this that could be shared with other feather boards?
I think you will be using normal drivers under the drivers/ directory. GPIOs are never explicitly exposed to common code. That is the benefit from being highly modularized. All use of the GPIOs will be hidden under lower half drivers that are not so different from other lower half drivers except that they do not access the MCU GPIO pins, but go through I2C to access the GPIOs via the STMPE811.
There are a few good examples of use of the STMPE811GPIO expander: boards/arm/stm32/stm3220g-eval/src/stm3220g-eval.h boards/arm/stm32/stm3220g-eval/src/stm32_stmpe811.c boards/arm/stm32/stm3240g-eval/src/stm3240g-eval.h boards/arm/stm32/stm3240g-eval/src/stm32_stmpe811.c boards/arm/stm32/stm32f429i-disco/src/stm32f429i-disco.h boards/arm/stm32/stm32f429i-disco/src/stm32_stmpe811.c These are used in LCD-related configurations boards/arm/stm32/stm3220g-eval/configs/nxwm/defconfig boards/arm/stm32/stm3240g-eval/configs/knxwm/defconfig boards/arm/stm32/stm3240g-eval/configs/nxwm/defconfig boards/arm/stm32/stm32f429i-disco/configs/fb/defconfig boards/arm/stm32/stm32f429i-disco/configs/lvgl/defconfig boards/arm/stm32/stm32f429i-disco/configs/nxwm/defconfig