EFM32 Happy Gecko Software Documentation  efm32hg-doc-5.1.2
em_usbh.h
Go to the documentation of this file.
1 /***************************************************************************/
16 #ifndef __EM_USBH_H
17 #define __EM_USBH_H
18 
19 #include "em_device.h"
20 #if defined( USB_PRESENT ) && ( USB_COUNT == 1 )
21 #include "em_usb.h"
22 #if defined( USB_HOST )
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
30 extern USBH_Hc_TypeDef hcs[];
31 extern int USBH_attachRetryCount;
32 extern const USBH_AttachTiming_TypeDef USBH_attachTiming[];
33 extern USBH_Init_TypeDef USBH_initData;
34 extern volatile USBH_PortState_TypeDef USBH_portStatus;
35 
36 USB_Status_TypeDef USBH_CtlSendSetup( USBH_Ep_TypeDef *ep );
37 USB_Status_TypeDef USBH_CtlSendData( USBH_Ep_TypeDef *ep, uint16_t length );
38 USB_Status_TypeDef USBH_CtlReceiveData( USBH_Ep_TypeDef *ep, uint16_t length );
39 
40 #if defined( USB_RAW_API )
41 int USBH_CtlRxRaw( uint8_t pid, USBH_Ep_TypeDef *ep, void *data, int byteCount );
42 int USBH_CtlTxRaw( uint8_t pid, USBH_Ep_TypeDef *ep, void *data, int byteCount );
43 #endif
44 
45 void USBHEP_EpHandler( USBH_Ep_TypeDef *ep, USB_Status_TypeDef result );
46 void USBHEP_CtrlEpHandler( USBH_Ep_TypeDef *ep, USB_Status_TypeDef result );
47 void USBHEP_TransferDone( USBH_Ep_TypeDef *ep, USB_Status_TypeDef result );
48 
49 __STATIC_INLINE uint16_t USBH_GetFrameNum( void )
50 {
51  return USBHHAL_GetFrameNum();
52 }
53 
54 __STATIC_INLINE bool USBH_FrameNumIsEven( void )
55 {
56  return ( USBHHAL_GetFrameNum() & 1 ) == 0;
57 }
58 
61 #ifdef __cplusplus
62 }
63 #endif
64 
65 #endif /* defined( USB_HOST ) */
66 #endif /* defined( USB_PRESENT ) && ( USB_COUNT == 1 ) */
67 #endif /* __EM_USBH_H */
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
USB_Status_TypeDef
USB transfer status enumerator.
Definition: em_usb.h:319
USB protocol stack library API for EFM32/EZR32.