Lines Matching +full:validity +full:- +full:control

4  * SPDX-License-Identifier: Apache-2.0
9 * @brief Driver to provide the GPIO API for a simple 32-bit i/o register
11 * This is a driver for accessing a simple, fixed purpose, 32-bit
12 * memory-mapped i/o register using the same APIs as GPIO drivers. This is
14 * block and these registers are used to control things that Zephyr normally
16 * chip-select line for an SPI device.
21 * stems from the use of a read-modify-write method for all changes.
36 struct gpio_mmio32_context *context = dev->data; in gpio_mmio32_config()
37 const struct gpio_mmio32_config *config = context->config; in gpio_mmio32_config()
39 if ((config->mask & (1 << pin)) == 0) { in gpio_mmio32_config()
40 return -EINVAL; /* Pin not in our validity mask */ in gpio_mmio32_config()
47 return -ENOTSUP; in gpio_mmio32_config()
52 volatile uint32_t *reg = config->reg; in gpio_mmio32_config()
58 *reg = (*reg & (config->mask & ~(1 << pin))); in gpio_mmio32_config()
68 struct gpio_mmio32_context *context = dev->data; in gpio_mmio32_port_get_raw()
69 const struct gpio_mmio32_config *config = context->config; in gpio_mmio32_port_get_raw()
71 *value = *config->reg & config->mask; in gpio_mmio32_port_get_raw()
80 struct gpio_mmio32_context *context = dev->data; in gpio_mmio32_port_set_masked_raw()
81 const struct gpio_mmio32_config *config = context->config; in gpio_mmio32_port_set_masked_raw()
82 volatile uint32_t *reg = config->reg; in gpio_mmio32_port_set_masked_raw()
85 mask &= config->mask; in gpio_mmio32_port_set_masked_raw()
99 struct gpio_mmio32_context *context = dev->data; in gpio_mmio32_port_set_bits_raw()
100 const struct gpio_mmio32_config *config = context->config; in gpio_mmio32_port_set_bits_raw()
101 volatile uint32_t *reg = config->reg; in gpio_mmio32_port_set_bits_raw()
104 mask &= config->mask; in gpio_mmio32_port_set_bits_raw()
117 struct gpio_mmio32_context *context = dev->data; in gpio_mmio32_port_clear_bits_raw()
118 const struct gpio_mmio32_config *config = context->config; in gpio_mmio32_port_clear_bits_raw()
119 volatile uint32_t *reg = config->reg; in gpio_mmio32_port_clear_bits_raw()
122 mask &= config->mask; in gpio_mmio32_port_clear_bits_raw()
135 struct gpio_mmio32_context *context = dev->data; in gpio_mmio32_port_toggle_bits()
136 const struct gpio_mmio32_config *config = context->config; in gpio_mmio32_port_toggle_bits()
137 volatile uint32_t *reg = config->reg; in gpio_mmio32_port_toggle_bits()
140 mask &= config->mask; in gpio_mmio32_port_toggle_bits()
161 struct gpio_mmio32_context *context = dev->data; in gpio_mmio32_init()
162 const struct gpio_mmio32_config *config = dev->config; in gpio_mmio32_init()
164 context->config = config; in gpio_mmio32_init()