12#ifndef ZEPHYR_DRIVERS_MISC_TIMEAWARE_GPIO_TIMEAWARE_GPIO
13#define ZEPHYR_DRIVERS_MISC_TIMEAWARE_GPIO_TIMEAWARE_GPIO
63 uint64_t repeat_interval,
bool periodic_enable);
84static inline int z_impl_tgpio_port_get_time(
const struct device *dev,
uint64_t *current_time)
99static inline int z_impl_tgpio_port_get_cycles_per_second(
const struct device *dev,
115static inline int z_impl_tgpio_pin_disable(
const struct device *dev,
uint32_t pin)
132static inline int z_impl_tgpio_pin_config_ext_timestamp(
const struct device *dev,
uint32_t pin,
135 return DEVICE_API_GET(tgpio, dev)->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 return DEVICE_API_GET(tgpio, dev)->set_perout(dev, pin, start_time, repeat_interval,
174static inline int z_impl_tgpio_pin_read_ts_ec(
const struct device *dev,
uint32_t pin,
177 return DEVICE_API_GET(tgpio, dev)->read_ts_ec(dev, pin, timestamp, event_count);
188#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:1425
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
Toggle edge.
Definition timeaware_gpio.h:42
@ TGPIO_RISING_EDGE
Rising edge.
Definition timeaware_gpio.h:40
@ TGPIO_FALLING_EDGE
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
<span class="mlabel">Driver Operations</span> Time-aware GPIO driver operations
Definition timeaware_gpio.h:54
int(* set_perout)(const struct device *dev, uint32_t pin, uint64_t start_time, uint64_t repeat_interval, bool periodic_enable)
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition timeaware_gpio.h:62
int(* get_time)(const struct device *dev, uint64_t *current_time)
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition timeaware_gpio.h:58
int(* pin_disable)(const struct device *dev, uint32_t pin)
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition timeaware_gpio.h:56
int(* cyc_per_sec)(const struct device *dev, uint32_t *cycles)
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition timeaware_gpio.h:60
int(* read_ts_ec)(const struct device *dev, uint32_t pin, uint64_t *timestamp, uint64_t *event_count)
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition timeaware_gpio.h:67
int(* config_ext_ts)(const struct device *dev, uint32_t pin, uint32_t event_polarity)
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition timeaware_gpio.h:65