Lines Matching refs:delay
340 uint32_t _cyhal_lptimer_get_toggle_bit(uint32_t c2_current, uint32_t delay) in _cyhal_lptimer_get_toggle_bit() argument
342 uint32_t val = c2_current ^ (c2_current + delay); in _cyhal_lptimer_get_toggle_bit()
351 static uint32_t _cyhal_lptimer_set_delay_common(cyhal_lptimer_t *obj, uint32_t delay) in _cyhal_lptimer_set_delay_common() argument
362 if (delay <= _CYHAL_LPTIMER_MIN_DELAY) in _cyhal_lptimer_set_delay_common()
364 delay = _CYHAL_LPTIMER_MIN_DELAY; in _cyhal_lptimer_set_delay_common()
368 if (delay > _CYHAL_LPTIMER_MAX_DELAY_TICKS) in _cyhal_lptimer_set_delay_common()
370 delay = _CYHAL_LPTIMER_MAX_DELAY_TICKS; in _cyhal_lptimer_set_delay_common()
375 obj->counter = (delay > ((1 << 16)-1)) ? CY_MCWDT_COUNTER2 : CY_MCWDT_COUNTER1; in _cyhal_lptimer_set_delay_common()
380 uint32_t match_value = counter_value + delay; in _cyhal_lptimer_set_delay_common()
389 match_value = delay - _CYHAL_LPTIMER_MIN_DELAY; in _cyhal_lptimer_set_delay_common()
404 uint32_t toggle_bit = _cyhal_lptimer_get_toggle_bit(counter_value, delay); in _cyhal_lptimer_set_delay_common()
420 static uint32_t _cyhal_lptimer_set_delay_common(cyhal_lptimer_t *obj, uint32_t delay) in _cyhal_lptimer_set_delay_common() argument
447 if (delay <= _CYHAL_LPTIMER_MIN_DELAY) in _cyhal_lptimer_set_delay_common()
449 delay = _CYHAL_LPTIMER_MIN_DELAY; in _cyhal_lptimer_set_delay_common()
451 if (delay > _CYHAL_LPTIMER_MAX_DELAY_TICKS) in _cyhal_lptimer_set_delay_common()
453 delay = _CYHAL_LPTIMER_MAX_DELAY_TICKS; in _cyhal_lptimer_set_delay_common()
494 uint16_t c0_match = (uint16_t)(c0_current_ticks + delay); in _cyhal_lptimer_set_delay_common()
509 delay -= (c0_new_ticks >= c0_current_ticks) in _cyhal_lptimer_set_delay_common()
513 c0_match = (uint16_t)(c0_current_ticks + delay); in _cyhal_lptimer_set_delay_common()
515 uint16_t c1_match = (uint16_t)(c1_current_ticks + (delay >> 16)); in _cyhal_lptimer_set_delay_common()
679 cy_rslt_t cyhal_lptimer_set_delay(cyhal_lptimer_t *obj, uint32_t delay) in cyhal_lptimer_set_delay() argument
683 obj->final_time = (Cy_MCWDT_GetCount(obj->base, CY_MCWDT_COUNTER2) + delay); in cyhal_lptimer_set_delay()
685 return _cyhal_lptimer_set_delay_common(obj, delay); in cyhal_lptimer_set_delay()