mraa
2.0.0
Low Level Skeleton Library for Communication on GNU/Linux platforms
|
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 (int led) |
mraa_led_context | mraa_led_init_raw (const char *led_dev) |
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 |
mraa_led_context mraa_led_init | ( | int | led | ) |
Initialise led_context, based on led index.
led | ID of the LED |
mraa_led_context mraa_led_init_raw | ( | const char * | led_dev | ) |
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_raw("user4");
led_dev | Name of the LED device |
mraa_result_t mraa_led_set_brightness | ( | mraa_led_context | dev, |
int | value | ||
) |
Set LED brightness
dev | LED context |
value | Integer value to write |
int mraa_led_read_brightness | ( | mraa_led_context | dev | ) |
Read LED brightness
dev | LED context |
int mraa_led_read_max_brightness | ( | mraa_led_context | dev | ) |
Read LED maximum brightness
dev | LED context |
mraa_result_t mraa_led_set_trigger | ( | mraa_led_context | dev, |
const char * | trigger | ||
) |
Set LED trigger
dev | LED context |
trigger | Type of trigger to set |
mraa_result_t mraa_led_clear_trigger | ( | mraa_led_context | dev | ) |
Clear active LED trigger
dev | LED context |
mraa_result_t mraa_led_close | ( | mraa_led_context | dev | ) |
Close LED file descriptors and free the context memory
dev | LED context |
typedef struct _led* mraa_led_context |
Opaque pointer definition to the internal struct _led