blob: 3500c7ae9613594f4cfeec15cdeb3c1cf15538eb [file] [log] [blame]
Tom Rixf298e4b2009-10-31 12:37:41 -05001/*
2 * Copyright (c) 2009 Wind River Systems, Inc.
3 * Tom Rix <Tom.Rix@windriver.com>
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Tom Rixf298e4b2009-10-31 12:37:41 -05006 */
7#ifndef __MUSB_UDC_H__
8#define __MUSB_UDC_H__
9
10#include <usbdevice.h>
11
12/* UDC level routines */
13void udc_irq(void);
14void udc_set_nak(int ep_num);
15void udc_unset_nak(int ep_num);
16int udc_endpoint_write(struct usb_endpoint_instance *endpoint);
17void udc_setup_ep(struct usb_device_instance *device, unsigned int id,
18 struct usb_endpoint_instance *endpoint);
19void udc_connect(void);
20void udc_disconnect(void);
21void udc_enable(struct usb_device_instance *device);
22void udc_disable(void);
23void udc_startup_events(struct usb_device_instance *device);
24int udc_init(void);
25
26/* usbtty */
27#ifdef CONFIG_USB_TTY
28
29#define EP0_MAX_PACKET_SIZE 64 /* MUSB_EP0_FIFOSIZE */
30#define UDC_INT_ENDPOINT 1
31#define UDC_INT_PACKET_SIZE 64
32#define UDC_OUT_ENDPOINT 2
33#define UDC_OUT_PACKET_SIZE 64
34#define UDC_IN_ENDPOINT 3
35#define UDC_IN_PACKET_SIZE 64
36#define UDC_BULK_PACKET_SIZE 64
37
38#endif /* CONFIG_USB_TTY */
39
40#endif /* __MUSB_UDC_H__ */