Lines Matching refs:port
290 const struct device *port; member
333 .port = DEVICE_DT_GET(DT_GPIO_CTLR_BY_IDX(node_id, prop, idx)),\
726 typedef void (*gpio_callback_handler_t)(const struct device *port,
793 int (*pin_configure)(const struct device *port, gpio_pin_t pin,
796 int (*pin_get_config)(const struct device *port, gpio_pin_t pin,
799 int (*port_get_raw)(const struct device *port,
801 int (*port_set_masked_raw)(const struct device *port,
804 int (*port_set_bits_raw)(const struct device *port,
806 int (*port_clear_bits_raw)(const struct device *port,
808 int (*port_toggle_bits)(const struct device *port,
810 int (*pin_interrupt_configure)(const struct device *port,
813 int (*manage_callback)(const struct device *port,
818 int (*port_get_direction)(const struct device *port, gpio_port_pins_t map,
838 return device_is_ready(spec->port); in gpio_is_ready_dt()
862 __syscall int gpio_pin_interrupt_configure(const struct device *port,
866 static inline int z_impl_gpio_pin_interrupt_configure(const struct device *port, in z_impl_gpio_pin_interrupt_configure() argument
871 (const struct gpio_driver_api *)port->api; in z_impl_gpio_pin_interrupt_configure()
873 (const struct gpio_driver_config *)port->config; in z_impl_gpio_pin_interrupt_configure()
875 (const struct gpio_driver_data *)port->data; in z_impl_gpio_pin_interrupt_configure()
924 return api->pin_interrupt_configure(port, pin, mode, trig); in z_impl_gpio_pin_interrupt_configure()
943 return gpio_pin_interrupt_configure(spec->port, spec->pin, flags); in gpio_pin_interrupt_configure_dt()
961 __syscall int gpio_pin_configure(const struct device *port,
965 static inline int z_impl_gpio_pin_configure(const struct device *port, in z_impl_gpio_pin_configure() argument
970 (const struct gpio_driver_api *)port->api; in z_impl_gpio_pin_configure()
972 (const struct gpio_driver_config *)port->config; in z_impl_gpio_pin_configure()
974 (struct gpio_driver_data *)port->data; in z_impl_gpio_pin_configure()
1014 return api->pin_configure(port, pin, flags); in z_impl_gpio_pin_configure()
1031 return gpio_pin_configure(spec->port, in gpio_pin_configure_dt()
1054 __syscall int gpio_port_get_direction(const struct device *port, gpio_port_pins_t map,
1058 static inline int z_impl_gpio_port_get_direction(const struct device *port, gpio_port_pins_t map, in z_impl_gpio_port_get_direction() argument
1062 const struct gpio_driver_api *api = (const struct gpio_driver_api *)port->api; in z_impl_gpio_port_get_direction()
1068 return api->port_get_direction(port, map, inputs, outputs); in z_impl_gpio_port_get_direction()
1084 static inline int gpio_pin_is_input(const struct device *port, gpio_pin_t pin) in gpio_pin_is_input() argument
1089 (const struct gpio_driver_config *)port->config; in gpio_pin_is_input()
1093 rv = gpio_port_get_direction(port, BIT(pin), &pins, NULL); in gpio_pin_is_input()
1114 return gpio_pin_is_input(spec->port, spec->pin); in gpio_pin_is_input_dt()
1129 static inline int gpio_pin_is_output(const struct device *port, gpio_pin_t pin) in gpio_pin_is_output() argument
1134 (const struct gpio_driver_config *)port->config; in gpio_pin_is_output()
1138 rv = gpio_port_get_direction(port, BIT(pin), NULL, &pins); in gpio_pin_is_output()
1159 return gpio_pin_is_output(spec->port, spec->pin); in gpio_pin_is_output_dt()
1177 __syscall int gpio_pin_get_config(const struct device *port, gpio_pin_t pin,
1181 static inline int z_impl_gpio_pin_get_config(const struct device *port, in z_impl_gpio_pin_get_config() argument
1186 (const struct gpio_driver_api *)port->api; in z_impl_gpio_pin_get_config()
1191 return api->pin_get_config(port, pin, flags); in z_impl_gpio_pin_get_config()
1210 return gpio_pin_get_config(spec->port, spec->pin, flags); in gpio_pin_get_config_dt()
1230 __syscall int gpio_port_get_raw(const struct device *port,
1233 static inline int z_impl_gpio_port_get_raw(const struct device *port, in z_impl_gpio_port_get_raw() argument
1237 (const struct gpio_driver_api *)port->api; in z_impl_gpio_port_get_raw()
1239 return api->port_get_raw(port, value); in z_impl_gpio_port_get_raw()
1260 static inline int gpio_port_get(const struct device *port, in gpio_port_get() argument
1264 (const struct gpio_driver_data *)port->data; in gpio_port_get()
1267 ret = gpio_port_get_raw(port, value); in gpio_port_get()
1292 __syscall int gpio_port_set_masked_raw(const struct device *port,
1296 static inline int z_impl_gpio_port_set_masked_raw(const struct device *port, in z_impl_gpio_port_set_masked_raw() argument
1301 (const struct gpio_driver_api *)port->api; in z_impl_gpio_port_set_masked_raw()
1303 return api->port_set_masked_raw(port, mask, value); in z_impl_gpio_port_set_masked_raw()
1326 static inline int gpio_port_set_masked(const struct device *port, in gpio_port_set_masked() argument
1331 (const struct gpio_driver_data *)port->data; in gpio_port_set_masked()
1335 return gpio_port_set_masked_raw(port, mask, value); in gpio_port_set_masked()
1348 __syscall int gpio_port_set_bits_raw(const struct device *port,
1351 static inline int z_impl_gpio_port_set_bits_raw(const struct device *port, in z_impl_gpio_port_set_bits_raw() argument
1355 (const struct gpio_driver_api *)port->api; in z_impl_gpio_port_set_bits_raw()
1357 return api->port_set_bits_raw(port, pins); in z_impl_gpio_port_set_bits_raw()
1370 static inline int gpio_port_set_bits(const struct device *port, in gpio_port_set_bits() argument
1373 return gpio_port_set_masked(port, pins, pins); in gpio_port_set_bits()
1386 __syscall int gpio_port_clear_bits_raw(const struct device *port,
1389 static inline int z_impl_gpio_port_clear_bits_raw(const struct device *port, in z_impl_gpio_port_clear_bits_raw() argument
1393 (const struct gpio_driver_api *)port->api; in z_impl_gpio_port_clear_bits_raw()
1395 return api->port_clear_bits_raw(port, pins); in z_impl_gpio_port_clear_bits_raw()
1408 static inline int gpio_port_clear_bits(const struct device *port, in gpio_port_clear_bits() argument
1411 return gpio_port_set_masked(port, pins, 0); in gpio_port_clear_bits()
1424 __syscall int gpio_port_toggle_bits(const struct device *port,
1427 static inline int z_impl_gpio_port_toggle_bits(const struct device *port, in z_impl_gpio_port_toggle_bits() argument
1431 (const struct gpio_driver_api *)port->api; in z_impl_gpio_port_toggle_bits()
1433 return api->port_toggle_bits(port, pins); in z_impl_gpio_port_toggle_bits()
1447 static inline int gpio_port_set_clr_bits_raw(const struct device *port, in gpio_port_set_clr_bits_raw() argument
1453 return gpio_port_set_masked_raw(port, set_pins | clear_pins, set_pins); in gpio_port_set_clr_bits_raw()
1467 static inline int gpio_port_set_clr_bits(const struct device *port, in gpio_port_set_clr_bits() argument
1473 return gpio_port_set_masked(port, set_pins | clear_pins, set_pins); in gpio_port_set_clr_bits()
1491 static inline int gpio_pin_get_raw(const struct device *port, gpio_pin_t pin) in gpio_pin_get_raw() argument
1494 (const struct gpio_driver_config *)port->config; in gpio_pin_get_raw()
1501 ret = gpio_port_get_raw(port, &value); in gpio_pin_get_raw()
1528 static inline int gpio_pin_get(const struct device *port, gpio_pin_t pin) in gpio_pin_get() argument
1531 (const struct gpio_driver_config *)port->config; in gpio_pin_get()
1538 ret = gpio_port_get(port, &value); in gpio_pin_get()
1558 return gpio_pin_get(spec->port, spec->pin); in gpio_pin_get_dt()
1576 static inline int gpio_pin_set_raw(const struct device *port, gpio_pin_t pin, in gpio_pin_set_raw() argument
1580 (const struct gpio_driver_config *)port->config; in gpio_pin_set_raw()
1587 ret = gpio_port_set_bits_raw(port, (gpio_port_pins_t)BIT(pin)); in gpio_pin_set_raw()
1589 ret = gpio_port_clear_bits_raw(port, (gpio_port_pins_t)BIT(pin)); in gpio_pin_set_raw()
1616 static inline int gpio_pin_set(const struct device *port, gpio_pin_t pin, in gpio_pin_set() argument
1620 (const struct gpio_driver_config *)port->config; in gpio_pin_set()
1622 (const struct gpio_driver_data *)port->data; in gpio_pin_set()
1631 return gpio_pin_set_raw(port, pin, value); in gpio_pin_set()
1647 return gpio_pin_set(spec->port, spec->pin, value); in gpio_pin_set_dt()
1660 static inline int gpio_pin_toggle(const struct device *port, gpio_pin_t pin) in gpio_pin_toggle() argument
1663 (const struct gpio_driver_config *)port->config; in gpio_pin_toggle()
1668 return gpio_port_toggle_bits(port, (gpio_port_pins_t)BIT(pin)); in gpio_pin_toggle()
1683 return gpio_pin_toggle(spec->port, spec->pin); in gpio_pin_toggle_dt()
1717 static inline int gpio_add_callback(const struct device *port, in gpio_add_callback() argument
1721 (const struct gpio_driver_api *)port->api; in gpio_add_callback()
1727 return api->manage_callback(port, callback, true); in gpio_add_callback()
1744 return gpio_add_callback(spec->port, callback); in gpio_add_callback_dt()
1765 static inline int gpio_remove_callback(const struct device *port, in gpio_remove_callback() argument
1769 (const struct gpio_driver_api *)port->api; in gpio_remove_callback()
1775 return api->manage_callback(port, callback, false); in gpio_remove_callback()
1792 return gpio_remove_callback(spec->port, callback); in gpio_remove_callback_dt()