timed_gpio: backport from CAF @5d92f71