Lines Matching +full:- +full:exponent
4 * SPDX-License-Identifier: Apache-2.0
43 * @param exp exponent part of prescaler
49 * count = (timeout * pclk / INTERNAL_DIVIDER * (2^prescaler_exp) ) - 1
56 const struct gd32_wwdgt_config *config = dev->config; in gd32_wwdgt_calc_ticks()
60 (clock_control_subsys_t)&config->clkid, in gd32_wwdgt_calc_ticks()
64 / (WWDGT_INTERNAL_DIVIDER * (1 << exp) * MSEC_PER_SEC) - 1) in gd32_wwdgt_calc_ticks()
76 * @return 0 on success, -EINVAL if the window-max is out of range
84 uint32_t max_count = gd32_wwdgt_calc_ticks(dev, win->max, shift); in gd32_wwdgt_calc_window()
89 if (win->min == 0U) { in gd32_wwdgt_calc_window()
92 *wval = gd32_wwdgt_calc_ticks(dev, win->min, shift); in gd32_wwdgt_calc_window()
99 return -EINVAL; in gd32_wwdgt_calc_window()
111 return -ENOTSUP; in gd32_wwdgt_setup()
117 return -ENOTSUP; in gd32_wwdgt_setup()
132 return -EPERM; in gd32_wwdgt_disable()
141 struct gd32_wwdgt_data *data = dev->data; in gd32_wwdgt_install_timeout()
143 if (config->window.max == 0U) { in gd32_wwdgt_install_timeout()
144 LOG_ERR("window.max must be non-zero"); in gd32_wwdgt_install_timeout()
145 return -EINVAL; in gd32_wwdgt_install_timeout()
148 if (gd32_wwdgt_calc_window(dev, &config->window, &counter, &window, in gd32_wwdgt_install_timeout()
151 return -EINVAL; in gd32_wwdgt_install_timeout()
154 data->callback = config->callback; in gd32_wwdgt_install_timeout()
155 data->counter = counter; in gd32_wwdgt_install_timeout()
164 struct gd32_wwdgt_data *data = dev->data; in gd32_wwdgt_feed()
168 wwdgt_counter_update(data->counter); in gd32_wwdgt_feed()
175 struct gd32_wwdgt_data *data = dev->data; in gd32_wwdgt_isr()
180 if (data->callback != NULL) { in gd32_wwdgt_isr()
181 data->callback(dev, 0); in gd32_wwdgt_isr()
204 const struct gd32_wwdgt_config *config = dev->config; in gd32_wwdgt_init()
207 (clock_control_subsys_t)&config->clkid); in gd32_wwdgt_init()
208 (void)reset_line_toggle_dt(&config->reset); in gd32_wwdgt_init()