Zephyr API Documentation 4.4.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Counter Driver Backend API

Data Structures

struct  counter_driver_api
  Driver Operations Counter driver operations More...

Typedefs

typedef int(* counter_api_start) (const struct device *dev)
 Callback API to start the counter.
typedef int(* counter_api_stop) (const struct device *dev)
 Callback API to stop the counter.
typedef int(* counter_api_get_value) (const struct device *dev, uint32_t *ticks)
 Callback API to get the current counter value.
typedef int(* counter_api_reset) (const struct device *dev)
 Callback API to reset the counter to the initial value.
typedef int(* counter_api_set_value) (const struct device *dev, uint32_t ticks)
 Callback API to set the current counter value.
typedef int(* counter_api_set_alarm) (const struct device *dev, uint8_t chan_id, const struct counter_alarm_cfg *alarm_cfg)
 Callback API to set a single shot alarm on a channel.
typedef int(* counter_api_cancel_alarm) (const struct device *dev, uint8_t chan_id)
 Callback API to cancel an alarm on a channel.
typedef int(* counter_api_set_top_value) (const struct device *dev, const struct counter_top_cfg *cfg)
 Callback API to set the counter top value.
typedef uint32_t(* counter_api_get_pending_int) (const struct device *dev)
 Callback API to get pending counter interrupts.
typedef uint32_t(* counter_api_get_top_value) (const struct device *dev)
 Callback API to retrieve the current top value.
typedef uint32_t(* counter_api_get_guard_period) (const struct device *dev, uint32_t flags)
 Callback API to retrieve the guard period in ticks.
typedef int(* counter_api_set_guard_period) (const struct device *dev, uint32_t ticks, uint32_t flags)
 Callback API to set the guard period in ticks.
typedef uint32_t(* counter_api_get_freq) (const struct device *dev)
 Callback API to get the counter frequency in Hz.
typedef uint64_t(* counter_api_get_freq_64) (const struct device *dev)
 Callback API to get the counter frequency in Hz (64 bits).
typedef int(* counter_api_get_value_64) (const struct device *dev, uint64_t *ticks)
 Callback API to get the current counter value (64 bits).
typedef int(* counter_api_set_value_64) (const struct device *dev, uint64_t ticks)
 Callback API to set the current counter value (64 bits).
typedef int(* counter_api_set_alarm_64) (const struct device *dev, uint8_t chan_id, const struct counter_alarm_cfg_64 *alarm_cfg)
 Callback API to set a single shot alarm on a channel (64 bits).
typedef uint64_t(* counter_api_get_guard_period_64) (const struct device *dev, uint32_t flags)
 Callback API to retrieve the guard period in ticks (64 bits).
typedef int(* counter_api_set_guard_period_64) (const struct device *dev, uint64_t ticks, uint32_t flags)
 Callback API to set the guard period in ticks (64 bits).
typedef uint64_t(* counter_api_get_top_value_64) (const struct device *dev)
 Callback API to retrieve the current top value (64 bits).
typedef int(* counter_api_set_top_value_64) (const struct device *dev, const struct counter_top_cfg_64 *cfg)
 Callback API to set the counter top value (64 bits).

Detailed Description

This group contains the API type definitions, callback signatures, and other helpers required to implement a Counter driver.

Typedef Documentation

◆ counter_api_cancel_alarm

typedef int(* counter_api_cancel_alarm) (const struct device *dev, uint8_t chan_id)

#include <zephyr/drivers/counter.h>

Callback API to cancel an alarm on a channel.

◆ counter_api_get_freq

typedef uint32_t(* counter_api_get_freq) (const struct device *dev)

#include <zephyr/drivers/counter.h>

Callback API to get the counter frequency in Hz.

◆ counter_api_get_freq_64

typedef uint64_t(* counter_api_get_freq_64) (const struct device *dev)

#include <zephyr/drivers/counter.h>

Callback API to get the counter frequency in Hz (64 bits).

◆ counter_api_get_guard_period

