Rev 56 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 56 | Rev 61 | ||
|---|---|---|---|
| Line 58... | Line 58... | ||
| 58 | uint32_t dev_endpoints; /*!< Device Endpoints number. |
58 | uint32_t dev_endpoints; /*!< Device Endpoints number. |
| 59 | This parameter depends on the used USB core. |
59 | This parameter depends on the used USB core. |
| 60 | This parameter must be a number between Min_Data = 1 and Max_Data = 15 */ |
60 | This parameter must be a number between Min_Data = 1 and Max_Data = 15 */ |
| 61 | 61 | ||
| 62 | uint32_t speed; /*!< USB Core speed. |
62 | uint32_t speed; /*!< USB Core speed. |
| 63 | This parameter can be any value of @ref USB_Core_Speed */ |
63 | This parameter can be any value of @ref PCD_Speed/HCD_Speed |
| - | 64 | (HCD_SPEED_xxx, HCD_SPEED_xxx) */ |
|
| 64 | 65 | ||
| 65 | uint32_t ep0_mps; /*!< Set the Endpoint 0 Max Packet size. */ |
66 | uint32_t ep0_mps; /*!< Set the Endpoint 0 Max Packet size. */ |
| 66 | 67 | ||
| 67 | uint32_t phy_itface; /*!< Select the used PHY interface. |
68 | uint32_t phy_itface; /*!< Select the used PHY interface. |
| 68 | This parameter can be any value of @ref USB_Core_PHY */ |
69 | This parameter can be any value of @ref PCD_PHY_Module/HCD_PHY_Module */ |
| 69 | 70 | ||
| 70 | uint32_t Sof_enable; /*!< Enable or disable the output of the SOF signal. */ |
71 | uint32_t Sof_enable; /*!< Enable or disable the output of the SOF signal. */ |
| 71 | 72 | ||
| 72 | uint32_t low_power_enable; /*!< Enable or disable Low Power mode */ |
73 | uint32_t low_power_enable; /*!< Enable or disable Low Power mode */ |
| 73 | 74 | ||
| Line 133... | Line 134... | ||
| 133 | 134 | ||
| 134 | 135 | ||
| 135 | /** @defgroup USB_LL_EP0_MPS USB Low Layer EP0 MPS |
136 | /** @defgroup USB_LL_EP0_MPS USB Low Layer EP0 MPS |
| 136 | * @{ |
137 | * @{ |
| 137 | */ |
138 | */ |
| 138 | #define EP_MPS_64 0U |
139 | #define EP_MPS_64 0U |
| 139 | #define EP_MPS_32 1U |
140 | #define EP_MPS_32 1U |
| 140 | #define EP_MPS_16 2U |
141 | #define EP_MPS_16 2U |
| 141 | #define EP_MPS_8 3U |
142 | #define EP_MPS_8 3U |
| 142 | /** |
143 | /** |
| 143 | * @} |
144 | * @} |
| 144 | */ |
145 | */ |
| 145 | 146 | ||
| 146 | /** @defgroup USB_LL_EP_Type USB Low Layer EP Type |
147 | /** @defgroup USB_LL_EP_Type USB Low Layer EP Type |
| Line 161... | Line 162... | ||
| 161 | #define USBD_FS_SPEED 2U |
162 | #define USBD_FS_SPEED 2U |
| 162 | /** |
163 | /** |
| 163 | * @} |
164 | * @} |
| 164 | */ |
165 | */ |
| 165 | 166 | ||
| 166 | #define BTABLE_ADDRESS 0x000U |
167 | #define BTABLE_ADDRESS 0x000U |
| 167 | #define PMA_ACCESS 2U |
168 | #define PMA_ACCESS 2U |
| 168 | 169 | ||
| 169 | #define EP_ADDR_MSK 0x7U |
170 | #define EP_ADDR_MSK 0x7U |
| 170 | /** |
171 | /** |
| 171 | * @} |
172 | * @} |
| 172 | */ |
173 | */ |
| 173 | 174 | ||
| 174 | /* Exported macro ------------------------------------------------------------*/ |
175 | /* Exported macro ------------------------------------------------------------*/ |
| Line 185... | Line 186... | ||
| 185 | HAL_StatusTypeDef USB_CoreInit(USB_TypeDef *USBx, USB_CfgTypeDef cfg); |
186 | HAL_StatusTypeDef USB_CoreInit(USB_TypeDef *USBx, USB_CfgTypeDef cfg); |
| 186 | HAL_StatusTypeDef USB_DevInit(USB_TypeDef *USBx, USB_CfgTypeDef cfg); |
187 | HAL_StatusTypeDef USB_DevInit(USB_TypeDef *USBx, USB_CfgTypeDef cfg); |
| 187 | HAL_StatusTypeDef USB_EnableGlobalInt(USB_TypeDef *USBx); |
188 | HAL_StatusTypeDef USB_EnableGlobalInt(USB_TypeDef *USBx); |
| 188 | HAL_StatusTypeDef USB_DisableGlobalInt(USB_TypeDef *USBx); |
189 | HAL_StatusTypeDef USB_DisableGlobalInt(USB_TypeDef *USBx); |
| 189 | HAL_StatusTypeDef USB_SetCurrentMode(USB_TypeDef *USBx, USB_ModeTypeDef mode); |
190 | HAL_StatusTypeDef USB_SetCurrentMode(USB_TypeDef *USBx, USB_ModeTypeDef mode); |
| 190 | HAL_StatusTypeDef USB_SetDevSpeed(USB_TypeDef *USBx, uint8_t speed); |
- | |
| - | 191 | ||
| 191 | HAL_StatusTypeDef USB_FlushRxFifo(USB_TypeDef *USBx); |
192 | #if defined (HAL_PCD_MODULE_ENABLED) |
| 192 | HAL_StatusTypeDef USB_FlushTxFifo(USB_TypeDef *USBx, uint32_t num); |
- | |
| 193 | HAL_StatusTypeDef USB_ActivateEndpoint(USB_TypeDef *USBx, USB_EPTypeDef *ep); |
193 | HAL_StatusTypeDef USB_ActivateEndpoint(USB_TypeDef *USBx, USB_EPTypeDef *ep); |
| 194 | HAL_StatusTypeDef USB_DeactivateEndpoint(USB_TypeDef *USBx, USB_EPTypeDef *ep); |
194 | HAL_StatusTypeDef USB_DeactivateEndpoint(USB_TypeDef *USBx, USB_EPTypeDef *ep); |
| 195 | HAL_StatusTypeDef USB_EPStartXfer(USB_TypeDef *USBx, USB_EPTypeDef *ep); |
195 | HAL_StatusTypeDef USB_EPStartXfer(USB_TypeDef *USBx, USB_EPTypeDef *ep); |
| 196 | HAL_StatusTypeDef USB_WritePacket(USB_TypeDef *USBx, uint8_t *src, uint8_t ch_ep_num, uint16_t len); |
- | |
| 197 | void *USB_ReadPacket(USB_TypeDef *USBx, uint8_t *dest, uint16_t len); |
- | |
| 198 | HAL_StatusTypeDef USB_EPSetStall(USB_TypeDef *USBx, USB_EPTypeDef *ep); |
196 | HAL_StatusTypeDef USB_EPSetStall(USB_TypeDef *USBx, USB_EPTypeDef *ep); |
| 199 | HAL_StatusTypeDef USB_EPClearStall(USB_TypeDef *USBx, USB_EPTypeDef *ep); |
197 | HAL_StatusTypeDef USB_EPClearStall(USB_TypeDef *USBx, USB_EPTypeDef *ep); |
| - | 198 | #endif |
|
| - | 199 | ||
| 200 | HAL_StatusTypeDef USB_SetDevAddress(USB_TypeDef *USBx, uint8_t address); |
200 | HAL_StatusTypeDef USB_SetDevAddress(USB_TypeDef *USBx, uint8_t address); |
| 201 | HAL_StatusTypeDef USB_DevConnect(USB_TypeDef *USBx); |
201 | HAL_StatusTypeDef USB_DevConnect(USB_TypeDef *USBx); |
| 202 | HAL_StatusTypeDef USB_DevDisconnect(USB_TypeDef *USBx); |
202 | HAL_StatusTypeDef USB_DevDisconnect(USB_TypeDef *USBx); |
| 203 | HAL_StatusTypeDef USB_StopDevice(USB_TypeDef *USBx); |
203 | HAL_StatusTypeDef USB_StopDevice(USB_TypeDef *USBx); |
| 204 | HAL_StatusTypeDef USB_EP0_OutStart(USB_TypeDef *USBx, uint8_t *psetup); |
- | |
| 205 | uint32_t USB_ReadInterrupts(USB_TypeDef *USBx); |
204 | uint32_t USB_ReadInterrupts(USB_TypeDef *USBx); |
| 206 | uint32_t USB_ReadDevAllOutEpInterrupt(USB_TypeDef *USBx); |
- | |
| 207 | uint32_t USB_ReadDevOutEPInterrupt(USB_TypeDef *USBx, uint8_t epnum); |
- | |
| 208 | uint32_t USB_ReadDevAllInEpInterrupt(USB_TypeDef *USBx); |
- | |
| 209 | uint32_t USB_ReadDevInEPInterrupt(USB_TypeDef *USBx, uint8_t epnum); |
- | |
| 210 | void USB_ClearInterrupts(USB_TypeDef *USBx, uint32_t interrupt); |
- | |
| 211 | - | ||
| 212 | HAL_StatusTypeDef USB_ActivateRemoteWakeup(USB_TypeDef *USBx); |
205 | HAL_StatusTypeDef USB_ActivateRemoteWakeup(USB_TypeDef *USBx); |
| 213 | HAL_StatusTypeDef USB_DeActivateRemoteWakeup(USB_TypeDef *USBx); |
206 | HAL_StatusTypeDef USB_DeActivateRemoteWakeup(USB_TypeDef *USBx); |
| - | 207 | ||
| - | 208 | void USB_WritePMA(USB_TypeDef *USBx, uint8_t *pbUsrBuf, |
|
| 214 | void USB_WritePMA(USB_TypeDef *USBx, uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes); |
209 | uint16_t wPMABufAddr, uint16_t wNBytes); |
| - | 210 | ||
| - | 211 | void USB_ReadPMA(USB_TypeDef *USBx, uint8_t *pbUsrBuf, |
|
| 215 | void USB_ReadPMA(USB_TypeDef *USBx, uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes); |
212 | uint16_t wPMABufAddr, uint16_t wNBytes); |
| 216 | 213 | ||
| 217 | /** |
214 | /** |
| 218 | * @} |
215 | * @} |
| 219 | */ |
216 | */ |
| 220 | 217 | ||