Zephyr API Documentation 4.5.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
counter_driver_api Struct Reference

Driver Operations Counter driver operations More...

#include <zephyr/drivers/counter.h>

Data Fields

counter_api_start start
  REQ Start counter device in free running mode.
counter_api_stop stop
  REQ Stop counter device.
counter_api_get_value get_value
  REQ Get current counter value.
counter_api_reset reset
  OPT Reset the counter to the initial value.
counter_api_set_value set_value
  OPT Set current counter value.
counter_api_set_alarm set_alarm
  REQ Set a single shot alarm on a channel.
counter_api_cancel_alarm cancel_alarm
  REQ Cancel an alarm on a channel.
counter_api_set_top_value set_top_value
  REQ Set counter top value.
counter_api_get_pending_int get_pending_int
  REQ Function to get pending interrupts.
counter_api_get_top_value get_top_value
  REQ Function to retrieve current top value.
counter_api_get_guard_period get_guard_period
  OPT Return guard period.
counter_api_set_guard_period set_guard_period
  OPT Set guard period in counter ticks.
counter_api_get_freq get_freq
  OPT
counter_api_get_freq_64 get_freq_64
  OPT Function to get counter frequency in 64bits.
counter_api_get_value_64 get_value_64
  OPT Get current counter 64-bit value.
counter_api_set_value_64 set_value_64
  OPT Set current counter 64-bit value.
counter_api_set_alarm_64 set_alarm_64
  REQ Set a single shot alarm on a channel for 64 bits.
counter_api_get_guard_period_64 get_guard_period_64
  OPT Return guard period for 64 bits.
counter_api_set_guard_period_64 set_guard_period_64
  OPT Set guard period in counter ticks for 64 bits.
counter_api_get_top_value_64 get_top_value_64
  REQ Function to retrieve current top value for 64 bits.
counter_api_set_top_value_64 set_top_value_64
  REQ Set counter top value for 64 bits.
counter_api_capture_configure capture_configure
  REQ Configure a capture channel and register its callback.
counter_api_capture_configure_64 capture_configure_64
  REQ Configure a capture channel and register its callback for 64 bits ticks.
counter_api_enable_capture enable_capture
  REQ Enable capture on a channel.
counter_api_disable_capture disable_capture
  REQ Disable capture on a channel.
counter_api_set_calibration set_calibration
  OPT Set counter calibration value.
counter_api_get_calibration get_calibration
  OPT Get counter calibration value.

Detailed Description

Driver Operations Counter driver operations

This is the driver API structure any Counter driver needs to define. It contains function pointers to the operations the driver implements, as well as any other driver-specific constant data.

Members marked with REQ MUST be set by the driver, whereas those marked with OPT are optional.

See also
DEVICE_DT_INST_DEFINE()
DEVICE_DT_DEFINE()
DEVICE_API()

Field Documentation

◆ cancel_alarm

counter_api_cancel_alarm counter_driver_api::cancel_alarm

REQ Cancel an alarm on a channel.

◆ capture_configure

counter_api_capture_configure counter_driver_api::capture_configure

REQ Configure a capture channel and register its callback.

Attention
Available only when the following Kconfig option is enabled: CONFIG_COUNTER_CAPTURE.

◆ capture_configure_64

counter_api_capture_configure_64 counter_driver_api::capture_configure_64

REQ Configure a capture channel and register its callback for 64 bits ticks.

Attention
Available only when the following Kconfig options are enabled: CONFIG_COUNTER_CAPTURE, CONFIG_COUNTER_64BITS_TICKS.

◆ disable_capture

counter_api_disable_capture counter_driver_api::disable_capture

REQ Disable capture on a channel.

Attention
Available only when the following Kconfig option is enabled: CONFIG_COUNTER_CAPTURE.

◆ enable_capture

counter_api_enable_capture counter_driver_api::enable_capture

REQ Enable capture on a channel.

