upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Data Structures | Functions | Typedefs
Include dependency graph for ttp223.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 "ttp223.h"
#include "upm_utilities.h"
int main()
{
bool abc = 0;
while(1){
if(ttp223_is_pressed(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  _ttp223_context
 

Functions

ttp223_context ttp223_init (int pin)
 
void ttp223_close (ttp223_context dev)
 
upm_result_t ttp223_is_pressed (ttp223_context dev, bool *value)
 
upm_result_t ttp223_install_isr (ttp223_context dev, mraa_gpio_edge_t edge_level, void(*isr)(void *), void *arg)
 
upm_result_t ttp223_uninstall_isr (ttp223_context dev)
 

Typedefs

typedef struct _ttp223_contextttp223_context
 

Function Documentation

ttp223_context ttp223_init ( int  pin)

Sensor Init function

Parameters
pinThe pin number the sensor is attached to
Returns
void* pointer to the sensor struct
void ttp223_close ( ttp223_context  dev)

Sensor Module close function

Parameters
devpointer to the sensor struct
upm_result_t ttp223_is_pressed ( ttp223_context  dev,
bool *  value 
)

Function to tell if the sensor is pressed

Parameters
devpointer to the sensor struct
valuepointer to store whether the sensor is pressed or not
Returns
upm_result_t UPM success/error code

Here is the call graph for this function:

upm_result_t ttp223_install_isr ( ttp223_context  dev,
mraa_gpio_edge_t  edge_level,
void(*)(void *)  isr,
void *  arg 
)

Installs an interrupt service routine (ISR) to be called when the button is activated or deactivated.

Parameters
devpointer to the sensor struct
edge_levelone of mraa_gpio_edge_t values
isrpointer to a function to be called on interrupt
argpointer to an object to be supplied as an argument to the ISR.
Returns
upm_result_t UPM success/error code
upm_result_t ttp223_uninstall_isr ( ttp223_context  dev)

Uninstall a previously installed interrupt handler

Parameters
devpointer to the sensor struct
Returns
upm_result_t UPM success/error code

Here is the caller graph for this function:

Typedef Documentation

typedef struct _ttp223_context * ttp223_context

device context