- Timestamp:
- Apr 30, 2016, 11:29:25 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rtos_arduino/trunk/arduino_lib/hardware/arduino/samd/cores/arduino/USB/USB_host.h
r136 r224 1 /* ---------------------------------------------------------------------------- 2 * SAM Software Package License 3 * ---------------------------------------------------------------------------- 4 * Copyright (c) 2011-2012, Atmel Corporation 5 * 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following condition is met: 10 * 11 * - Redistributions of source code must retain the above copyright notice, 12 * this list of conditions and the disclaimer below. 13 * 14 * Atmel's name may not be used to endorse or promote products derived from 15 * this software without specific prior written permission. 16 * 17 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 20 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 23 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * ---------------------------------------------------------------------------- 28 */ 1 /* 2 Copyright (c) 2014 Arduino LLC. All right reserved. 3 4 This library is free software; you can redistribute it and/or 5 modify it under the terms of the GNU Lesser General Public 6 License as published by the Free Software Foundation; either 7 version 2.1 of the License, or (at your option) any later version. 8 9 This library is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 See the GNU Lesser General Public License for more details. 13 14 You should have received a copy of the GNU Lesser General Public 15 License along with this library; if not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 */ 18 /* 19 **Modified 04/04/2016 by Arduino.org development team 20 */ 29 21 30 22 #ifndef USB_HOST_H_INCLUDED … … 32 24 33 25 #include <stdint.h> 34 26 #include "samd21_host.h" 35 27 #ifdef __cplusplus 36 28 extern "C" { 37 29 #endif 38 30 39 #define tokSETUP U OTGHS_HSTPIPCFG_PTOKEN_SETUP40 #define tokIN U OTGHS_HSTPIPCFG_PTOKEN_IN41 #define tokOUT U OTGHS_HSTPIPCFG_PTOKEN_OUT42 #define tokINHS U OTGHS_HSTPIPCFG_PTOKEN_IN43 #define tokOUTHS U OTGHS_HSTPIPCFG_PTOKEN_OUT31 #define tokSETUP USB_HOST_PCFG_PTOKEN_SETUP 32 #define tokIN USB_HOST_PCFG_PTOKEN_IN 33 #define tokOUT USB_HOST_PCFG_PTOKEN_OUT 34 #define tokINHS USB_HOST_PCFG_PTOKEN_IN 35 #define tokOUTHS USB_HOST_PCFG_PTOKEN_OUT 44 36 45 37 //! \brief Device speed … … 58 50 } uhd_vbus_state_t; 59 51 60 //extern uhd_speed_t uhd_get_speed(void);61 62 extern void UHD_SetStack(void (*pf_isr)(void));63 52 extern void UHD_Init(void); 64 extern void UHD_BusReset(void); 53 extern void UHD_Handler(void); 54 extern void USB_SetHandler(void (*pf_isr)(void)); 65 55 extern uhd_vbus_state_t UHD_GetVBUSState(void); 66 56 extern uint32_t UHD_Pipe0_Alloc(uint32_t ul_add, uint32_t ul_ep_size); 67 57 extern uint32_t UHD_Pipe_Alloc(uint32_t ul_dev_addr, uint32_t ul_dev_ep, uint32_t ul_type, uint32_t ul_dir, uint32_t ul_maxsize, uint32_t ul_interval, uint32_t ul_nb_bank); 58 extern void UHD_Pipe_CountZero(uint32_t ul_pipe); 68 59 extern void UHD_Pipe_Free(uint32_t ul_pipe); 69 60 extern uint32_t UHD_Pipe_Read(uint32_t ul_pipe, uint32_t ul_size, uint8_t* data);
Note:
See TracChangeset
for help on using the changeset viewer.