GPIO based pulse counting driver. More...

Detailed Description

GPIO based pulse counting driver.

This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.

Files

file  pulse_counter.h
 Driver for the pulse counter.
 
file  pulse_counter_params.h
 Default configuration for PULSE_COUNTER devices.
 

Data Structures

struct  pulse_counter_params_t
 Parameters needed for device initialization. More...
 
struct  pulse_counter_t
 Device descriptor for a pulse counter device. More...
 

Functions

int pulse_counter_init (pulse_counter_t *dev, const pulse_counter_params_t *params)
 Initialize a pulse counter device. More...
 
int16_t pulse_counter_read_with_reset (pulse_counter_t *dev)
 Read and reset pulse counter value. More...
 
int16_t pulse_counter_read_without_reset (pulse_counter_t *dev)
 Read pulse counter value. More...
 
void pulse_counter_reset (pulse_counter_t *dev)
 Reset pulse counter value. More...
 

Function Documentation

◆ pulse_counter_init()

int pulse_counter_init ( pulse_counter_t dev,
const pulse_counter_params_t params 
)

Initialize a pulse counter device.

Parameters
[out]devdevice descriptor
[in]paramsconfiguration parameters
Returns
0 on success
-1 on error

◆ pulse_counter_read_with_reset()

int16_t pulse_counter_read_with_reset ( pulse_counter_t dev)

Read and reset pulse counter value.

Parameters
[out]devdevice descriptor of sensor
Returns
Accumulated pulse counts

◆ pulse_counter_read_without_reset()

int16_t pulse_counter_read_without_reset ( pulse_counter_t dev)

Read pulse counter value.

Parameters
[in]devdevice descriptor of sensor
Returns
Accumulated pulse counts

◆ pulse_counter_reset()

void pulse_counter_reset ( pulse_counter_t dev)

Reset pulse counter value.

Parameters
[out]devdevice descriptor of sensor