mraa  1.9.0
Low Level Skeleton Library for Communication on GNU/Linux platforms
Functions | Typedefs
led.h File Reference

API Description

LED is the Light Emitting Diode interface to libmraa. It is used to access the on board LED's via sysfs.

Go to the source code of this file.

Functions

mraa_led_context mraa_led_init (const char *led)
 
mraa_result_t mraa_led_set_brightness (mraa_led_context dev, int value)
 
int mraa_led_read_brightness (mraa_led_context dev)
 
int mraa_led_read_max_brightness (mraa_led_context dev)
 
mraa_result_t mraa_led_set_trigger (mraa_led_context dev, const char *trigger)
 
mraa_result_t mraa_led_clear_trigger (mraa_led_context dev)
 
mraa_result_t mraa_led_close (mraa_led_context dev)
 

Typedefs

typedef struct _led * mraa_led_context
 

Function Documentation

mraa_result_t mraa_led_clear_trigger ( mraa_led_context  dev)

Clear active LED trigger

Parameters
devLED context
Returns
Result of operation
mraa_result_t mraa_led_close ( mraa_led_context  dev)

Close LED file descriptors and free the context memory

Parameters
devLED context
Returns
Result of operation
mraa_led_context mraa_led_init ( const char *  led)

Initialise led_context, based on led function name. The structure of LED entry in sysfs is "devicename:colour:function" This api expects only one unique LED identifier which would be "function" name most often. For instance, mraa_led_init("user4");

Parameters
ledName of the LED
Returns
LED context or NULL
int mraa_led_read_brightness ( mraa_led_context  dev)

Read LED brightness

Parameters
devLED context
Returns
Brightness value
int mraa_led_read_max_brightness ( mraa_led_context  dev)

Read LED maximum brightness

Parameters
devLED context
Returns
Maximum brightness value
mraa_result_t mraa_led_set_brightness ( mraa_led_context  dev,
int  value 
)

Set LED brightness

Parameters
devLED context
valueInteger value to write
Returns
Result of operation
mraa_result_t mraa_led_set_trigger ( mraa_led_context  dev,
const char *  trigger 
)

Set LED trigger

Parameters
devLED context
triggerType of trigger to set
Returns
Result of operation

Typedef Documentation

typedef struct _led* mraa_led_context

Opaque pointer definition to the internal struct _led

Include dependency graph for led.h: