Lines Matching +full:clk +full:- +full:divider
4 * SPDX-License-Identifier: Apache-2.0
40 * additionally to the internal divider, the clock is divided by a
54 * - t_WWDG: WWDG timeout
55 * - counter: a value in [0x40, 0x7F] representing the cycles before timeout.
59 * - f_WWDG: the frequency of the WWDG clock. This can be calculated by the
63 * - f_PCLK: the clock frequency of the system
64 * - 4096: the constant internal divider
65 * - prescaler: the programmable divider with valid values of 1, 2, 4 or 8,
69 * - counter = 0x40
70 * - prescaler = 1
72 * - counter = 0x7F
73 * - prescaler = 8
82 #define ABS_DIFF_UINT(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))
85 (__TIMEOUT__ - __TIMEOUT_GOLDEN__) < \
92 const struct device *const clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE); in wwdg_stm32_get_pclk() local
96 if (clock_control_get_rate(clk, (clock_control_subsys_t) &cfg->pclken, in wwdg_stm32_get_pclk()
99 return -EIO; in wwdg_stm32_get_pclk()
117 uint32_t divider = WWDG_INTERNAL_DIVIDER * (1 << prescaler_exp); in wwdg_stm32_get_timeout() local
118 float f_wwdg = (float)wwdg_stm32_get_pclk(dev) / divider; in wwdg_stm32_get_timeout()
150 *counter = (uint32_t)(timeout_s * wwdg_freq + 1) - 1; in wwdg_stm32_convert_timeout()
186 return -ENOTSUP; in wwdg_stm32_setup()
203 return -EPERM; in wwdg_stm32_disable()
211 uint32_t timeout = config->window.max * USEC_PER_MSEC; in wwdg_stm32_install_timeout()
216 if (config->callback != NULL) { in wwdg_stm32_install_timeout()
217 data->callback = config->callback; in wwdg_stm32_install_timeout()
230 return -EINVAL; in wwdg_stm32_install_timeout()
233 data->counter = counter; in wwdg_stm32_install_timeout()
255 LL_WWDG_SetCounter(wwdg, data->counter); in wwdg_stm32_feed()
268 data->callback(dev, 0); in wwdg_stm32_isr()
282 const struct device *const clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE); in wwdg_stm32_init() local
285 if (!device_is_ready(clk)) { in wwdg_stm32_init()
287 return -ENODEV; in wwdg_stm32_init()
290 if (clock_control_on(clk, (clock_control_subsys_t)&cfg->pclken) != 0) { in wwdg_stm32_init()
292 return -EIO; in wwdg_stm32_init()