Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
41 | ligi | 1 | /* x52pro driver library |
2 | * Copyright (C) 2007 Eduard Hasenleithner <eduard@hasenleithner.at> |
||
3 | * Licensed under the LGPL. Please see "COPYING". |
||
4 | */ |
||
5 | struct x52; |
||
6 | |||
7 | #define X52PRO_LED_FIRE 1 /* RED/GREEN LED of Fire Button */ |
||
8 | #define X52PRO_LED_ARED 2 /* RED LED of A Button */ |
||
9 | #define X52PRO_LED_AGREEN 3 /* GREEN LED of A Button */ |
||
10 | #define X52PRO_LED_BRED 4 /* RED LED of B Button */ |
||
11 | #define X52PRO_LED_BGREEN 5 /* GREEN LED of B Button */ |
||
12 | #define X52PRO_LED_DRED 6 /* RED LED of D Button */ |
||
13 | #define X52PRO_LED_DGREEN 7 /* GREEN LED of D Button */ |
||
14 | #define X52PRO_LED_ERED 8 /* RED LED of E Button */ |
||
15 | #define X52PRO_LED_EGREEN 9 /* GREEN LED of E Button */ |
||
16 | #define X52PRO_LED_T1RED 10 /* RED LED of T1 Switch */ |
||
17 | #define X52PRO_LED_T1GREEN 11 /* GREEN LED of T1 Switch */ |
||
18 | #define X52PRO_LED_T2RED 12 /* RED LED of T2 Switch */ |
||
19 | #define X52PRO_LED_T2GREEN 13 /* GREEN LED of T2 Switch */ |
||
20 | #define X52PRO_LED_T3RED 14 /* RED LED of T3 Switch */ |
||
21 | #define X52PRO_LED_T3GREEN 15 /* GREEN LED of T3 Switch */ |
||
22 | #define X52PRO_LED_CORED 16 /* RED LED of Coolie Hat */ |
||
23 | #define X52PRO_LED_COGREEN 17 /* GREEN LED of Coolie Hat */ |
||
24 | #define X52PRO_LED_IRED 18 /* RED LED of i Button */ |
||
25 | #define X52PRO_LED_IGREEN 19 /* GREEN LED of i Button */ |
||
26 | |||
27 | /* Init function |
||
28 | * RETURN: handle to x52 if device opened successful */ |
||
29 | struct x52* x52_init(void); |
||
30 | |||
31 | /* Close function |
||
32 | * hdl: handle to xte device */ |
||
33 | void x52_close(struct x52* hdl); |
||
34 | |||
35 | /* Set the text of the MFD |
||
36 | * RETURN: 0 if successful |
||
37 | * hdl: handle to x52 device |
||
38 | * line: line of text to change |
||
39 | * text: character string of new text |
||
40 | * length: number of characters in string */ |
||
41 | int x52_settext(struct x52 *hdl, int line, char *text, int length); |
||
42 | |||
43 | /* Set the brightness of the MFD or the LEDs |
||
44 | * RETURN: 0 if successful |
||
45 | * hdl: handle to x52 device |
||
46 | * mfd: boolean |
||
47 | * 0: change the LED brightness |
||
48 | * 1: change the MFD brightness |
||
49 | * brightness: value (0-127) */ |
||
50 | int x52_setbri(struct x52 *hdl, int mfd, int brightness); |
||
51 | |||
52 | /* Set or clear one of the LEDs |
||
53 | * RETURN: 0 if successful |
||
54 | * hdl: handle to x52 device |
||
55 | * led: led index (1-19), see X52PRO_LED_XXX defines |
||
56 | * on: boolean */ |
||
57 | int x52_setled(struct x52 *hdl, int led, int on); |
||
58 | |||
59 | /* Set the MFD display time |
||
60 | * RETURN: 0 if successful |
||
61 | * hdl: handle to x52 device |
||
62 | * h24: boolean, 24h output (1=on, 0=off) |
||
63 | * hour: value (0-23) |
||
64 | * minute: value (0-60) */ |
||
65 | int x52_settime(struct x52 *hdl, int h24, int hour, int minute); |
||
66 | |||
67 | /* Set the MFD display date |
||
68 | * RETURN: 0 if successful |
||
69 | * year: value (0-99) |
||
70 | * month: value (1-12) |
||
71 | * day: value (1-31) */ |
||
72 | int x52_setdate(struct x52 *hdl, int year, int month, int day); |
||
73 |