typedef struct { void (*fn)(void *); void *arg; int __internal; PLATFORM_HOOK_s *__next; } PLATFORM_HOOK_t;
PLATFORM_HOOK_t describes a hook function that is typically executed asynchronously. The Platform Library provides a number of ways for hooks to be run, using high-frequency and low-frequency timers, and on the transitions of platform pins.
You only need to initialize fn and arg in the hook structure when passing the hook to a registration routine—the Platform Library takes care of managing __internal and __next.
platform_hook_pin_edge, platform_hook_background, platform_hook_timer