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

API Description

Go to the source code of this file.

Data Structures

struct  _ad8232_context
 

Functions

ad8232_context ad8232_init (int lo_plus, int lo_minus, int output, float a_ref)
 
void ad8232_close (ad8232_context dev)
 
upm_result_t ad8232_get_value (ad8232_context dev, int *value)
 

Macros

#define AD8232_DEFAULT_AREF   3.3
 

Typedefs

typedef struct _ad8232_contextad8232_context
 

Function Documentation

ad8232_context ad8232_init ( int  lo_plus,
int  lo_minus,
int  output,
float  a_ref 
)

Sensor init function

Parameters
lo_plusDigital pin to use for LO+
lo_minusDigital pin to use for LO-
outputAnalog pin to read the data
a_refAnalog voltage reference
void ad8232_close ( ad8232_context  dev)

Sensor destructor

upm_result_t ad8232_get_value ( ad8232_context  dev,
int *  value 
)

Returns the current ADC value for the device output pin. If an LO (leads off) event is detected, 0 is returned.

Parameters
devsensor context pointer
valueADC value
Returns
result status code

Typedef Documentation

typedef struct _ad8232_context * ad8232_context

device context