blob: 3db82efd6a44877f94080071870c7f58bc241b25 [file] [log] [blame]
Björn Stenbergb4e51232007-11-22 20:51:00 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
Michael Sevakis3dcb4ff2008-04-18 17:24:19 +00008 * $Id$
Björn Stenbergb4e51232007-11-22 20:51:00 +00009 *
Nicolas Pennequin357ffb32008-05-05 10:32:46 +000010 * Copyright (C) 2007 by Björn Stenberg
Björn Stenbergb4e51232007-11-22 20:51:00 +000011 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * 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.
Björn Stenbergb4e51232007-11-22 20:51:00 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef ARCOTG_DRV_H
22#define ARCOTG_DRV_H
23#include "usb_ch9.h"
24#include "kernel.h"
25
Michael Sevakis9003dbe2008-04-20 03:30:57 +000026void usb_drv_startup(void);
Björn Stenbergb4e51232007-11-22 20:51:00 +000027void usb_drv_init(void);
28void usb_drv_exit(void);
29void usb_drv_int(void);
Frank Gevaerts07427592008-02-20 22:54:26 +000030void usb_drv_stall(int endpoint, bool stall,bool in);
31bool usb_drv_stalled(int endpoint,bool in);
Björn Stenberga0224592007-11-27 13:42:47 +000032int usb_drv_send(int endpoint, void* ptr, int length);
Frank Gevaerts07427592008-02-20 22:54:26 +000033int usb_drv_send_nonblocking(int endpoint, void* ptr, int length);
Björn Stenberga0224592007-11-27 13:42:47 +000034int usb_drv_recv(int endpoint, void* ptr, int length);
Björn Stenbergb4e51232007-11-22 20:51:00 +000035void usb_drv_ack(struct usb_ctrlrequest* req);
36void usb_drv_set_address(int address);
37void usb_drv_reset_endpoint(int endpoint, bool send);
38void usb_drv_wait(int endpoint, bool send);
Björn Stenberg7af22e12007-11-22 22:17:45 +000039bool usb_drv_powered(void);
Björn Stenberg2f7cffa2008-02-11 14:26:25 +000040int usb_drv_port_speed(void);
Frank Gevaerts07427592008-02-20 22:54:26 +000041void usb_drv_cancel_all_transfers(void);
Frank Gevaerts97d7f392008-02-26 18:02:26 +000042void usb_drv_set_test_mode(int mode);
Frank Gevaertsa6108b92008-03-20 20:01:28 +000043bool usb_drv_connected(void);
Björn Stenbergb4e51232007-11-22 20:51:00 +000044
45#endif