ARMEBS4  revision-26.06.2015
usb_hcd_int.h
1 #include "heivs/config.h"
2 #if (USE_STM32_USB_HOST_MODE || USE_STM32_USB_USE_DEVICE_MODE || USE_STM32_USB_OTG_MODE)
3 /**
4  ******************************************************************************
5  * @file usb_hcd_int.h
6  * @author MCD Application Team
7  * @version V2.1.0
8  * @date 19-March-2012
9  * @brief Peripheral Device Interface Layer
10  ******************************************************************************
11  * @attention
12  *
13  * <h2><center>&copy; COPYRIGHT 2012 STMicroelectronics</center></h2>
14  *
15  * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
16  * You may not use this file except in compliance with the License.
17  * You may obtain a copy of the License at:
18  *
19  * http://www.st.com/software_license_agreement_liberty_v2
20  *
21  * Unless required by applicable law or agreed to in writing, software
22  * distributed under the License is distributed on an "AS IS" BASIS,
23  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24  * See the License for the specific language governing permissions and
25  * limitations under the License.
26  *
27  ******************************************************************************
28  */
29 
30 /* Define to prevent recursive inclusion -------------------------------------*/
31 #ifndef __HCD_INT_H__
32 #define __HCD_INT_H__
33 
34 /* Includes ------------------------------------------------------------------*/
35 #include "stm32/usb/usb_hcd.h"
36 
37 
38 /** @addtogroup USB_OTG_DRIVER
39  * @{
40  */
41 
42 /** @defgroup USB_HCD_INT
43  * @brief This file is the
44  * @{
45  */
46 
47 
48 /** @defgroup USB_HCD_INT_Exported_Defines
49  * @{
50  */
51 /**
52  * @}
53  */
54 
55 
56 /** @defgroup USB_HCD_INT_Exported_Types
57  * @{
58  */
59 
60 typedef struct _USBH_HCD_INT
61 {
62  uint8_t (* SOF) (USB_OTG_CORE_HANDLE *pdev);
63  uint8_t (* DevConnected) (USB_OTG_CORE_HANDLE *pdev);
64  uint8_t (* DevDisconnected) (USB_OTG_CORE_HANDLE *pdev);
65 
66 }USBH_HCD_INT_cb_TypeDef;
67 
68 extern USBH_HCD_INT_cb_TypeDef *USBH_HCD_INT_fops;
69 /**
70  * @}
71  */
72 
73 
74 /** @defgroup USB_HCD_INT_Exported_Macros
75  * @{
76  */
77 
78 #define CLEAR_HC_INT(HC_REGS, intr) \
79  {\
80  USB_OTG_HCINTn_TypeDef hcint_clear; \
81  hcint_clear.d32 = 0; \
82  hcint_clear.b.intr = 1; \
83  USB_OTG_WRITE_REG32(&((HC_REGS)->HCINT), hcint_clear.d32);\
84  }\
85 
86 #define MASK_HOST_INT_CHH(hc_num) { USB_OTG_HCINTMSK_TypeDef INTMSK; \
87  INTMSK.d32 = USB_OTG_READ_REG32(&pdev->regs.HC_REGS[hc_num]->HCINTMSK); \
88  INTMSK.b.chhltd = 0; \
89  USB_OTG_WRITE_REG32(&pdev->regs.HC_REGS[hc_num]->HCINTMSK, INTMSK.d32);}
90 
91 #define UNMASK_HOST_INT_CHH(hc_num) { USB_OTG_HCINTMSK_TypeDef INTMSK; \
92  INTMSK.d32 = USB_OTG_READ_REG32(&pdev->regs.HC_REGS[hc_num]->HCINTMSK); \
93  INTMSK.b.chhltd = 1; \
94  USB_OTG_WRITE_REG32(&pdev->regs.HC_REGS[hc_num]->HCINTMSK, INTMSK.d32);}
95 
96 #define MASK_HOST_INT_ACK(hc_num) { USB_OTG_HCINTMSK_TypeDef INTMSK; \
97  INTMSK.d32 = USB_OTG_READ_REG32(&pdev->regs.HC_REGS[hc_num]->HCINTMSK); \
98  INTMSK.b.ack = 0; \
99  USB_OTG_WRITE_REG32(&pdev->regs.HC_REGS[hc_num]->HCINTMSK, GINTMSK.d32);}
100 
101 #define UNMASK_HOST_INT_ACK(hc_num) { USB_OTG_HCGINTMSK_TypeDef INTMSK; \
102  INTMSK.d32 = USB_OTG_READ_REG32(&pdev->regs.HC_REGS[hc_num]->HCINTMSK); \
103  INTMSK.b.ack = 1; \
104  USB_OTG_WRITE_REG32(&pdev->regs.HC_REGS[hc_num]->HCINTMSK, INTMSK.d32);}
105 
106 /**
107  * @}
108  */
109 
110 /** @defgroup USB_HCD_INT_Exported_Variables
111  * @{
112  */
113 /**
114  * @}
115  */
116 
117 /** @defgroup USB_HCD_INT_Exported_FunctionsPrototype
118  * @{
119  */
120 /* Callbacks handler */
121 void ConnectCallback_Handler(USB_OTG_CORE_HANDLE *pdev);
122 void Disconnect_Callback_Handler(USB_OTG_CORE_HANDLE *pdev);
123 void Overcurrent_Callback_Handler(USB_OTG_CORE_HANDLE *pdev);
124 uint32_t USBH_OTG_ISR_Handler (USB_OTG_CORE_HANDLE *pdev);
125 
126 /**
127  * @}
128  */
129 
130 
131 
132 #endif //__HCD_INT_H__
133 
134 
135 /**
136  * @}
137  */
138 
139 /**
140  * @}
141  */
142 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
143 #endif /* (USE_STM32_USB_HOST_MODE || USE_STM32_USB_USE_DEVICE_MODE || USE_STM32_USB_OTG_MODE) */
libheivs configuration file