# __________ __ ___. # Open \______ \ ____ ____ | | _\_ |__ _______ ___ # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ # \/ \/ \/ \/ \/ # $Id$ # BITMAPDIR = $(ROOTDIR)/apps/bitmaps BMPINCDIR = $(BUILDDIR)/bitmaps INCLUDES += -I$(BMPINCDIR) ifneq ($(strip $(BMP2RB_MONO)),) BMP = $(call preprocess, $(BITMAPDIR)/mono/SOURCES) endif ifneq ($(strip $(BMP2RB_NATIVE)),) BMP += $(call preprocess, $(BITMAPDIR)/native/SOURCES) endif ifneq ($(strip $(BMP2RB_REMOTEMONO)),) BMP += $(call preprocess, $(BITMAPDIR)/remote_mono/SOURCES) endif ifneq ($(strip $(BMP2RB_REMOTENATIVE)),) BMP += $(call preprocess, $(BITMAPDIR)/remote_native/SOURCES) endif BMPOBJ = $(BMP:$(ROOTDIR)/%.bmp=$(BUILDDIR)/%.o) BMPHFILES = $(BMPINCDIR)/usblogo.h $(BMPINCDIR)/remote_usblogo.h \ $(BMPINCDIR)/default_icons.h $(BMPINCDIR)/remote_default_icons.h \ $(BMPINCDIR)/rockboxlogo.h $(BMPINCDIR)/remote_rockboxlogo.h $(BMPHFILES): $(BMPOBJ) # pattern rules to create .c files from .bmp, one for each subdir: $(BUILDDIR)/apps/bitmaps/mono/%.c: $(ROOTDIR)/apps/bitmaps/mono/%.bmp $(TOOLSDIR)/bmp2rb $(SILENT)mkdir -p $(dir $@) $(BMPINCDIR) $(call PRINTS,BMP2RB $( $@ $(BUILDDIR)/apps/bitmaps/native/%.c: $(ROOTDIR)/apps/bitmaps/native/%.bmp $(TOOLSDIR)/bmp2rb $(SILENT)mkdir -p $(dir $@) $(BMPINCDIR) $(call PRINTS,BMP2RB $( $@ $(BUILDDIR)/apps/bitmaps/remote_mono/%.c: $(ROOTDIR)/apps/bitmaps/remote_mono/%.bmp $(TOOLSDIR)/bmp2rb $(SILENT)mkdir -p $(dir $@) $(BMPINCDIR) $(call PRINTS,BMP2RB $( $@ $(BUILDDIR)/apps/bitmaps/remote_native/%.c: $(ROOTDIR)/apps/bitmaps/remote_native/%.bmp $(TOOLSDIR)/bmp2rb $(SILENT)mkdir -p $(dir $@) $(BMPINCDIR) $(call PRINTS,BMP2RB $( $@ /usb_class_driver.h'>
blob: a9bc759a5b34922379340236cf8c798777db244c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/***************************************************************************
 *             __________               __   ___.
 *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
 *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
 *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
 *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
 *                     \/            \/     \/    \/            \/
 * $Id$
 *
 * Copyright (C) 2008 Frank Gevaerts
 *
 * 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.
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 * KIND, either express or implied.
 *
 ****************************************************************************/

#ifndef _USB_CLASS_DRIVER_H_
#define _USB_CLASS_DRIVER_H_

/* Common api, implemented by all class drivers */

struct usb_class_driver {
    /* First some runtime data */
    bool enabled;
    int first_interface;
    int last_interface;

    /* Driver api starts here */

    /* Set this to true if the driver needs exclusive disk access (e.g. usb storage) */
    bool needs_exclusive_storage;

    /* Let the driver request endpoints it need. Returns zero on success */
    int (*request_endpoints)(struct usb_class_driver *);

    /* Tells the driver what its first interface number will be. The driver
       returns the number of the first available interface for the next driver
       (i.e. a driver with one interface will return interface+1)
	   A driver must have at least one interface
	   Mandatory function */
    int (*set_first_interface)(int interface);

    /* Asks the driver to put the interface descriptor and all other
       needed descriptor for this driver at dest.
       Returns the number of bytes taken by these descriptors.
	   Mandatory function */
    int (*get_config_descriptor)(unsigned char *dest, int max_packet_size);

    /* Tells the driver that a usb connection has been set up and is now
       ready to use.
	   Optional function */
    void (*init_connection)(void);

    /* Initialises the driver. This can be called multiple times,