diff options
Diffstat (limited to 'firmware/target/hosted/ibasso/sysfs-ibasso.h')
-rw-r--r-- | firmware/target/hosted/ibasso/sysfs-ibasso.h | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/firmware/target/hosted/ibasso/sysfs-ibasso.h b/firmware/target/hosted/ibasso/sysfs-ibasso.h new file mode 100644 index 0000000000..fec8a082f9 --- /dev/null +++ b/firmware/target/hosted/ibasso/sysfs-ibasso.h | |||
@@ -0,0 +1,111 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___ | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2014 by Ilia Sergachev: Initial Rockbox port to iBasso DX50 | ||
10 | * Copyright (C) 2014 by Mario Basister: iBasso DX90 port | ||
11 | * Copyright (C) 2014 by Simon Rothen: Initial Rockbox repository submission, additional features | ||
12 | * Copyright (C) 2014 by Udo Schläpfer: Code clean up, additional features | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or | ||
15 | * modify it under the terms of the GNU General Public License | ||
16 | * as published by the Free Software Foundation; either version 2 | ||
17 | * of the License, or (at your option) any later version. | ||
18 | * | ||
19 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
20 | * KIND, either express or implied. | ||
21 | * | ||
22 | ****************************************************************************/ | ||
23 | |||
24 | |||
25 | #ifndef _SYSFS_IBASSO_H_ | ||
26 | #define _SYSFS_IBASSO_H_ | ||
27 | |||
28 | |||
29 | #include <stdbool.h> | ||
30 | |||
31 | |||
32 | /* | ||
33 | Sys FS path identifiers. | ||
34 | See SYSFS_PATHS in sysfs-ibasso.c. | ||
35 | */ | ||
36 | enum sys_fs_interface_id | ||
37 | { | ||
38 | SYSFS_DX50_CODEC_VOLUME = 0, | ||
39 | SYSFS_HOLDKEY, | ||
40 | SYSFS_DX90_ES9018_VOLUME, | ||
41 | SYSFS_MUTE, | ||
42 | SYSFS_WM8740_MUTE, | ||
43 | SYSFS_BATTERY_CAPACITY, | ||
44 | SYSFS_BATTERY_CURRENT_NOW, | ||
45 | SYSFS_BATTERY_ENERGY_FULL_DESIGN, | ||
46 | SYSFS_BATTERY_HEALTH, | ||
47 | SYSFS_BATTERY_MODEL_NAME, | ||
48 | SYSFS_BATTERY_ONLINE, | ||
49 | SYSFS_BATTERY_PRESENT, | ||
50 | SYSFS_BATTERY_STATUS, | ||
51 | SYSFS_BATTERY_TECHNOLOGY, | ||
52 | SYSFS_BATTERY_TEMP, | ||
53 | SYSFS_BATTERY_TYPE, | ||
54 | SYSFS_BATTERY_VOLTAGE_MAX_DESIGN, | ||
55 | SYSFS_BATTERY_VOLTAGE_MIN_DESIGN, | ||
56 | SYSFS_BATTERY_VOLTAGE_NOW, | ||
57 | SYSFS_USB_POWER_CURRENT_NOW, | ||
58 | SYSFS_USB_POWER_ONLINE, | ||
59 | SYSFS_USB_POWER_PRESENT, | ||
60 | SYSFS_USB_POWER_VOLTAGE_NOW, | ||
61 | SYSFS_BACKLIGHT_POWER, | ||
62 | SYSFS_BACKLIGHT_BRIGHTNESS, | ||
63 | SYSFS_POWER_STATE, | ||
64 | SYSFS_POWER_WAKE_LOCK | ||
65 | }; | ||
66 | |||
67 | |||
68 | /* | ||
69 | Read a integer value from the sys fs interface given by id. | ||
70 | Returns true on success, false else. | ||
71 | */ | ||
72 | bool sysfs_get_int(enum sys_fs_interface_id id, int* value); | ||
73 | |||
74 | |||
75 | /* | ||
76 | Write a integer value to the sys fs interface given by id. | ||
77 | Returns true on success, false else. | ||
78 | */ | ||
79 | bool sysfs_set_int(enum sys_fs_interface_id id, int value); | ||
80 | |||
81 | |||
82 | /* | ||
83 | Read a char value from the sys fs interface given by id. | ||
84 | Returns true on success, false else. | ||
85 | */ | ||
86 | bool sysfs_get_char(enum sys_fs_interface_id id, char* value); | ||
87 | |||
88 | |||
89 | /* | ||
90 | Write a char value to the sys fs interface given by id. | ||
91 | Returns true on success, false else. | ||
92 | */ | ||
93 | bool sysfs_set_char(enum sys_fs_interface_id id, char value); | ||
94 | |||
95 | /* | ||
96 | Read a single line of text from the sys fs interface given by id. | ||
97 | A newline will be discarded. | ||
98 | size: The size of value. | ||
99 | Returns true on success, false else. | ||
100 | */ | ||
101 | bool sysfs_get_string(enum sys_fs_interface_id id, char* value, int size); | ||
102 | |||
103 | |||
104 | /* | ||
105 | Write text to the sys fs interface given by id. | ||
106 | Returns true on success, false else. | ||
107 | */ | ||
108 | bool sysfs_set_string(enum sys_fs_interface_id id, char* value); | ||
109 | |||
110 | |||
111 | #endif | ||