upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Data Structures | Functions | Typedefs
Include dependency graph for wfs.h:

Go to the source code of this file.

Data Structures

struct  _wfs_context
 

Functions

wfs_context wfs_init (int pin)
 
void wfs_close (wfs_context dev)
 
uint32_t wfs_get_millis (const wfs_context dev)
 
void wfs_init_clock (const wfs_context dev)
 
void wfs_clear_flow_counter (const wfs_context dev)
 
upm_result_t wfs_start_flow_counter (const wfs_context dev)
 
void wfs_stop_flow_counter (const wfs_context dev)
 
uint32_t wfs_flow_counter (const wfs_context dev)
 
float wfs_flow_rate (const wfs_context dev)
 

Typedefs

typedef struct _wfs_contextwfs_context
 

Function Documentation

wfs_context wfs_init ( int  pin)

Initialize a WFS device

Parameters
pinGPIO pin to use. This must be an interrupt capable pin.
Returns
Device context, or NULL on error

Here is the call graph for this function:

void wfs_close ( wfs_context  dev)

WFS close function

Parameters
devDevice context

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t wfs_get_millis ( const wfs_context  dev)

Returns the number of milliseconds elapsed since wfs_init_clock() was last called.

Parameters
devDevice context
Returns
Elapsed milliseconds

Here is the caller graph for this function:

void wfs_init_clock ( const wfs_context  dev)

Resets the clock

Parameters
devDevice context

Here is the caller graph for this function:

void wfs_clear_flow_counter ( const wfs_context  dev)

Resets the flow counter to 0. The flow counter should be stopped via stopFlowCounter() prior to calling this function.

Parameters
devDevice context

Here is the caller graph for this function:

upm_result_t wfs_start_flow_counter ( const wfs_context  dev)

Starts the flow counter

Parameters
devDevice context
Returns
UPM result

Here is the call graph for this function:

Here is the caller graph for this function:

void wfs_stop_flow_counter ( const wfs_context  dev)

Stops the flow counter

Parameters
devDevice context

Here is the caller graph for this function:

uint32_t wfs_flow_counter ( const wfs_context  dev)

Gets the flow counter

Parameters
devDevice context
Returns
Flow counter

Here is the caller graph for this function:

float wfs_flow_rate ( const wfs_context  dev)

Computes the flow rate in liters per minute (LPM). Note, this is for the Grove WFS. If you are using some other WFS, you should compute the flow rate on your own based on the data for your sensor.

Parameters
devDevice context
Returns
Computed flow rate in liters per minute

Here is the call graph for this function:

Here is the caller graph for this function:

Typedef Documentation

typedef struct _wfs_context * wfs_context

Device context