Lines Matching +full:disabling +full:- +full:power +full:- +full:states
5 * SPDX-License-Identifier: Apache-2.0
262 (const struct counter_config_info *)dev->config; in z_impl_counter_is_counting_up()
264 return config->flags & COUNTER_CONFIG_INFO_COUNT_UP; in z_impl_counter_is_counting_up()
279 (const struct counter_config_info *)dev->config; in z_impl_counter_get_num_of_channels()
281 return config->channels; in z_impl_counter_get_num_of_channels()
297 (const struct counter_config_info *)dev->config; in z_impl_counter_get_frequency()
299 (struct counter_driver_api *)dev->api; in z_impl_counter_get_frequency()
301 return api->get_freq ? api->get_freq(dev) : config->freq; in z_impl_counter_get_frequency()
350 (const struct counter_config_info *)dev->config; in z_impl_counter_get_max_top_value()
352 return config->max_top_value; in z_impl_counter_get_max_top_value()
368 (struct counter_driver_api *)dev->api; in z_impl_counter_start()
370 return api->start(dev); in z_impl_counter_start()
379 * @retval -ENOTSUP if the device doesn't support stopping the
387 (struct counter_driver_api *)dev->api; in z_impl_counter_stop()
389 return api->stop(dev); in z_impl_counter_stop()
406 (struct counter_driver_api *)dev->api; in z_impl_counter_get_value()
408 return api->get_value(dev, ticks); in z_impl_counter_get_value()
412 * @brief Get current counter 64-bit value.
425 (struct counter_driver_api *)dev->api; in z_impl_counter_get_value_64()
427 if (!api->get_value_64) { in z_impl_counter_get_value_64()
428 return -ENOTSUP; in z_impl_counter_get_value_64()
431 return api->get_value_64(dev, ticks); in z_impl_counter_get_value_64()
437 * After expiration alarm can be set again, disabling is not needed. When alarm
448 * @retval -ENOTSUP if request is not supported (device does not support
450 * @retval -EINVAL if alarm settings are invalid.
451 * @retval -ETIME if absolute alarm was set too late.
452 * @retval -EBUSY if alarm is already active.
463 (struct counter_driver_api *)dev->api; in z_impl_counter_set_channel_alarm()
466 return -ENOTSUP; in z_impl_counter_set_channel_alarm()
469 return api->set_alarm(dev, chan_id, alarm_cfg); in z_impl_counter_set_channel_alarm()
481 * @retval -ENOTSUP if request is not supported or the counter was not started
491 (struct counter_driver_api *)dev->api; in z_impl_counter_cancel_channel_alarm()
494 return -ENOTSUP; in z_impl_counter_cancel_channel_alarm()
497 return api->cancel_alarm(dev, chan_id); in z_impl_counter_cancel_channel_alarm()
517 * @retval -ENOTSUP if request is not supported (e.g. top value cannot be
520 * @retval -EBUSY if any alarm is active.
521 * @retval -ETIME if @ref COUNTER_TOP_CFG_DONT_RESET was set and new top value
532 (struct counter_driver_api *)dev->api; in z_impl_counter_set_top_value()
534 if (cfg->ticks > counter_get_max_top_value(dev)) { in z_impl_counter_set_top_value()
535 return -EINVAL; in z_impl_counter_set_top_value()
538 return api->set_top_value(dev, cfg); in z_impl_counter_set_top_value()
547 * low power states to check the wake up source.
559 (struct counter_driver_api *)dev->api; in z_impl_counter_get_pending_int()
561 return api->get_pending_int(dev); in z_impl_counter_get_pending_int()
576 (struct counter_driver_api *)dev->api; in z_impl_counter_get_top_value()
578 return api->get_top_value(dev); in z_impl_counter_get_top_value()
606 * - When counting upwards (see @ref COUNTER_CONFIG_INFO_COUNT_UP) the given
609 * - When counting downwards, the given absolute tick value must be less than
610 * (now + top_value - guard_period) % top_value to be accepted.
614 * - counting upwards, now = 4950, top value = 5000, guard period = 100:
616 * - counting downwards, now = 50, top value = 5000, guard period = 100:
617 * absolute tick value <= (50 + 5000 - * 100) % 5000 = 4950
630 * @retval -ENOTSUP if function or flags are not supported.
631 * @retval -EINVAL if ticks value is invalid.
641 (struct counter_driver_api *)dev->api; in z_impl_counter_set_guard_period()
643 if (!api->set_guard_period) { in z_impl_counter_set_guard_period()
644 return -ENOTSUP; in z_impl_counter_set_guard_period()
647 return api->set_guard_period(dev, ticks, flags); in z_impl_counter_set_guard_period()
668 (struct counter_driver_api *)dev->api; in z_impl_counter_get_guard_period()
670 return (api->get_guard_period) ? api->get_guard_period(dev, flags) : 0; in z_impl_counter_get_guard_period()