11#ifndef ZEPHYR_DRIVERS_MISC_TIMEAWARE_GPIO_TIMEAWARE_GPIO
12#define ZEPHYR_DRIVERS_MISC_TIMEAWARE_GPIO_TIMEAWARE_GPIO
52__subsystem
struct tgpio_driver_api {
57 uint64_t repeat_interval,
bool periodic_enable);
78static inline int z_impl_tgpio_port_get_time(
const struct device *dev,
uint64_t *current_time)
80 const struct tgpio_driver_api *api = (
const struct tgpio_driver_api *)dev->
api;
82 return api->get_time(dev, current_time);
95static inline int z_impl_tgpio_port_get_cycles_per_second(
const struct device *dev,
98 const struct tgpio_driver_api *api = (
const struct tgpio_driver_api *)dev->
api;
100 return api->cyc_per_sec(dev, cycles);
113static inline int z_impl_tgpio_pin_disable(
const struct device *dev,
uint32_t pin)
115 const struct tgpio_driver_api *api = (
const struct tgpio_driver_api *)dev->
api;
117 return api->pin_disable(dev, pin);
132static inline int z_impl_tgpio_pin_config_ext_timestamp(
const struct device *dev,
uint32_t pin,
135 const struct tgpio_driver_api *api = (
const struct tgpio_driver_api *)dev->
api;
137 return api->config_ext_ts(dev, pin, event_polarity);
153 bool periodic_enable);
155static inline int z_impl_tgpio_pin_periodic_output(
const struct device *dev,
uint32_t pin,
157 bool periodic_enable)
159 const struct tgpio_driver_api *api = (
const struct tgpio_driver_api *)dev->
api;
161 return api->set_perout(dev, pin, start_time, repeat_interval, periodic_enable);
177static inline int z_impl_tgpio_pin_read_ts_ec(
const struct device *dev,
uint32_t pin,
180 const struct tgpio_driver_api *api = (
const struct tgpio_driver_api *)dev->
api;
182 return api->read_ts_ec(dev, pin, timestamp, event_count);
193#include <zephyr/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:38
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:41
@ TGPIO_RISING_EDGE
Definition timeaware_gpio.h:39
@ TGPIO_FALLING_EDGE
Definition timeaware_gpio.h:40
__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:411
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:417