typedef uint32_t(* counter_api_get_guard_period) (const struct device *dev, uint32_t flags)

#include <zephyr/drivers/counter.h>

Callback API to retrieve the guard period in ticks.

◆ counter_api_get_guard_period_64

typedef uint64_t(* counter_api_get_guard_period_64) (const struct device *dev, uint32_t flags)

#include <zephyr/drivers/counter.h>

Callback API to retrieve the guard period in ticks (64 bits).

◆ counter_api_get_pending_int

typedef uint32_t(* counter_api_get_pending_int) (const struct device *dev)

#include <zephyr/drivers/counter.h>

Callback API to get pending counter interrupts.

◆ counter_api_get_top_value

typedef uint32_t(* counter_api_get_top_value) (const struct device *dev)

#include <zephyr/drivers/counter.h>

Callback API to retrieve the current top value.

◆ counter_api_get_top_value_64

typedef uint64_t(* counter_api_get_top_value_64) (const struct device *dev)

#include <zephyr/drivers/counter.h>

Callback API to retrieve the current top value (64 bits).

◆ counter_api_get_value

typedef int(* counter_api_get_value) (const struct device *dev, uint32_t *ticks)

#include <zephyr/drivers/counter.h>

Callback API to get the current counter value.

◆ counter_api_get_value_64

typedef int(* counter_api_get_value_64) (const struct device *dev, uint64_t *ticks)

#include <zephyr/drivers/counter.h>

Callback API to get the current counter value (64 bits).

◆ counter_api_reset

typedef int(* counter_api_reset) (const struct device *dev)

#include <zephyr/drivers/counter.h>

Callback API to reset the counter to the initial value.

◆ counter_api_set_alarm

typedef int(* counter_api_set_alarm) (const struct device *dev, uint8_t chan_id, const struct counter_alarm_cfg *alarm_cfg)

#include <zephyr/drivers/counter.h>

Callback API to set a single shot alarm on a channel.

◆ counter_api_set_alarm_64

typedef int(* counter_api_set_alarm_64) (const struct device *dev, uint8_t chan_id, const struct counter_alarm_cfg_64 *alarm_cfg)

#include <zephyr/drivers/counter.h>

Callback API to set a single shot alarm on a channel (64 bits).

◆ counter_api_set_guard_period

typedef int(* counter_api_set_guard_period) (const struct device *dev, uint32_t ticks, uint32_t flags)

#include <zephyr/drivers/counter.h>

Callback API to set the guard period in ticks.

◆ counter_api_set_guard_period_64

typedef int(* counter_api_set_guard_period_64) (const struct device *dev, uint64_t ticks, uint32_t flags)

#include <zephyr/drivers/counter.h>

Callback API to set the guard period in ticks (64 bits).

◆ counter_api_set_top_value

typedef int(* counter_api_set_top_value) (const struct device *dev, const struct counter_top_cfg *cfg)

#include <zephyr/drivers/counter.h>

Callback API to set the counter top value.

◆ counter_api_set_top_value_64

typedef int(* counter_api_set_top_value_64) (const struct device *dev, const struct counter_top_cfg_64 *cfg)

#include <zephyr/drivers/counter.h>

Callback API to set the counter top value (64 bits).

◆ counter_api_set_value

typedef int(* counter_api_set_value) (const struct device *dev, uint32_t ticks)

#include <zephyr/drivers/counter.h>

Callback API to set the current counter value.

◆ counter_api_set_value_64

typedef int(* counter_api_set_value_64) (const struct device *dev, uint64_t ticks)

#include <zephyr/drivers/counter.h>

Callback API to set the current counter value (64 bits).

◆ counter_api_start

typedef int(* counter_api_start) (const struct device *dev)

#include <zephyr/drivers/counter.h>

Callback API to start the counter.

◆ counter_api_stop

typedef int(* counter_api_stop) (const struct device *dev)

#include <zephyr/drivers/counter.h>

Callback API to stop the counter.