Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Time-aware GPIO Interface

Time-aware GPIO Interface . More...

Enumerations

enum  tgpio_pin_polarity { TGPIO_RISING_EDGE = 0 , TGPIO_FALLING_EDGE , TGPIO_TOGGLE_EDGE }
 Event polarity. More...
 

Functions

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.
 
int tgpio_pin_disable (const struct device *dev, uint32_t pin)
 Disable operation on pin.
 
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_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.
 
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.
 

Detailed Description

Time-aware GPIO Interface .

Since
3.5
Version
0.1.0

Enumeration Type Documentation

◆ tgpio_pin_polarity

#include <zephyr/drivers/misc/timeaware_gpio/timeaware_gpio.h>

Event polarity.

Enumerator
TGPIO_RISING_EDGE 
TGPIO_FALLING_EDGE 
TGPIO_TOGGLE_EDGE 

Function Documentation

◆ tgpio_pin_config_ext_timestamp()

int tgpio_pin_config_ext_timestamp ( const struct device * dev,
uint32_t pin,
uint32_t event_polarity )

#include <zephyr/drivers/misc/timeaware_gpio/timeaware_gpio.h>

Enable/Continue operation on pin.

Parameters
devTGPIO device
pinTGPIO pin
event_polarityTGPIO pin event polarity
Returns
0 if successful, negative errno code on failure.

◆ tgpio_pin_disable()

int tgpio_pin_disable ( const struct device * dev,
uint32_t pin )

#include <zephyr/drivers/misc/timeaware_gpio/timeaware_gpio.h>

Disable operation on pin.

Parameters
devTGPIO device
pinTGPIO pin
Returns
0 if successful, negative errno code on failure.

◆ tgpio_pin_periodic_output()

int tgpio_pin_periodic_output ( const struct device * dev,
uint32_t pin,
uint64_t start_time,
uint64_t repeat_interval,
bool periodic_enable )

#include <zephyr/drivers/misc/timeaware_gpio/timeaware_gpio.h>

Enable periodic pulse generation on a pin.

Parameters
devTGPIO device
pinTGPIO pin
start_timestart_time of first pulse in hw cycles
repeat_intervalrepeat interval between two pulses in hw cycles
periodic_enableenables periodic mode if 'true' is passed.
Returns
0 if successful, negative errno code on failure.

◆ tgpio_pin_read_ts_ec()

int tgpio_pin_read_ts_ec ( const struct device * dev,
uint32_t pin,
uint64_t * timestamp,
uint64_t * event_count )

#include <zephyr/drivers/misc/timeaware_gpio/timeaware_gpio.h>

Read timestamp and event counter from TGPIO.

Parameters
devTGPIO device
pinTGPIO pin
timestamptimestamp of the last pulse received
event_countnumber of pulses received since the pin is enabled
Returns
0 if successful, negative errno code on failure.

◆ tgpio_port_get_cycles_per_second()

int tgpio_port_get_cycles_per_second ( const struct device * dev,
uint32_t * cycles )

#include <zephyr/drivers/misc/timeaware_gpio/timeaware_gpio.h>

Get current running rate.

Parameters
devTGPIO device
cyclespointer to store current running frequency
Returns
0 if successful, negative errno code on failure.

◆ tgpio_port_get_time()

int tgpio_port_get_time ( const struct device * dev,
uint64_t * current_time )

#include <zephyr/drivers/misc/timeaware_gpio/timeaware_gpio.h>

Get time from ART timer.

Parameters
devTGPIO device
current_timePointer to store timer value in cycles
Returns
0 if successful
negative errno code on failure.