Lines Matching +full:device +full:- +full:id
4 * SPDX-License-Identifier: Apache-2.0
10 #include <zephyr/device.h>
14 #define STM32_RESET_CLR_OFFSET(id) (((id) >> 17U) & 0xFFFU) argument
15 #define STM32_RESET_SET_OFFSET(id) (((id) >> 5U) & 0xFFFU) argument
16 #define STM32_RESET_REG_BIT(id) ((id)&0x1FU) argument
22 static int reset_stm32_status(const struct device *dev, uint32_t id, in reset_stm32_status() argument
25 const struct reset_stm32_config *config = dev->config; in reset_stm32_status()
27 *status = !!sys_test_bit(config->base + STM32_RESET_SET_OFFSET(id), in reset_stm32_status()
28 STM32_RESET_REG_BIT(id)); in reset_stm32_status()
33 static int reset_stm32_line_assert(const struct device *dev, uint32_t id) in reset_stm32_line_assert() argument
35 const struct reset_stm32_config *config = dev->config; in reset_stm32_line_assert()
37 sys_set_bit(config->base + STM32_RESET_SET_OFFSET(id), in reset_stm32_line_assert()
38 STM32_RESET_REG_BIT(id)); in reset_stm32_line_assert()
43 static int reset_stm32_line_deassert(const struct device *dev, uint32_t id) in reset_stm32_line_deassert() argument
45 const struct reset_stm32_config *config = dev->config; in reset_stm32_line_deassert()
48 sys_set_bit(config->base + STM32_RESET_CLR_OFFSET(id), in reset_stm32_line_deassert()
49 STM32_RESET_REG_BIT(id)); in reset_stm32_line_deassert()
51 sys_clear_bit(config->base + STM32_RESET_SET_OFFSET(id), in reset_stm32_line_deassert()
52 STM32_RESET_REG_BIT(id)); in reset_stm32_line_deassert()
58 static int reset_stm32_line_toggle(const struct device *dev, uint32_t id) in reset_stm32_line_toggle() argument
60 reset_stm32_line_assert(dev, id); in reset_stm32_line_toggle()
61 reset_stm32_line_deassert(dev, id); in reset_stm32_line_toggle()