UVC host library

Dependents:   LifeCam WebcamServer

Committer:
va009039
Date:
Wed Aug 15 13:52:53 2012 +0000
Revision:
3:3eb41d749f9a
Parent:
0:b0f04c137829
add USB_USE_MALLOC

Who changed what in which revision?

UserRevisionLine numberNew contents of line
va009039 0:b0f04c137829 1 /*
va009039 0:b0f04c137829 2 Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com)
va009039 0:b0f04c137829 3
va009039 0:b0f04c137829 4 Permission is hereby granted, free of charge, to any person obtaining a copy
va009039 0:b0f04c137829 5 of this software and associated documentation files (the "Software"), to deal
va009039 0:b0f04c137829 6 in the Software without restriction, including without limitation the rights
va009039 0:b0f04c137829 7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
va009039 0:b0f04c137829 8 copies of the Software, and to permit persons to whom the Software is
va009039 0:b0f04c137829 9 furnished to do so, subject to the following conditions:
va009039 0:b0f04c137829 10
va009039 0:b0f04c137829 11 The above copyright notice and this permission notice shall be included in
va009039 0:b0f04c137829 12 all copies or substantial portions of the Software.
va009039 0:b0f04c137829 13
va009039 0:b0f04c137829 14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
va009039 0:b0f04c137829 15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
va009039 0:b0f04c137829 16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
va009039 0:b0f04c137829 17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
va009039 0:b0f04c137829 18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
va009039 0:b0f04c137829 19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
va009039 0:b0f04c137829 20 THE SOFTWARE.
va009039 0:b0f04c137829 21 */
va009039 0:b0f04c137829 22
va009039 0:b0f04c137829 23 #ifndef USB_MEM_H
va009039 0:b0f04c137829 24 #define USB_MEM_H
va009039 0:b0f04c137829 25
va009039 0:b0f04c137829 26 #ifdef __cplusplus
va009039 0:b0f04c137829 27 extern "C" {
va009039 0:b0f04c137829 28 #endif
va009039 0:b0f04c137829 29
va009039 0:b0f04c137829 30 typedef unsigned char byte;
va009039 0:b0f04c137829 31
va009039 0:b0f04c137829 32 void usb_mem_init();
va009039 0:b0f04c137829 33
va009039 0:b0f04c137829 34 volatile byte* usb_get_hcca();
va009039 0:b0f04c137829 35
va009039 0:b0f04c137829 36 volatile byte* usb_get_ed();
va009039 0:b0f04c137829 37
va009039 0:b0f04c137829 38 volatile byte* usb_get_td(uint32_t endpoint);
va009039 0:b0f04c137829 39 volatile byte* usb_get_itd(uint32_t endpoint);
va009039 0:b0f04c137829 40
va009039 0:b0f04c137829 41 volatile byte* usb_get_bp(int size);
va009039 0:b0f04c137829 42 int usb_bp_size();
va009039 0:b0f04c137829 43
va009039 0:b0f04c137829 44 void usb_free_ed(volatile byte* ed);
va009039 0:b0f04c137829 45
va009039 0:b0f04c137829 46 void usb_free_td(volatile byte* td);
va009039 0:b0f04c137829 47
va009039 0:b0f04c137829 48 void usb_free_itd(volatile byte* itd);
va009039 0:b0f04c137829 49
va009039 0:b0f04c137829 50 void usb_free_bp(volatile byte* bp);
va009039 0:b0f04c137829 51
va009039 0:b0f04c137829 52 bool usb_is_td(volatile byte* td);
va009039 0:b0f04c137829 53 bool usb_is_itd(volatile byte* td);
va009039 0:b0f04c137829 54
va009039 0:b0f04c137829 55 #ifdef __cplusplus
va009039 0:b0f04c137829 56 }
va009039 0:b0f04c137829 57 #endif
va009039 0:b0f04c137829 58
va009039 0:b0f04c137829 59 #endif