diff options
Diffstat (limited to 'firmware/export/usb.h')
-rw-r--r-- | firmware/export/usb.h | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/firmware/export/usb.h b/firmware/export/usb.h index 622db35543..82b9d36d4a 100644 --- a/firmware/export/usb.h +++ b/firmware/export/usb.h | |||
@@ -20,6 +20,41 @@ | |||
20 | #define _USB_H_ | 20 | #define _USB_H_ |
21 | 21 | ||
22 | #include "kernel.h" | 22 | #include "kernel.h" |
23 | #include "button.h" | ||
24 | |||
25 | /* Messages from usb_tick and thread states */ | ||
26 | #define USB_INSERTED 1 | ||
27 | #define USB_EXTRACTED 2 | ||
28 | #ifdef HAVE_MMC | ||
29 | #define USB_REENABLE 3 | ||
30 | #endif | ||
31 | |||
32 | #ifdef HAVE_USB_POWER | ||
33 | #define USB_POWERED 4 | ||
34 | |||
35 | #if CONFIG_KEYPAD == RECORDER_PAD | ||
36 | #define USBPOWER_BUTTON BUTTON_F1 | ||
37 | #define USBPOWER_BTN_IGNORE BUTTON_ON | ||
38 | #elif CONFIG_KEYPAD == ONDIO_PAD | ||
39 | #define USBPOWER_BUTTON BUTTON_MENU | ||
40 | #define USBPOWER_BTN_IGNORE BUTTON_OFF | ||
41 | #elif (CONFIG_KEYPAD == IPOD_4G_PAD) | ||
42 | #define USBPOWER_BUTTON BUTTON_MENU | ||
43 | #define USBPOWER_BTN_IGNORE BUTTON_PLAY | ||
44 | #elif CONFIG_KEYPAD == IRIVER_H300_PAD | ||
45 | #define USBPOWER_BUTTON BUTTON_REC | ||
46 | #define USBPOWER_BTN_IGNORE BUTTON_ON | ||
47 | #elif CONFIG_KEYPAD == GIGABEAT_PAD | ||
48 | #define USBPOWER_BUTTON BUTTON_MENU | ||
49 | #define USBPOWER_BTN_IGNORE BUTTON_POWER | ||
50 | #elif CONFIG_KEYPAD == IRIVER_H10_PAD | ||
51 | #define USBPOWER_BUTTON BUTTON_NONE | ||
52 | #define USBPOWER_BTN_IGNORE BUTTON_POWER | ||
53 | #elif CONFIG_KEYPAD == SANSA_E200_PAD | ||
54 | #define USBPOWER_BUTTON BUTTON_SELECT | ||
55 | #define USBPOWER_BTN_IGNORE BUTTON_POWER | ||
56 | #endif | ||
57 | #endif /* HAVE_USB_POWER */ | ||
23 | 58 | ||
24 | void usb_init(void); | 59 | void usb_init(void); |
25 | void usb_enable(bool on); | 60 | void usb_enable(bool on); |
@@ -28,7 +63,7 @@ void usb_acknowledge(long id); | |||
28 | void usb_wait_for_disconnect(struct event_queue *q); | 63 | void usb_wait_for_disconnect(struct event_queue *q); |
29 | int usb_wait_for_disconnect_w_tmo(struct event_queue *q, int ticks); | 64 | int usb_wait_for_disconnect_w_tmo(struct event_queue *q, int ticks); |
30 | bool usb_inserted(void); /* return the official value, what's been reported to the threads */ | 65 | bool usb_inserted(void); /* return the official value, what's been reported to the threads */ |
31 | bool usb_detect(void); /* return the raw hardware value */ | 66 | int usb_detect(void); /* return the raw hardware value - nothing/pc/charger */ |
32 | #ifdef HAVE_USB_POWER | 67 | #ifdef HAVE_USB_POWER |
33 | bool usb_powered(void); | 68 | bool usb_powered(void); |
34 | #ifdef CONFIG_CHARGING | 69 | #ifdef CONFIG_CHARGING |