upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Data Structures | Functions | Typedefs
led.h File Reference
Include dependency graph for led.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 "led.h"
#include "upm_utilities.h"
int main(void)
{
while(1){
if(led_on(dev) != UPM_SUCCESS){
printf("problem turning the LED on\n");
}
upm_delay(1);
if(led_off(dev) != UPM_SUCCESS){
printf("problem turning the LED off\n");
}
upm_delay(1);
}
led_close(dev);
return 0;
}

Go to the source code of this file.

Data Structures

struct  _led_context
 

Functions

led_context led_init (int pin)
 
led_context led_init_str (const char *name)
 
void led_close (led_context dev)
 
upm_result_t led_on (led_context dev)
 
upm_result_t led_off (led_context dev)
 

Typedefs

typedef struct _led_contextled_context
 

Function Documentation

led_context led_init ( int  pin)

LED Initialization function

Parameters
pinGPIO pin to use
Returns
The sensor context

Here is the caller graph for this function:

led_context led_init_str ( const char *  name)

LED Initialization function

Parameters
nameLinux gpioled device to use
Returns
The sensor context

Here is the caller graph for this function:

void led_close ( led_context  dev)

LED Initialization function

Parameters
Thesensor context

Here is the caller graph for this function:

upm_result_t led_on ( led_context  dev)

Function to turn LED on

Parameters
Thesensor context
Returns
upm_result_t UPM success/error code

Here is the caller graph for this function:

upm_result_t led_off ( led_context  dev)

Function to turn LED off

Parameters
Thesensor context
Returns
upm_result_t UPM success/error code

Here is the caller graph for this function:

Typedef Documentation

typedef struct _led_context * led_context

device context