Lines Matching refs:p_reg
13 static int rtc_number_from_ptr(NRF_RTC_Type const * p_reg){ in rtc_number_from_ptr() argument
14 int i = ( (int)p_reg - (int)&NRF_RTC_regs[0] ) / sizeof(NRF_RTC_Type); in rtc_number_from_ptr()
18 void nrf_rtc_cc_set(NRF_RTC_Type * p_reg, uint32_t ch, uint32_t cc_val) in nrf_rtc_cc_set() argument
20 p_reg->CC[ch] = cc_val; in nrf_rtc_cc_set()
21 int i = rtc_number_from_ptr(p_reg); in nrf_rtc_cc_set()
25 void nrf_rtc_int_enable(NRF_RTC_Type * p_reg, uint32_t mask) in nrf_rtc_int_enable() argument
27 int i = rtc_number_from_ptr(p_reg); in nrf_rtc_int_enable()
28 p_reg->INTENSET = mask; in nrf_rtc_int_enable()
32 void nrf_rtc_int_disable(NRF_RTC_Type * p_reg, uint32_t mask) in nrf_rtc_int_disable() argument
34 int i = rtc_number_from_ptr(p_reg); in nrf_rtc_int_disable()
35 p_reg->INTENCLR = mask; in nrf_rtc_int_disable()
39 uint32_t nrf_rtc_counter_get(NRF_RTC_Type const * p_reg) in nrf_rtc_counter_get() argument
41 int i = rtc_number_from_ptr(p_reg); in nrf_rtc_counter_get()
43 return p_reg->COUNTER; in nrf_rtc_counter_get()
46 void nrf_rtc_task_trigger(NRF_RTC_Type * p_reg, nrf_rtc_task_t task) in nrf_rtc_task_trigger() argument
48 *(uint32_t *)((uint32_t)p_reg + task) = 1; in nrf_rtc_task_trigger()
50 int i = rtc_number_from_ptr(p_reg); in nrf_rtc_task_trigger()
70 void nrf_rtc_event_clear(NRF_RTC_Type * p_reg, nrf_rtc_event_t event) in nrf_rtc_event_clear() argument
72 *((volatile uint32_t *)((uint8_t *)p_reg + (uint32_t)event)) = 0; in nrf_rtc_event_clear()
74 int i = rtc_number_from_ptr(p_reg); in nrf_rtc_event_clear()
78 void nrf_rtc_event_enable(NRF_RTC_Type * p_reg, uint32_t mask) in nrf_rtc_event_enable() argument
80 int i = rtc_number_from_ptr(p_reg); in nrf_rtc_event_enable()
81 p_reg->EVTENSET = mask; in nrf_rtc_event_enable()
85 void nrf_rtc_event_disable(NRF_RTC_Type * p_reg, uint32_t event) in nrf_rtc_event_disable() argument
87 int i = rtc_number_from_ptr(p_reg); in nrf_rtc_event_disable()
88 p_reg->EVTENCLR = event; in nrf_rtc_event_disable()
94 static void nrf_rtc_subscribe_common(NRF_RTC_Type * p_reg, in nrf_rtc_subscribe_common() argument
97 int i = rtc_number_from_ptr(p_reg); in nrf_rtc_subscribe_common()
118 void nrf_rtc_subscribe_set(NRF_RTC_Type * p_reg, in nrf_rtc_subscribe_set() argument
122 *((volatile uint32_t *) ((uint8_t *) p_reg + (uint32_t) task + 0x80uL)) = in nrf_rtc_subscribe_set()
124 nrf_rtc_subscribe_common(p_reg, task); in nrf_rtc_subscribe_set()
127 void nrf_rtc_subscribe_clear(NRF_RTC_Type * p_reg, in nrf_rtc_subscribe_clear() argument
130 *((volatile uint32_t *) ((uint8_t *) p_reg + (uint32_t) task + 0x80uL)) = 0; in nrf_rtc_subscribe_clear()
131 nrf_rtc_subscribe_common(p_reg, task); in nrf_rtc_subscribe_clear()