nRF Connect SDK API 3.4.99
Loading...
Searching...
No Matches
Pulse width measurement

GPIOTE + TIMER + GPPI pulse width measurement on Nordic nRF devices. More...

Data Structures

struct  pulse_meas_config
 

Macros

#define PULSE_MEAS_BLOCK_HEADER_SIZE   sizeof(void *)
 
#define PULSE_MEAS_BLOCK_SIZE(num_meas)
 

Enumerations

enum  pulse_meas_pulse_t { PULSE_MEAS_PULSE_POSITIVE , PULSE_MEAS_PULSE_NEGATIVE }
 
enum  pulse_meas_mode_t { PULSE_MEAS_MODE_ONE_SHOT , PULSE_MEAS_MODE_CONTINUOUS }
 

Functions

int pulse_meas_configure (const struct device *dev, const struct pulse_meas_config *cfg)
 Configure pulse width measurement.
 
int pulse_meas_start (const struct device *dev, struct k_mem_slab *slab)
 Start pulse width measurement.
 
int pulse_meas_stop (const struct device *dev, bool immediate)
 Stop pulse width measurement.
 
int pulse_meas_get (const struct device *dev, uint32_t **data)
 Read a completed measurement series.
 
void pulse_meas_put (const struct device *dev, uint32_t *data)
 Release a measurement buffer.
 
uint32_t pulse_meas_pending (const struct device *dev)
 Get the number of completed series waiting to be read.
 

Detailed Description

GPIOTE + TIMER + GPPI pulse width measurement on Nordic nRF devices.

The driver measures pulse widths on two GPIO inputs. A TIMER instance is cleared on the pulse start edge and captured on the end edge. Results are delivered as series of pulse widths stored in memory slabs. Each value is in microseconds.