timed_gpio: backport from CAF @5d92f71e687e4e1a0

Signed-off-by: garwedgess <garethwilliams21@gmail.com>