Read GPIO/UART on Android

Hi there,

What are the options to read the GPIO/UART on Android?

Specifically I would like to read a serial input in the Radxa Zero and perform taps/drag n drops, the first step is to know how to read the GPIO pins and/or UART.

Thanks!

Found something interesting over here: https://github.com/torvalds/linux/blob/master/drivers/input/mouse/gpio_mouse.c

No idea how to proceed yet, though, tips are appreciated, never worked with drivers before.