Hossein Rahmani / USBDevice
Committer:
Kojto
Date:
Thu Jul 27 12:14:04 2017 +0100
Revision:
72:53949e6131f6
Update libraries

Fixes the previous commmit, as some devices were not copied. USBDevice contains
now targets directory with all targets implementations

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 72:53949e6131f6 1 /***************************************************************************//**
Kojto 72:53949e6131f6 2 * @file em_usbh.h
Kojto 72:53949e6131f6 3 * @brief USB protocol stack library API for EFM32.
Kojto 72:53949e6131f6 4 * @version 3.20.14
Kojto 72:53949e6131f6 5 *******************************************************************************
Kojto 72:53949e6131f6 6 * @section License
Kojto 72:53949e6131f6 7 * <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b>
Kojto 72:53949e6131f6 8 *******************************************************************************
Kojto 72:53949e6131f6 9 *
Kojto 72:53949e6131f6 10 * Licensed under the Apache License, Version 2.0 (the "License");
Kojto 72:53949e6131f6 11 * you may not use this file except in compliance with the License.
Kojto 72:53949e6131f6 12 * You may obtain a copy of the License at
Kojto 72:53949e6131f6 13 *
Kojto 72:53949e6131f6 14 * http://www.apache.org/licenses/LICENSE-2.0
Kojto 72:53949e6131f6 15 *
Kojto 72:53949e6131f6 16 * Unless required by applicable law or agreed to in writing, software
Kojto 72:53949e6131f6 17 * distributed under the License is distributed on an "AS IS" BASIS,
Kojto 72:53949e6131f6 18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Kojto 72:53949e6131f6 19 * See the License for the specific language governing permissions and
Kojto 72:53949e6131f6 20 * limitations under the License.
Kojto 72:53949e6131f6 21 *
Kojto 72:53949e6131f6 22 ******************************************************************************/
Kojto 72:53949e6131f6 23
Kojto 72:53949e6131f6 24 #ifndef __EM_USBH_H
Kojto 72:53949e6131f6 25 #define __EM_USBH_H
Kojto 72:53949e6131f6 26
Kojto 72:53949e6131f6 27 #include "em_device.h"
Kojto 72:53949e6131f6 28 #if defined( USB_PRESENT ) && ( USB_COUNT == 1 )
Kojto 72:53949e6131f6 29 #include "em_usb.h"
Kojto 72:53949e6131f6 30 #if defined( USB_HOST )
Kojto 72:53949e6131f6 31
Kojto 72:53949e6131f6 32 #ifdef __cplusplus
Kojto 72:53949e6131f6 33 extern "C" {
Kojto 72:53949e6131f6 34 #endif
Kojto 72:53949e6131f6 35
Kojto 72:53949e6131f6 36 /** @cond DO_NOT_INCLUDE_WITH_DOXYGEN */
Kojto 72:53949e6131f6 37
Kojto 72:53949e6131f6 38 extern USBH_Hc_TypeDef hcs[];
Kojto 72:53949e6131f6 39 extern int USBH_attachRetryCount;
Kojto 72:53949e6131f6 40 extern const USBH_AttachTiming_TypeDef USBH_attachTiming[];
Kojto 72:53949e6131f6 41 extern USBH_Init_TypeDef USBH_initData;
Kojto 72:53949e6131f6 42 extern volatile USBH_PortState_TypeDef USBH_portStatus;
Kojto 72:53949e6131f6 43
Kojto 72:53949e6131f6 44 USB_Status_TypeDef USBH_CtlSendSetup( USBH_Ep_TypeDef *ep );
Kojto 72:53949e6131f6 45 USB_Status_TypeDef USBH_CtlSendData( USBH_Ep_TypeDef *ep, uint16_t length );
Kojto 72:53949e6131f6 46 USB_Status_TypeDef USBH_CtlReceiveData( USBH_Ep_TypeDef *ep, uint16_t length );
Kojto 72:53949e6131f6 47
Kojto 72:53949e6131f6 48 #if defined( USB_RAW_API )
Kojto 72:53949e6131f6 49 int USBH_CtlRxRaw( uint8_t pid, USBH_Ep_TypeDef *ep, void *data, int byteCount );
Kojto 72:53949e6131f6 50 int USBH_CtlTxRaw( uint8_t pid, USBH_Ep_TypeDef *ep, void *data, int byteCount );
Kojto 72:53949e6131f6 51 #endif
Kojto 72:53949e6131f6 52
Kojto 72:53949e6131f6 53 void USBHEP_EpHandler( USBH_Ep_TypeDef *ep, USB_Status_TypeDef result );
Kojto 72:53949e6131f6 54 void USBHEP_CtrlEpHandler( USBH_Ep_TypeDef *ep, USB_Status_TypeDef result );
Kojto 72:53949e6131f6 55 void USBHEP_TransferDone( USBH_Ep_TypeDef *ep, USB_Status_TypeDef result );
Kojto 72:53949e6131f6 56
Kojto 72:53949e6131f6 57 __STATIC_INLINE uint16_t USBH_GetFrameNum( void )
Kojto 72:53949e6131f6 58 {
Kojto 72:53949e6131f6 59 return USBHHAL_GetFrameNum();
Kojto 72:53949e6131f6 60 }
Kojto 72:53949e6131f6 61
Kojto 72:53949e6131f6 62 __STATIC_INLINE bool USBH_FrameNumIsEven( void )
Kojto 72:53949e6131f6 63 {
Kojto 72:53949e6131f6 64 return ( USBHHAL_GetFrameNum() & 1 ) == 0;
Kojto 72:53949e6131f6 65 }
Kojto 72:53949e6131f6 66
Kojto 72:53949e6131f6 67 /** @endcond */
Kojto 72:53949e6131f6 68
Kojto 72:53949e6131f6 69 #ifdef __cplusplus
Kojto 72:53949e6131f6 70 }
Kojto 72:53949e6131f6 71 #endif
Kojto 72:53949e6131f6 72
Kojto 72:53949e6131f6 73 #endif /* defined( USB_HOST ) */
Kojto 72:53949e6131f6 74 #endif /* defined( USB_PRESENT ) && ( USB_COUNT == 1 ) */
Kojto 72:53949e6131f6 75 #endif /* __EM_USBH_H */