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