Lines Matching refs:this
292 struct rtc_status *this = &nhw_rtc_st[rtc]; in get_counter_match_time() local
297 if (this->running == true) { in get_counter_match_time()
301 if(this->counter_startT_sub_us > 0) in get_counter_match_time()
303 *next_match_sub_us = this->counter_startT_sub_us in get_counter_match_time()
306 else if (counter_match_sub_us > this->counter_startT_negative_sub_us) in get_counter_match_time()
308 *next_match_sub_us = counter_match_sub_us - this->counter_startT_negative_sub_us; in get_counter_match_time()
313 + counter_match_sub_us - this->counter_startT_negative_sub_us; in get_counter_match_time()
330 struct rtc_status *this = &nhw_rtc_st[rtc]; in nhw_rtc_update_master_timer() local
332 if (this->running == false) { in nhw_rtc_update_master_timer()
335 for (int cc = 0 ; cc < this->n_CCs ; cc++) { in nhw_rtc_update_master_timer()
336 if (this->cc_timers[cc] < Timer_RTC) { in nhw_rtc_update_master_timer()
337 Timer_RTC = this->cc_timers[cc]; in nhw_rtc_update_master_timer()
341 if (this->overflow_timer < Timer_RTC) { in nhw_rtc_update_master_timer()
342 Timer_RTC = this->overflow_timer; in nhw_rtc_update_master_timer()
368 struct rtc_status *this = &nhw_rtc_st[rtc]; in update_overflow_timer() local
369 …this->overflow_timer = get_counter_match_time(rtc, RTC_COUNTER_MASK + 1, &this->overflow_timer_sub… in update_overflow_timer()
387 struct rtc_status *this = &nhw_rtc_st[rtc]; in nhw_rtc_set_counter() local
398 this->counter_startT_sub_us = last_lf_tick_sub_us - counter_val_sub_us; in nhw_rtc_set_counter()
399 this->counter_startT_negative_sub_us = 0; in nhw_rtc_set_counter()
403 this->counter_startT_sub_us = 0; in nhw_rtc_set_counter()
404 this->counter_startT_negative_sub_us = counter_val_sub_us - last_lf_tick_sub_us; in nhw_rtc_set_counter()
414 struct rtc_status *this = &nhw_rtc_st[rtc]; in handle_overflow_event() local
419 uint64_t current_overflow_event_sub_us = this->overflow_timer_sub_us; in handle_overflow_event()
425 this->counter_startT_sub_us = current_overflow_event_sub_us; in handle_overflow_event()
426 this->counter_startT_negative_sub_us = 0; in handle_overflow_event()
473 struct rtc_status *this = &nhw_rtc_st[rtc]; in nhw_rtc_update_COUNTER() local
476 if (this->running == true) { in nhw_rtc_update_COUNTER()
479 get_time_in_sub_us() - this->counter_startT_sub_us in nhw_rtc_update_COUNTER()
480 + this->counter_startT_negative_sub_us); in nhw_rtc_update_COUNTER()
483 RTC_regs->COUNTER = this->counter_at_stop & RTC_COUNTER_MASK; in nhw_rtc_update_COUNTER()
491 struct rtc_status *this = &nhw_rtc_st[rtc]; in nhw_rtc_TASKS_START() local
493 if (this->running == true) { in nhw_rtc_TASKS_START()
497 this->running = true; in nhw_rtc_TASKS_START()
500 this->PRESC = NRF_RTC_regs[rtc].PRESCALER; in nhw_rtc_TASKS_START()
503 nhw_rtc_set_counter(rtc, this->counter_at_stop); in nhw_rtc_TASKS_START()
510 struct rtc_status *this = &nhw_rtc_st[rtc]; in nhw_rtc_TASKS_STOP() local
512 if (this->running == false) { in nhw_rtc_TASKS_STOP()
516 this->running = false; in nhw_rtc_TASKS_STOP()
517 this->counter_at_stop = time_sub_us_to_counter(rtc, in nhw_rtc_TASKS_STOP()
518 get_time_in_sub_us() - this->counter_startT_sub_us in nhw_rtc_TASKS_STOP()
519 …+ this->counter_startT_negative_sub_us); //we save the value when the counter was stoped in case i… in nhw_rtc_TASKS_STOP()
520 this->counter_at_stop &= RTC_COUNTER_MASK; in nhw_rtc_TASKS_STOP()
521 NRF_RTC_regs[rtc].COUNTER = this->counter_at_stop; in nhw_rtc_TASKS_STOP()
522 for (int cc = 0 ; cc < this->n_CCs ; cc++) { in nhw_rtc_TASKS_STOP()
523 this->cc_timers[cc] = TIME_NEVER; in nhw_rtc_TASKS_STOP()
525 this->overflow_timer = TIME_NEVER; in nhw_rtc_TASKS_STOP()
570 struct rtc_status *this = &nhw_rtc_st[rtc]; in nhw_rtc_eval_interrupts() local
573 for (int cc = 0; cc < this->n_CCs; cc++) { in nhw_rtc_eval_interrupts()
574 int mask = this->INTEN & (RTC_INTENSET_COMPARE0_Msk << cc); in nhw_rtc_eval_interrupts()
581 if (NRF_RTC_regs[rtc].EVENTS_TICK && (this->INTEN & RTC_INTENSET_TICK_Msk)) { in nhw_rtc_eval_interrupts()
584 if (NRF_RTC_regs[rtc].EVENTS_OVRFLW && (this->INTEN & RTC_INTENSET_OVRFLW_Msk)) { in nhw_rtc_eval_interrupts()
602 struct rtc_status *this = &nhw_rtc_st[rtc]; in nhw_rtc_signal_COMPARE() local
616 if (!((RTC_regs->EVTEN | this->INTEN) & mask)) { in nhw_rtc_signal_COMPARE()
639 nhw_dppi_event_signal_if(this->dppi_map, in nhw_rtc_signal_COMPARE()
649 struct rtc_status *this = &nhw_rtc_st[rtc]; in nhw_rtc_signal_OVERFLOW() local
652 if (!((RTC_regs->EVTEN | this->INTEN) & RTC_EVTEN_OVRFLW_Msk)) { in nhw_rtc_signal_OVERFLOW()
674 nhw_dppi_event_signal_if(this->dppi_map, in nhw_rtc_signal_OVERFLOW()
685 struct rtc_status *this = &nhw_rtc_st[rtc]; in nhw_rtc_signal_TICK() local
688 if (!((RTC_regs->EVTEN | this->INTEN) & RTC_EVTEN_TICK_Msk)) { in nhw_rtc_signal_TICK()
710 nhw_dppi_event_signal_if(this->dppi_map, in nhw_rtc_signal_TICK()
774 struct rtc_status *this = &nhw_rtc_st[inst]; in nhw_rtc_regw_sideeffects_SUBSCRIBE_CAPTURE() local
776 nhw_dppi_common_subscribe_sideeffect(this->dppi_map, in nhw_rtc_regw_sideeffects_SUBSCRIBE_CAPTURE()
777 this->NRF_RTC_regs->SUBSCRIBE_CAPTURE[cc_n], in nhw_rtc_regw_sideeffects_SUBSCRIBE_CAPTURE()
778 &this->subscribed_CAPTURE[cc_n], in nhw_rtc_regw_sideeffects_SUBSCRIBE_CAPTURE()
791 struct rtc_status *this = &nhw_rtc_st[inst]; \
793 nhw_dppi_common_subscribe_sideeffect(this->dppi_map, \
794 this->NRF_RTC_regs->SUBSCRIBE_##TASK_N, \
795 &this->subscribed_##TASK_N, \
809 struct rtc_status *this = &nhw_rtc_st[rtc]; in NHW_RTC_REGW_SIDEFFECTS_SUBSCRIBE() local
813 this->INTEN |= RTC_regs->INTENSET; in NHW_RTC_REGW_SIDEFFECTS_SUBSCRIBE()
814 RTC_regs->INTENSET = this->INTEN; in NHW_RTC_REGW_SIDEFFECTS_SUBSCRIBE()
816 check_not_supported_TICK(this->INTEN); in NHW_RTC_REGW_SIDEFFECTS_SUBSCRIBE()
823 struct rtc_status *this = &nhw_rtc_st[rtc]; in nhw_rtc_regw_sideeffect_INTENCLR() local
827 this->INTEN &= ~RTC_regs->INTENCLR; in nhw_rtc_regw_sideeffect_INTENCLR()
828 RTC_regs->INTENSET = this->INTEN; in nhw_rtc_regw_sideeffect_INTENCLR()
860 struct rtc_status *this = &nhw_rtc_st[rtc]; in nhw_rtc_regw_sideeffects_CC() local
862 if (this->running == true) { in nhw_rtc_regw_sideeffects_CC()