d03e75686222b792f890d56e1449a66232c08720
[svn42.git] / old-door-deamon / libparportled-0.5.1 / README
1 libparportled - 0.1.1
2 -------------------
3 This library is intended to control a LED device plugged on parallel port.
4 A such device is composed of a number of LED (default is 8, maybe more is
5 possible, I don't know) plugged on parallel port.
6
7 Author
8 ------
9 Julien Danjou <julien@jdanjou.org>
10 http://jdanjou.org/libparportled/
11
12 Usage
13 -----
14 gcc option: -lparportled
15 #include <parportled.h>
16
17 MAXLED is defined as the number of LED available.
18 (--with-maxled= in configure option)
19
20 BASEPORT is the IO address of parallel port
21 (--with-port= in configure option)
22
23 Functions available are:
24
25 int led_setperm();
26 Initialise the parallel port, MUST be root !
27 Return -1 on error.
28
29 void led_on_all();
30 Turn all LED on.
31
32 void led_off_all();
33 Turn all LED off.
34
35 int led_on(int led);
36 Turn LED number "led" on.
37
38 int led_off(int led);
39 Turn LED number "led" off.
40
41 int led_set_on(int *state);
42 State must be a int vector. If value is > 0, LED will be turned on.
43
44 int led_set_off(int *state);
45 Do the inverse of led_set().
46
47 int led_blink_on(int led, int us_time);
48 Start blinking LED number "led". us_time is the time in microsecond of
49 the state changement.
50 This function starts a new thread.
51 Please note that all LED are blinking with in a same interval, the first
52 us_time is used.
53 If you do:
54 led_blink_on(1, 10000);
55 led_blink_on(2, 2000);
56 10000 will be used for ALL blinking LED.
57
58 int led_blink_off(int led);
59 Stop blinking LED number led.
60 If no more led are blinking, thread exits.