Lines Matching refs:port

291 	const struct device *port;  member
334 .port = DEVICE_DT_GET(DT_GPIO_CTLR_BY_IDX(node_id, prop, idx)),\
727 typedef void (*gpio_callback_handler_t)(const struct device *port,
794 int (*pin_configure)(const struct device *port, gpio_pin_t pin,
797 int (*pin_get_config)(const struct device *port, gpio_pin_t pin,
800 int (*port_get_raw)(const struct device *port,
802 int (*port_set_masked_raw)(const struct device *port,
805 int (*port_set_bits_raw)(const struct device *port,
807 int (*port_clear_bits_raw)(const struct device *port,
809 int (*port_toggle_bits)(const struct device *port,
811 int (*pin_interrupt_configure)(const struct device *port,
814 int (*manage_callback)(const struct device *port,
819 int (*port_get_direction)(const struct device *port, gpio_port_pins_t map,
839 return device_is_ready(spec->port); in gpio_is_ready_dt()
865 __syscall int gpio_pin_interrupt_configure(const struct device *port,
869 static inline int z_impl_gpio_pin_interrupt_configure(const struct device *port, in z_impl_gpio_pin_interrupt_configure() argument
874 (const struct gpio_driver_api *)port->api; in z_impl_gpio_pin_interrupt_configure()
876 (const struct gpio_driver_config *)port->config; in z_impl_gpio_pin_interrupt_configure()
878 (const struct gpio_driver_data *)port->data; in z_impl_gpio_pin_interrupt_configure()
883 SYS_PORT_TRACING_FUNC_ENTER(gpio_pin, interrupt_configure, port, pin, flags); in z_impl_gpio_pin_interrupt_configure()
886 SYS_PORT_TRACING_FUNC_EXIT(gpio_pin, interrupt_configure, port, pin, -ENOSYS); in z_impl_gpio_pin_interrupt_configure()
931 ret = api->pin_interrupt_configure(port, pin, mode, trig); in z_impl_gpio_pin_interrupt_configure()
932 SYS_PORT_TRACING_FUNC_EXIT(gpio_pin, interrupt_configure, port, pin, ret); in z_impl_gpio_pin_interrupt_configure()
954 return gpio_pin_interrupt_configure(spec->port, spec->pin, flags); in gpio_pin_interrupt_configure_dt()
972 __syscall int gpio_pin_configure(const struct device *port,
976 static inline int z_impl_gpio_pin_configure(const struct device *port, in z_impl_gpio_pin_configure() argument
981 (const struct gpio_driver_api *)port->api; in z_impl_gpio_pin_configure()
983 (const struct gpio_driver_config *)port->config; in z_impl_gpio_pin_configure()
985 (struct gpio_driver_data *)port->data; in z_impl_gpio_pin_configure()
988 SYS_PORT_TRACING_FUNC_ENTER(gpio_pin, configure, port, pin, flags); in z_impl_gpio_pin_configure()
1028 ret = api->pin_configure(port, pin, flags); in z_impl_gpio_pin_configure()
1029 SYS_PORT_TRACING_FUNC_EXIT(gpio_pin, configure, port, pin, ret); in z_impl_gpio_pin_configure()
1047 return gpio_pin_configure(spec->port, in gpio_pin_configure_dt()
1070 __syscall int gpio_port_get_direction(const struct device *port, gpio_port_pins_t map,
1074 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
1078 const struct gpio_driver_api *api = (const struct gpio_driver_api *)port->api; in z_impl_gpio_port_get_direction()
1081 SYS_PORT_TRACING_FUNC_ENTER(gpio_port, get_direction, port, map, inputs, outputs); in z_impl_gpio_port_get_direction()
1084 SYS_PORT_TRACING_FUNC_EXIT(gpio_port, get_direction, port, -ENOSYS); in z_impl_gpio_port_get_direction()
1088 ret = api->port_get_direction(port, map, inputs, outputs); in z_impl_gpio_port_get_direction()
1089 SYS_PORT_TRACING_FUNC_EXIT(gpio_port, get_direction, port, ret); in z_impl_gpio_port_get_direction()
1106 static inline int gpio_pin_is_input(const struct device *port, gpio_pin_t pin) in gpio_pin_is_input() argument
1111 (const struct gpio_driver_config *)port->config; in gpio_pin_is_input()
1115 rv = gpio_port_get_direction(port, BIT(pin), &pins, NULL); in gpio_pin_is_input()
1136 return gpio_pin_is_input(spec->port, spec->pin); in gpio_pin_is_input_dt()
1151 static inline int gpio_pin_is_output(const struct device *port, gpio_pin_t pin) in gpio_pin_is_output() argument
1156 (const struct gpio_driver_config *)port->config; in gpio_pin_is_output()
1160 rv = gpio_port_get_direction(port, BIT(pin), NULL, &pins); in gpio_pin_is_output()
1181 return gpio_pin_is_output(spec->port, spec->pin); in gpio_pin_is_output_dt()
1199 __syscall int gpio_pin_get_config(const struct device *port, gpio_pin_t pin,
1203 static inline int z_impl_gpio_pin_get_config(const struct device *port, in z_impl_gpio_pin_get_config() argument
1208 (const struct gpio_driver_api *)port->api; in z_impl_gpio_pin_get_config()
1211 SYS_PORT_TRACING_FUNC_ENTER(gpio_pin, get_config, port, pin, *flags); in z_impl_gpio_pin_get_config()
1214 SYS_PORT_TRACING_FUNC_EXIT(gpio_pin, get_config, port, pin, -ENOSYS); in z_impl_gpio_pin_get_config()
1218 ret = api->pin_get_config(port, pin, flags); in z_impl_gpio_pin_get_config()
1219 SYS_PORT_TRACING_FUNC_EXIT(gpio_pin, get_config, port, pin, ret); in z_impl_gpio_pin_get_config()
1239 return gpio_pin_get_config(spec->port, spec->pin, flags); in gpio_pin_get_config_dt()
1259 __syscall int gpio_port_get_raw(const struct device *port,
1262 static inline int z_impl_gpio_port_get_raw(const struct device *port, gpio_port_value_t *value) in z_impl_gpio_port_get_raw() argument
1264 const struct gpio_driver_api *api = (const struct gpio_driver_api *)port->api; in z_impl_gpio_port_get_raw()
1267 SYS_PORT_TRACING_FUNC_ENTER(gpio_port, get_raw, port, value); in z_impl_gpio_port_get_raw()
1269 ret = api->port_get_raw(port, value); in z_impl_gpio_port_get_raw()
1270 SYS_PORT_TRACING_FUNC_EXIT(gpio_port, get_raw, port, ret); in z_impl_gpio_port_get_raw()
1292 static inline int gpio_port_get(const struct device *port, in gpio_port_get() argument
1296 (const struct gpio_driver_data *)port->data; in gpio_port_get()
1299 ret = gpio_port_get_raw(port, value); in gpio_port_get()
1324 __syscall int gpio_port_set_masked_raw(const struct device *port,
1328 static inline int z_impl_gpio_port_set_masked_raw(const struct device *port, in z_impl_gpio_port_set_masked_raw() argument
1333 (const struct gpio_driver_api *)port->api; in z_impl_gpio_port_set_masked_raw()
1336 SYS_PORT_TRACING_FUNC_ENTER(gpio_port, set_masked_raw, port, mask, value); in z_impl_gpio_port_set_masked_raw()
1338 ret = api->port_set_masked_raw(port, mask, value); in z_impl_gpio_port_set_masked_raw()
1339 SYS_PORT_TRACING_FUNC_EXIT(gpio_port, set_masked_raw, port, ret); in z_impl_gpio_port_set_masked_raw()
1363 static inline int gpio_port_set_masked(const struct device *port, in gpio_port_set_masked() argument
1368 (const struct gpio_driver_data *)port->data; in gpio_port_set_masked()
1372 return gpio_port_set_masked_raw(port, mask, value); in gpio_port_set_masked()
1385 __syscall int gpio_port_set_bits_raw(const struct device *port,
1388 static inline int z_impl_gpio_port_set_bits_raw(const struct device *port, in z_impl_gpio_port_set_bits_raw() argument
1392 (const struct gpio_driver_api *)port->api; in z_impl_gpio_port_set_bits_raw()
1395 SYS_PORT_TRACING_FUNC_ENTER(gpio_port, set_bits_raw, port, pins); in z_impl_gpio_port_set_bits_raw()
1397 ret = api->port_set_bits_raw(port, pins); in z_impl_gpio_port_set_bits_raw()
1398 SYS_PORT_TRACING_FUNC_EXIT(gpio_port, set_bits_raw, port, ret); in z_impl_gpio_port_set_bits_raw()
1412 static inline int gpio_port_set_bits(const struct device *port, in gpio_port_set_bits() argument
1415 return gpio_port_set_masked(port, pins, pins); in gpio_port_set_bits()
1428 __syscall int gpio_port_clear_bits_raw(const struct device *port,
1431 static inline int z_impl_gpio_port_clear_bits_raw(const struct device *port, in z_impl_gpio_port_clear_bits_raw() argument
1435 (const struct gpio_driver_api *)port->api; in z_impl_gpio_port_clear_bits_raw()
1438 SYS_PORT_TRACING_FUNC_ENTER(gpio_port, clear_bits_raw, port, pins); in z_impl_gpio_port_clear_bits_raw()
1440 ret = api->port_clear_bits_raw(port, pins); in z_impl_gpio_port_clear_bits_raw()
1441 SYS_PORT_TRACING_FUNC_EXIT(gpio_port, clear_bits_raw, port, ret); in z_impl_gpio_port_clear_bits_raw()
1455 static inline int gpio_port_clear_bits(const struct device *port, in gpio_port_clear_bits() argument
1458 return gpio_port_set_masked(port, pins, 0); in gpio_port_clear_bits()
1471 __syscall int gpio_port_toggle_bits(const struct device *port,
1474 static inline int z_impl_gpio_port_toggle_bits(const struct device *port, in z_impl_gpio_port_toggle_bits() argument
1478 (const struct gpio_driver_api *)port->api; in z_impl_gpio_port_toggle_bits()
1481 SYS_PORT_TRACING_FUNC_ENTER(gpio_port, toggle_bits, port, pins); in z_impl_gpio_port_toggle_bits()
1483 ret = api->port_toggle_bits(port, pins); in z_impl_gpio_port_toggle_bits()
1484 SYS_PORT_TRACING_FUNC_EXIT(gpio_port, toggle_bits, port, ret); in z_impl_gpio_port_toggle_bits()
1499 static inline int gpio_port_set_clr_bits_raw(const struct device *port, in gpio_port_set_clr_bits_raw() argument
1505 return gpio_port_set_masked_raw(port, set_pins | clear_pins, set_pins); in gpio_port_set_clr_bits_raw()
1519 static inline int gpio_port_set_clr_bits(const struct device *port, in gpio_port_set_clr_bits() argument
1525 return gpio_port_set_masked(port, set_pins | clear_pins, set_pins); in gpio_port_set_clr_bits()
1543 static inline int gpio_pin_get_raw(const struct device *port, gpio_pin_t pin) in gpio_pin_get_raw() argument
1546 (const struct gpio_driver_config *)port->config; in gpio_pin_get_raw()
1553 ret = gpio_port_get_raw(port, &value); in gpio_pin_get_raw()
1580 static inline int gpio_pin_get(const struct device *port, gpio_pin_t pin) in gpio_pin_get() argument
1583 (const struct gpio_driver_config *)port->config; in gpio_pin_get()
1590 ret = gpio_port_get(port, &value); in gpio_pin_get()
1610 return gpio_pin_get(spec->port, spec->pin); in gpio_pin_get_dt()
1628 static inline int gpio_pin_set_raw(const struct device *port, gpio_pin_t pin, in gpio_pin_set_raw() argument
1632 (const struct gpio_driver_config *)port->config; in gpio_pin_set_raw()
1639 ret = gpio_port_set_bits_raw(port, (gpio_port_pins_t)BIT(pin)); in gpio_pin_set_raw()
1641 ret = gpio_port_clear_bits_raw(port, (gpio_port_pins_t)BIT(pin)); in gpio_pin_set_raw()
1668 static inline int gpio_pin_set(const struct device *port, gpio_pin_t pin, in gpio_pin_set() argument
1672 (const struct gpio_driver_config *)port->config; in gpio_pin_set()
1674 (const struct gpio_driver_data *)port->data; in gpio_pin_set()
1683 return gpio_pin_set_raw(port, pin, value); in gpio_pin_set()
1699 return gpio_pin_set(spec->port, spec->pin, value); in gpio_pin_set_dt()
1712 static inline int gpio_pin_toggle(const struct device *port, gpio_pin_t pin) in gpio_pin_toggle() argument
1715 (const struct gpio_driver_config *)port->config; in gpio_pin_toggle()
1720 return gpio_port_toggle_bits(port, (gpio_port_pins_t)BIT(pin)); in gpio_pin_toggle()
1735 return gpio_pin_toggle(spec->port, spec->pin); in gpio_pin_toggle_dt()
1773 static inline int gpio_add_callback(const struct device *port, in gpio_add_callback() argument
1777 (const struct gpio_driver_api *)port->api; in gpio_add_callback()
1780 SYS_PORT_TRACING_FUNC_ENTER(gpio, add_callback, port, callback); in gpio_add_callback()
1783 SYS_PORT_TRACING_FUNC_EXIT(gpio, add_callback, port, -ENOSYS); in gpio_add_callback()
1787 ret = api->manage_callback(port, callback, true); in gpio_add_callback()
1788 SYS_PORT_TRACING_FUNC_EXIT(gpio, add_callback, port, ret); in gpio_add_callback()
1806 return gpio_add_callback(spec->port, callback); in gpio_add_callback_dt()
1827 static inline int gpio_remove_callback(const struct device *port, in gpio_remove_callback() argument
1831 (const struct gpio_driver_api *)port->api; in gpio_remove_callback()
1834 SYS_PORT_TRACING_FUNC_ENTER(gpio, remove_callback, port, callback); in gpio_remove_callback()
1837 SYS_PORT_TRACING_FUNC_EXIT(gpio, remove_callback, port, -ENOSYS); in gpio_remove_callback()
1841 ret = api->manage_callback(port, callback, false); in gpio_remove_callback()
1842 SYS_PORT_TRACING_FUNC_EXIT(gpio, remove_callback, port, ret); in gpio_remove_callback()
1860 return gpio_remove_callback(spec->port, callback); in gpio_remove_callback_dt()