Colour targets: Revert an optimisation from almost 18 months ago that actually turned...
[Rockbox.git] / firmware / export / usb_core.h
blob6aada543990265f684fcde2ad11db42f2569afe5
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2007 by Björn Stenberg
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #ifndef USB_CORE_H
22 #define USB_CORE_H
24 #ifndef BOOTLOADER
26 //#define USB_SERIAL
27 #define USB_STORAGE
28 #define USB_CHARGING_ONLY
29 #else /* BOOTLOADER */
30 #define USB_CHARGING_ONLY
31 #endif /* BOOTLOADER */
33 #include "usb_ch9.h"
34 #include "usb.h"
36 /* endpoints */
37 #define EP_CONTROL 0
38 #if CONFIG_CPU == IMX31L
39 #define NUM_ENDPOINTS 8
40 #define USBDEVBSS_ATTR DEVBSS_ATTR
41 #else
42 #define USBDEVBSS_ATTR IBSS_ATTR
43 #define NUM_ENDPOINTS 3
44 #endif
46 extern int usb_max_pkt_size;
48 void usb_core_init(void);
49 void usb_core_exit(void);
50 void usb_core_control_request(struct usb_ctrlrequest* req);
51 void usb_core_transfer_complete(int endpoint, bool in, int status, int length);
52 void usb_core_bus_reset(void);
53 bool usb_core_exclusive_connection(void);
54 void usb_core_enable_driver(int driver,bool enabled);
55 bool usb_core_driver_enabled (int driver);
56 void usb_core_handle_transfer_completion(
57 struct usb_transfer_completion_event_data* event);
58 int usb_core_ack_control(struct usb_ctrlrequest* req);
59 #ifdef HAVE_HOTSWAP
60 void usb_core_hotswap_event(int volume,bool inserted);
61 #endif
63 #ifdef HAVE_USB_POWER
64 unsigned short usb_allowed_current(void);
65 #endif
67 #endif