Attention
Available only when the following Kconfig option is enabled: CONFIG_COUNTER_CAPTURE.

◆ get_calibration

counter_api_get_calibration counter_driver_api::get_calibration

OPT Get counter calibration value.

Attention
Available only when the following Kconfig option is enabled: CONFIG_COUNTER_CALIBRATION.

◆ get_freq

counter_api_get_freq counter_driver_api::get_freq

OPT

◆ get_freq_64

counter_api_get_freq_64 counter_driver_api::get_freq_64

OPT Function to get counter frequency in 64bits.

Attention
Available only when the following Kconfig option is enabled: CONFIG_COUNTER_64BITS_FREQ.

◆ get_guard_period

counter_api_get_guard_period counter_driver_api::get_guard_period

OPT Return guard period.

◆ get_guard_period_64

counter_api_get_guard_period_64 counter_driver_api::get_guard_period_64

OPT Return guard period for 64 bits.

Attention
Available only when the following Kconfig option is enabled: CONFIG_COUNTER_64BITS_TICKS.

◆ get_pending_int

counter_api_get_pending_int counter_driver_api::get_pending_int

REQ Function to get pending interrupts.

◆ get_top_value

counter_api_get_top_value counter_driver_api::get_top_value

REQ Function to retrieve current top value.

◆ get_top_value_64

counter_api_get_top_value_64 counter_driver_api::get_top_value_64

REQ Function to retrieve current top value for 64 bits.

Attention
Available only when the following Kconfig option is enabled: CONFIG_COUNTER_64BITS_TICKS.

◆ get_value

counter_api_get_value counter_driver_api::get_value

REQ Get current counter value.

◆ get_value_64

counter_api_get_value_64 counter_driver_api::get_value_64

OPT Get current counter 64-bit value.

Attention
Available only when the following Kconfig option is enabled: CONFIG_COUNTER_64BITS_TICKS.

◆ reset

counter_api_reset counter_driver_api::reset

OPT Reset the counter to the initial value.

◆ set_alarm

counter_api_set_alarm counter_driver_api::set_alarm

REQ Set a single shot alarm on a channel.

◆ set_alarm_64

counter_api_set_alarm_64 counter_driver_api::set_alarm_64

REQ Set a single shot alarm on a channel for 64 bits.

Attention
Available only when the following Kconfig option is enabled: CONFIG_COUNTER_64BITS_TICKS.

◆ set_calibration

counter_api_set_calibration counter_driver_api::set_calibration

OPT Set counter calibration value.

Attention
Available only when the following Kconfig option is enabled: CONFIG_COUNTER_CALIBRATION.

◆ set_guard_period

counter_api_set_guard_period counter_driver_api::set_guard_period

OPT Set guard period in counter ticks.

◆ set_guard_period_64

counter_api_set_guard_period_64 counter_driver_api::set_guard_period_64

OPT Set guard period in counter ticks for 64 bits.

Attention
Available only when the following Kconfig option is enabled: CONFIG_COUNTER_64BITS_TICKS.

◆ set_top_value

counter_api_set_top_value counter_driver_api::set_top_value

REQ Set counter top value.

◆ set_top_value_64

counter_api_set_top_value_64 counter_driver_api::set_top_value_64

REQ Set counter top value for 64 bits.

Attention
Available only when the following Kconfig option is enabled: CONFIG_COUNTER_64BITS_TICKS.

◆ set_value

counter_api_set_value counter_driver_api::set_value

OPT Set current counter value.

◆ set_value_64

counter_api_set_value_64 counter_driver_api::set_value_64

OPT Set current counter 64-bit value.

Attention
Available only when the following Kconfig option is enabled: CONFIG_COUNTER_64BITS_TICKS.

◆ start

counter_api_start counter_driver_api::start

REQ Start counter device in free running mode.

◆ stop

counter_api_stop counter_driver_api::stop

REQ Stop counter device.


The documentation for this struct was generated from the following file: