11#ifndef ZEPHYR_DRIVERS_MISC_TIMEAWARE_GPIO_TIMEAWARE_GPIO
12#define ZEPHYR_DRIVERS_MISC_TIMEAWARE_GPIO_TIMEAWARE_GPIO
50__subsystem
struct tgpio_driver_api {
55 uint64_t repeat_interval,
bool periodic_enable);
76static inline int z_impl_tgpio_port_get_time(
const struct device *dev,
uint64_t *current_time)
78 const struct tgpio_driver_api *api = (
const struct tgpio_driver_api *)dev->
api;
80 return api->get_time(dev, current_time);
93static inline int z_impl_tgpio_port_get_cycles_per_second(
const struct device *dev,
96 const struct tgpio_driver_api *api = (
const struct tgpio_driver_api *)dev->
api;
98 return api->cyc_per_sec(dev, cycles);
111static inline int z_impl_tgpio_pin_disable(
const struct device *dev,
uint32_t pin)
113 const struct tgpio_driver_api *api = (
const struct tgpio_driver_api *)dev->
api;
115 return api->pin_disable(dev, pin);
130static inline int z_impl_tgpio_pin_config_ext_timestamp(
const struct device *dev,
uint32_t pin,
133 const struct tgpio_driver_api *api = (
const struct tgpio_driver_api *)dev->
api;
135 return api->config_ext_ts(dev, pin, event_polarity);
151 bool periodic_enable);
153static inline int z_impl_tgpio_pin_periodic_output(
const struct device *dev,
uint32_t pin,
155 bool periodic_enable)
157 const struct tgpio_driver_api *api = (
const struct tgpio_driver_api *)dev->
api;
159 return api->set_perout(dev, pin, start_time, repeat_interval, periodic_enable);
175static inline int z_impl_tgpio_pin_read_ts_ec(
const struct device *dev,
uint32_t pin,
178 const struct tgpio_driver_api *api = (
const struct tgpio_driver_api *)dev->
api;
180 return api->read_ts_ec(dev, pin, timestamp, event_count);
191#include <syscalls/timeaware_gpio.h>
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:36
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:39
@ TGPIO_RISING_EDGE
Definition: timeaware_gpio.h:37
@ TGPIO_FALLING_EDGE
Definition: timeaware_gpio.h:38
__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:381
const void * api
Address of the API structure exposed by the device instance.
Definition: device.h:387