2007-08-27 16:04:32 +00:00
|
|
|
|
/***************************************************************************
|
|
|
|
|
* __________ __ ___.
|
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
|
* \/ \/ \/ \/ \/
|
2008-04-18 17:24:19 +00:00
|
|
|
|
* $Id$
|
2007-08-27 16:04:32 +00:00
|
|
|
|
*
|
2009-01-19 13:41:25 +00:00
|
|
|
|
* Copyright (C) 2007 by Bj<EFBFBD>rn Stenberg
|
2007-08-27 16:04:32 +00:00
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
2007-08-27 16:04:32 +00:00
|
|
|
|
*
|
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
|
* KIND, either express or implied.
|
|
|
|
|
*
|
|
|
|
|
****************************************************************************/
|
2007-11-22 20:51:00 +00:00
|
|
|
|
#ifndef USB_CORE_H
|
|
|
|
|
#define USB_CORE_H
|
2007-08-27 16:04:32 +00:00
|
|
|
|
|
2008-02-20 22:54:26 +00:00
|
|
|
|
#ifndef BOOTLOADER
|
|
|
|
|
|
2008-03-10 21:01:03 +00:00
|
|
|
|
//#define USB_SERIAL
|
2008-02-20 22:54:26 +00:00
|
|
|
|
#define USB_STORAGE
|
|
|
|
|
#define USB_CHARGING_ONLY
|
2008-02-27 19:08:30 +00:00
|
|
|
|
#else /* BOOTLOADER */
|
2008-02-20 22:54:26 +00:00
|
|
|
|
#define USB_CHARGING_ONLY
|
|
|
|
|
#endif /* BOOTLOADER */
|
|
|
|
|
|
2007-11-22 20:51:00 +00:00
|
|
|
|
#include "usb_ch9.h"
|
2008-02-27 19:08:30 +00:00
|
|
|
|
#include "usb.h"
|
2007-08-27 16:04:32 +00:00
|
|
|
|
|
2007-11-22 20:51:00 +00:00
|
|
|
|
/* endpoints */
|
2008-03-06 21:25:09 +00:00
|
|
|
|
#define EP_CONTROL 0
|
2007-11-22 20:51:00 +00:00
|
|
|
|
extern int usb_max_pkt_size;
|
|
|
|
|
|
2008-10-03 22:43:16 +00:00
|
|
|
|
struct usb_class_driver;
|
|
|
|
|
|
2007-11-22 20:51:00 +00:00
|
|
|
|
void usb_core_init(void);
|
|
|
|
|
void usb_core_exit(void);
|
|
|
|
|
void usb_core_control_request(struct usb_ctrlrequest* req);
|
2008-10-03 22:43:16 +00:00
|
|
|
|
void usb_core_transfer_complete(int endpoint, int dir, int status, int length);
|
2007-11-22 20:51:00 +00:00
|
|
|
|
void usb_core_bus_reset(void);
|
2009-01-13 16:27:35 +00:00
|
|
|
|
bool usb_core_any_exclusive_storage(void);
|
2008-03-06 21:25:09 +00:00
|
|
|
|
void usb_core_enable_driver(int driver,bool enabled);
|
|
|
|
|
bool usb_core_driver_enabled (int driver);
|
|
|
|
|
void usb_core_handle_transfer_completion(
|
|
|
|
|
struct usb_transfer_completion_event_data* event);
|
2008-04-26 19:02:16 +00:00
|
|
|
|
int usb_core_ack_control(struct usb_ctrlrequest* req);
|
2008-10-03 22:43:16 +00:00
|
|
|
|
|
|
|
|
|
int usb_core_request_endpoint(int dir, struct usb_class_driver *drv);
|
|
|
|
|
void usb_core_release_endpoint(int dir);
|
|
|
|
|
|
2008-03-10 20:55:24 +00:00
|
|
|
|
#ifdef HAVE_HOTSWAP
|
|
|
|
|
void usb_core_hotswap_event(int volume,bool inserted);
|
|
|
|
|
#endif
|
2008-06-04 18:55:58 +00:00
|
|
|
|
|
|
|
|
|
#ifdef HAVE_USB_POWER
|
|
|
|
|
unsigned short usb_allowed_current(void);
|
|
|
|
|
#endif
|
|
|
|
|
|
2007-11-22 20:51:00 +00:00
|
|
|
|
#endif
|
|
|
|
|
|