/* Initialize the HAL timer structure with the callback and the callback argument. Also initializes the HW specific timer pointer. */
int hal_timer_set_cb(int timer_num, struct hal_timer *timer, hal_timer_cb cb_func, void *arg)
/* Initialize the HAL timer structure with the callback and the callback argument. Also initializes the HW specific timer pointer. */
int hal_timer_set_cb(int timer_num, struct hal_timer *timer, hal_timer_cb cb_func, void *arg)
{
    int rc;
    struct nrf52_hal_timer *bsptimer;
    NRF52_HAL_TIMER_RESOLVE(timer_num, bsptimer);
    timer->cb_func = cb_func;
    timer->cb_arg = arg;
    timer->link.tqe_prev = NULL;
    timer->bsp_timer = bsptimer;
    rc = 0;
    err:
    return rc;
}