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

API Description

//Modified: Abhishek Malik <abhishek.malik@intel.com>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "a110x.h"
#include "upm_utilities.h"
int main()
{
bool abc = 0;
while(1){
if(a110x_magnet_detected(dev, &abc) != UPM_SUCCESS){
printf("an error has occurred\n");
}
upm_delay(1);
printf("value retrieved: %d\n", abc);
}
return 0;
}

Go to the source code of this file.

Data Structures

struct  _a110x_context
 

Functions

a110x_context a110x_init (int pin)
 
void a110x_close (a110x_context dev)
 
upm_result_t a110x_magnet_detected (a110x_context dev, bool *res)
 
upm_result_t a110x_install_isr (a110x_context dev, mraa_gpio_edge_t edge_level, void(*isr)(void *), void *arg)
 
upm_result_t a110x_uninstall_isr (a110x_context dev)
 

Typedefs

typedef struct _a110x_contexta110x_context
 

Function Documentation

a110x_context a110x_init ( int  pin)

A110X Initialization function

Parameters
pinGPIO pin to use
Returns
device context pointer
void a110x_close ( a110x_context  dev)

A110X Initialization function

Parameters
deva110x_context pointer
upm_result_t a110x_magnet_detected ( a110x_context  dev,
bool *  res 
)

Determines whether a magnetic field of south polarity has been detected

Parameters
deva110x_context pointer
bool*to note the response
Returns
upm_result_t UPM success/error code
upm_result_t a110x_install_isr ( a110x_context  dev,
mraa_gpio_edge_t  edge_level,
void(*)(void *)  isr,
void *  arg 
)

Installs an interrupt service routine (ISR) to be called when the appropriate magnetic field is detected

Parameters
deva110x_context pointer
mraa_gpio_edge_tedge trigger level
isrISR callback function
Returns
upm_result_t UPM success/error code

Here is the call graph for this function:

upm_result_t a110x_uninstall_isr ( a110x_context  dev)

Uninstalls the previously installed ISR

Parameters
deva110x_context pointer
Returns
upm_result_t UPM success/error code

Here is the caller graph for this function:

Typedef Documentation

typedef struct _a110x_context * a110x_context

device context