led - API for manipulating LED's, lamps and other annunciators
Fd typedef void led_t(void *priv, int onoff);
struct cdev *
led_create_state (led_t *func void *priv char const *name int state);
struct cdev *
led_create (led_t *func void *priv char const *name);
void
led_destroy (struct cdev *);
The hardware driver must supply a function to turn the annunciator on and off and the device Fa name of the annunciator relative to /dev/led/ The Fa priv argument is passed back to this on/off function and can be used however the hardware driver sees fit.
The lamp can be controlled by opening and writing ASCII strings to the /dev/led/bla device.
In the following, we will use this special notation to indicate the resulting output of the annunciator:
State can be set directly, and since the change happens immediately, it is possible to flash the annunciator with very short periods and synchronize it with program events. It should be noted that there is a non-trivial overhead, so this may not be usable for benchmarking or measuring short intervals.
Flashing can be set with a given period. The pattern continues endlessly.
Three high-level commands are available:
The sequence is repeated after a one second pause.
*__________*_*______________________________
A `sAaAbBa flashes '
*_*__**_
/usr/games/morse -l "Soekris rocks" > /dev/led/error
This manual page was written by An Sergey A. Osokin Aq osa@FreeBSD.org and An Poul-Henning Kamp Aq phk@FreeBSD.org .
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |