Lines Matching refs:p_reg
47 static int gpiote_number_from_ptr(NRF_GPIOTE_Type const * p_reg){ in gpiote_number_from_ptr() argument
48 int i = ( (int)p_reg - (int)&NRF_GPIOTE_regs[0] ) / sizeof(NRF_GPIOTE_Type); in gpiote_number_from_ptr()
52 void nrf_gpiote_task_trigger(NRF_GPIOTE_Type * p_reg, nrf_gpiote_task_t task) in nrf_gpiote_task_trigger() argument
54 uint32_t *reg = (uint32_t *)((uintptr_t)p_reg + task); in nrf_gpiote_task_trigger()
57 uint inst = gpiote_number_from_ptr(p_reg); in nrf_gpiote_task_trigger()
73 void nrf_gpiote_event_clear(NRF_GPIOTE_Type * p_reg, nrf_gpiote_event_t event) in nrf_gpiote_event_clear() argument
75 uint32_t *reg = (uint32_t *)((uintptr_t)p_reg + event); in nrf_gpiote_event_clear()
78 uint inst = gpiote_number_from_ptr(p_reg); in nrf_gpiote_event_clear()
102 void nrf_gpiote_int_enable(NRF_GPIOTE_Type * p_reg, uint32_t mask) in nrf_gpiote_int_enable() argument
104 uint inst = gpiote_number_from_ptr(p_reg); in nrf_gpiote_int_enable()
105 p_reg->NRFX_CONCAT_2(INTENSET, NRF_GPIOTE_IRQ_GROUP) = mask; in nrf_gpiote_int_enable()
110 void nrf_gpiote_int_disable(NRF_GPIOTE_Type * p_reg, uint32_t mask) in nrf_gpiote_int_disable() argument
112 uint inst = gpiote_number_from_ptr(p_reg); in nrf_gpiote_int_disable()
113 p_reg->NRFX_CONCAT_2(INTENCLR, NRF_GPIOTE_IRQ_GROUP) = mask; in nrf_gpiote_int_disable()
117 void nrf_gpiote_event_enable(NRF_GPIOTE_Type * p_reg, uint32_t idx) in nrf_gpiote_event_enable() argument
119 uint inst = gpiote_number_from_ptr(p_reg); in nrf_gpiote_event_enable()
120 p_reg->CONFIG[idx] |= GPIOTE_CONFIG_MODE_Event; in nrf_gpiote_event_enable()
124 void nrf_gpiote_event_disable(NRF_GPIOTE_Type * p_reg, uint32_t idx) in nrf_gpiote_event_disable() argument
126 uint inst = gpiote_number_from_ptr(p_reg); in nrf_gpiote_event_disable()
127 p_reg->CONFIG[idx] &= ~GPIOTE_CONFIG_MODE_Msk; in nrf_gpiote_event_disable()
132 void nrf_gpiote_int_group_enable(NRF_GPIOTE_Type * p_reg, in nrf_gpiote_int_group_enable() argument
139 p_reg->INTENSET0 = mask; in nrf_gpiote_int_group_enable()
142 p_reg->INTENSET1 = mask; in nrf_gpiote_int_group_enable()
146 p_reg->INTENSET2 = mask; in nrf_gpiote_int_group_enable()
151 p_reg->INTENSET3 = mask; in nrf_gpiote_int_group_enable()
156 p_reg->INTENSET4 = mask; in nrf_gpiote_int_group_enable()
161 p_reg->INTENSET5 = mask; in nrf_gpiote_int_group_enable()
166 p_reg->INTENSET6 = mask; in nrf_gpiote_int_group_enable()
173 uint inst = gpiote_number_from_ptr(p_reg); in nrf_gpiote_int_group_enable()
177 void nrf_gpiote_int_group_disable(NRF_GPIOTE_Type * p_reg, in nrf_gpiote_int_group_disable() argument
184 p_reg->INTENCLR0 = mask; in nrf_gpiote_int_group_disable()
187 p_reg->INTENCLR1 = mask; in nrf_gpiote_int_group_disable()
191 p_reg->INTENCLR2 = mask; in nrf_gpiote_int_group_disable()
196 p_reg->INTENCLR3 = mask; in nrf_gpiote_int_group_disable()
201 p_reg->INTENCLR4 = mask; in nrf_gpiote_int_group_disable()
206 p_reg->INTENCLR5 = mask; in nrf_gpiote_int_group_disable()
211 p_reg->INTENCLR6 = mask; in nrf_gpiote_int_group_disable()
218 uint inst = gpiote_number_from_ptr(p_reg); in nrf_gpiote_int_group_disable()
223 void nrf_gpiote_event_configure(NRF_GPIOTE_Type * p_reg, in nrf_gpiote_event_configure() argument
228 uint inst = gpiote_number_from_ptr(p_reg); in nrf_gpiote_event_configure()
229 p_reg->CONFIG[idx] &= ~(GPIOTE_CONFIG_PORT_PIN_Msk | GPIOTE_CONFIG_POLARITY_Msk); in nrf_gpiote_event_configure()
230 p_reg->CONFIG[idx] |= ((pin << GPIOTE_CONFIG_PSEL_Pos) & GPIOTE_CONFIG_PORT_PIN_Msk) | in nrf_gpiote_event_configure()
235 void nrf_gpiote_task_enable(NRF_GPIOTE_Type * p_reg, uint32_t idx) in nrf_gpiote_task_enable() argument
237 uint inst = gpiote_number_from_ptr(p_reg); in nrf_gpiote_task_enable()
238 uint32_t final_config = p_reg->CONFIG[idx] | GPIOTE_CONFIG_MODE_Task; in nrf_gpiote_task_enable()
239 p_reg->CONFIG[idx] = final_config; in nrf_gpiote_task_enable()
243 void nrf_gpiote_task_disable(NRF_GPIOTE_Type * p_reg, uint32_t idx) in nrf_gpiote_task_disable() argument
245 uint inst = gpiote_number_from_ptr(p_reg); in nrf_gpiote_task_disable()
246 p_reg->CONFIG[idx] &= ~GPIOTE_CONFIG_MODE_Msk; in nrf_gpiote_task_disable()
250 void nrf_gpiote_task_configure(NRF_GPIOTE_Type * p_reg, in nrf_gpiote_task_configure() argument
256 uint inst = gpiote_number_from_ptr(p_reg); in nrf_gpiote_task_configure()
257 p_reg->CONFIG[idx] &= ~(GPIOTE_CONFIG_PORT_PIN_Msk | in nrf_gpiote_task_configure()
261 p_reg->CONFIG[idx] |= ((pin << GPIOTE_CONFIG_PSEL_Pos) & GPIOTE_CONFIG_PORT_PIN_Msk) | in nrf_gpiote_task_configure()
268 void nrf_gpiote_task_force(NRF_GPIOTE_Type * p_reg, in nrf_gpiote_task_force() argument
272 uint inst = gpiote_number_from_ptr(p_reg); in nrf_gpiote_task_force()
273 p_reg->CONFIG[idx] = (p_reg->CONFIG[idx] & ~GPIOTE_CONFIG_OUTINIT_Msk) | in nrf_gpiote_task_force()
278 void nrf_gpiote_te_default(NRF_GPIOTE_Type * p_reg, uint32_t idx) in nrf_gpiote_te_default() argument
280 uint inst = gpiote_number_from_ptr(p_reg); in nrf_gpiote_te_default()
281 p_reg->CONFIG[idx] = 0; in nrf_gpiote_te_default()
283 p_reg->CONFIG[idx] = 0; in nrf_gpiote_te_default()
289 static void nrf_gpiote_subscribe_common(NRF_GPIOTE_Type * p_reg, in nrf_gpiote_subscribe_common() argument
292 uint inst = gpiote_number_from_ptr(p_reg); in nrf_gpiote_subscribe_common()
310 void nrf_gpiote_subscribe_set(NRF_GPIOTE_Type * p_reg, in nrf_gpiote_subscribe_set() argument
314 *((volatile uint32_t *) ((uint8_t *) p_reg + (uint32_t) task + 0x80uL)) = in nrf_gpiote_subscribe_set()
316 nrf_gpiote_subscribe_common(p_reg, task); in nrf_gpiote_subscribe_set()
319 void nrf_gpiote_subscribe_clear(NRF_GPIOTE_Type * p_reg, nrf_gpiote_task_t task) in nrf_gpiote_subscribe_clear() argument
321 *((volatile uint32_t *) ((uint8_t *) p_reg + (uint32_t) task + 0x80uL)) = 0; in nrf_gpiote_subscribe_clear()
322 nrf_gpiote_subscribe_common(p_reg, task); in nrf_gpiote_subscribe_clear()