Lines Matching +full:8 +full:- +full:pin

4  * SPDX-License-Identifier: Apache-2.0
9 #include <zephyr/dt-bindings/pinctrl/b91-pinctrl.h>
17 * gpio_en: PORT_A[0-7]
18 * gpio_en + 1*8: PORT_B[0-7]
19 * gpio_en + 2*8: PORT_C[0-7]
20 * gpio_en + 3*8: PORT_D[0-7]
21 * gpio_en + 4*8: PORT_E[0-7]
22 * gpio_en + 5*8: PORT_F[0-7]
24 #define reg_gpio_en(pin) (*(volatile uint8_t *)((uint32_t)DT_INST_REG_ADDR_BY_NAME(0, gpio_en) + \ argument
25 ((pin >> 8) * 8)))
30 * pin_mux: PORT_A[0-3]
31 * pin_mux + 1: PORT_A[4-7]
32 * pin_mux + 2: PORT_B[0-3]
33 * pin_mux + 3: PORT_B[4-7]
34 * pin_mux + 4: PORT_C[0-3]
35 * pin_mux + 5: PORT_C[4-7]
36 * pin_mux + 6: PORT_D[0-3]
37 * pin_mux + 7: PORT_D[4-7]
38 * pin_mux + 0x20: PORT_E[0-3]
39 * pin_mux + 0x21: PORT_E[4-7]
40 * pin_mux + 0x26: PORT_F[0-3]
41 * pin_mux + 0x27: PORT_F[4-7]
43 #define reg_pin_mux(pin) (*(volatile uint8_t *)((uint32_t)DT_INST_REG_ADDR_BY_NAME(0, pin_mux) + \ argument
44 (((pin >> 8) < 4) ? ((pin >> 8) * 2) : 0) + \
45 (((pin >> 8) == 4) ? 0x20 : 0) + \
46 (((pin >> 8) == 5) ? 0x26 : 0) + \
47 ((pin & 0x0f0) ? 1 : 0)))
52 * pull_up_en: PORT_A[0-3]
53 * pull_up_en + 1: PORT_A[4-7]
54 * pull_up_en + 2: PORT_B[0-3]
55 * pull_up_en + 3: PORT_B[4-7]
56 * pull_up_en + 4: PORT_C[0-3]
57 * pull_up_en + 5: PORT_C[4-7]
58 * pull_up_en + 6: PORT_D[0-3]
59 * pull_up_en + 7: PORT_D[4-7]
60 * pull_up_en + 8: PORT_E[0-3]
61 * pull_up_en + 9: PORT_E[4-7]
62 * pull_up_en + 10: PORT_F[0-3]
63 * pull_up_en + 11: PORT_F[4-7]
65 #define reg_pull_up_en(pin) ((uint8_t)(DT_INST_REG_ADDR_BY_NAME(0, pull_up_en) + \ argument
66 ((pin >> 8) * 2) + \
67 ((pin & 0xf0) ? 1 : 0)))
82 static inline void pinctrl_b91_gpio_function_disable(uint32_t pin) in pinctrl_b91_gpio_function_disable() argument
84 uint8_t bit = pin & 0xff; in pinctrl_b91_gpio_function_disable()
86 reg_gpio_en(pin) &= ~bit; in pinctrl_b91_gpio_function_disable()
90 static inline int pinctrl_b91_get_offset(uint32_t pin, uint8_t *offset) in pinctrl_b91_get_offset() argument
92 switch (B91_PINMUX_GET_PIN_ID(pin)) { in pinctrl_b91_get_offset()
119 return -EINVAL; in pinctrl_b91_get_offset()
125 /* Set pin's function */
133 uint32_t pin = B91_PINMUX_GET_PIN(*pinctrl); in pinctrl_configure_pin() local
134 uint8_t pull_up_en_addr = reg_pull_up_en(pin); in pinctrl_configure_pin()
137 status = pinctrl_b91_get_offset(pin, &offset); in pinctrl_configure_pin()
144 pinctrl_b91_gpio_function_disable(pin); in pinctrl_configure_pin()
148 reg_pin_mux(pin) = (reg_pin_mux(pin) & mask) | func; in pinctrl_configure_pin()