How to wrtie GPIO and interrupt program in c++ like MCU(STM32)?

I want wrtie GPIO and interrupt program in c++ like MCU(STM32),but i have no idea how to do it.I have used jetson gpio in python to detect pluse edge in gpio interrupt,but the latency is not consistent.

please refer to Topic 144550, for several ways to access GPIOs. such as, kernel APIs, python scripts, C++ samples.