12#ifndef ZEPHYR_DRIVERS_MISC_TIMEAWARE_GPIO_TIMEAWARE_GPIO
13#define ZEPHYR_DRIVERS_MISC_TIMEAWARE_GPIO_TIMEAWARE_GPIO
53__subsystem
struct tgpio_driver_api {
54 int (*pin_disable)(
const struct device *dev,
uint32_t pin);
55 int (*get_time)(
const struct device *dev,
uint64_t *current_time);
56 int (*cyc_per_sec)(
const struct device *dev,
uint32_t *cycles);
57 int (*set_perout)(
const struct device *dev,
uint32_t pin,
uint64_t start_time,
58 uint64_t repeat_interval,
bool periodic_enable);
59 int (*config_ext_ts)(
const struct device *dev,
uint32_t pin,
uint32_t event_polarity);
60 int (*read_ts_ec)(
const struct device *dev,
uint32_t pin,
uint64_t *timestamp,
79static inline int z_impl_tgpio_port_get_time(
const struct device *dev,
uint64_t *current_time)
94static inline int z_impl_tgpio_port_get_cycles_per_second(
const struct device *dev,
110static inline int z_impl_tgpio_pin_disable(
const struct device *dev,
uint32_t pin)
127static inline int z_impl_tgpio_pin_config_ext_timestamp(
const struct device *dev,
uint32_t pin,
130 return DEVICE_API_GET(tgpio, dev)->config_ext_ts(dev, pin, event_polarity);
146 bool periodic_enable);
148static inline int z_impl_tgpio_pin_periodic_output(
const struct device *dev,
uint32_t pin,
150 bool periodic_enable)
152 return DEVICE_API_GET(tgpio, dev)->set_perout(dev, pin, start_time, repeat_interval,
169static inline int z_impl_tgpio_pin_read_ts_ec(
const struct device *dev,
uint32_t pin,
172 return DEVICE_API_GET(tgpio, dev)->read_ts_ec(dev, pin, timestamp, event_count);
183#include <zephyr/syscalls/timeaware_gpio.h>
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1375
int tgpio_pin_read_ts_ec(const struct device *dev, uint32_t pin, uint64_t *timestamp, uint64_t *event_count)
Read timestamp and event counter from TGPIO.
int tgpio_pin_config_ext_timestamp(const struct device *dev, uint32_t pin, uint32_t event_polarity)
Enable/Continue operation on pin.
int tgpio_pin_disable(const struct device *dev, uint32_t pin)
Disable operation on pin.
int tgpio_port_get_time(const struct device *dev, uint64_t *current_time)
Get time from ART timer.
int tgpio_port_get_cycles_per_second(const struct device *dev, uint32_t *cycles)
Get current running rate.
tgpio_pin_polarity
Event polarity.
Definition timeaware_gpio.h:39
int tgpio_pin_periodic_output(const struct device *dev, uint32_t pin, uint64_t start_time, uint64_t repeat_interval, bool periodic_enable)
Enable periodic pulse generation on a pin.
@ TGPIO_TOGGLE_EDGE
Definition timeaware_gpio.h:42
@ TGPIO_RISING_EDGE
Definition timeaware_gpio.h:40
@ TGPIO_FALLING_EDGE
Definition timeaware_gpio.h:41
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
Runtime device structure (in ROM) per driver instance.
Definition device.h:513