Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BSP_DISCO_F746NG_patch mbed-rtos mbed
usbh_conf.c File Reference
USB Host configuration file. More...
Go to the source code of this file.
Functions | |
| void | HAL_HCD_MspInit (HCD_HandleTypeDef *hhcd) |
| Initializes the HCD MSP. | |
| void | HAL_HCD_MspDeInit (HCD_HandleTypeDef *hhcd) |
| DeInitializes the HCD MSP. | |
| void | HAL_HCD_SOF_Callback (HCD_HandleTypeDef *hhcd) |
| SOF callback. | |
| void | HAL_HCD_Connect_Callback (HCD_HandleTypeDef *hhcd) |
| Connect callback. | |
| void | HAL_HCD_Disconnect_Callback (HCD_HandleTypeDef *hhcd) |
| Disconnect callback. | |
| void | HAL_HCD_HC_NotifyURBChange_Callback (HCD_HandleTypeDef *hhcd, uint8_t chnum, HCD_URBStateTypeDef urb_state) |
| Notify URB state change callback. | |
| USBH_StatusTypeDef | USBH_LL_Init (USBH_HandleTypeDef *phost) |
| Initializes the Low Level portion of the Host driver. | |
| USBH_StatusTypeDef | USBH_LL_DeInit (USBH_HandleTypeDef *phost) |
| De-Initializes the Low Level portion of the Host driver. | |
| USBH_StatusTypeDef | USBH_LL_Start (USBH_HandleTypeDef *phost) |
| Starts the Low Level portion of the Host driver. | |
| USBH_StatusTypeDef | USBH_LL_Stop (USBH_HandleTypeDef *phost) |
| Stops the Low Level portion of the Host driver. | |
| USBH_SpeedTypeDef | USBH_LL_GetSpeed (USBH_HandleTypeDef *phost) |
| Returns the USB Host Speed from the Low Level Driver. | |
| USBH_StatusTypeDef | USBH_LL_ResetPort (USBH_HandleTypeDef *phost) |
| Resets the Host Port of the Low Level Driver. | |
| uint32_t | USBH_LL_GetLastXferSize (USBH_HandleTypeDef *phost, uint8_t pipe) |
| Returns the last transfered packet size. | |
| USBH_StatusTypeDef | USBH_LL_OpenPipe (USBH_HandleTypeDef *phost, uint8_t pipe, uint8_t epnum, uint8_t dev_address, uint8_t speed, uint8_t ep_type, uint16_t mps) |
| Opens a pipe of the Low Level Driver. | |
| USBH_StatusTypeDef | USBH_LL_ClosePipe (USBH_HandleTypeDef *phost, uint8_t pipe) |
| Closes a pipe of the Low Level Driver. | |
| USBH_StatusTypeDef | USBH_LL_SubmitURB (USBH_HandleTypeDef *phost, uint8_t pipe, uint8_t direction, uint8_t ep_type, uint8_t token, uint8_t *pbuff, uint16_t length, uint8_t do_ping) |
| Submits a new URB to the low level driver. | |
| USBH_URBStateTypeDef | USBH_LL_GetURBState (USBH_HandleTypeDef *phost, uint8_t pipe) |
| Gets a URB state from the low level driver. | |
| USBH_StatusTypeDef | USBH_LL_DriverVBUS (USBH_HandleTypeDef *phost, uint8_t state) |
| Drives VBUS. | |
| USBH_StatusTypeDef | USBH_LL_SetToggle (USBH_HandleTypeDef *phost, uint8_t pipe, uint8_t toggle) |
| Sets toggle for a pipe. | |
| uint8_t | USBH_LL_GetToggle (USBH_HandleTypeDef *phost, uint8_t pipe) |
| Returns the current toggle of a pipe. | |
| void | USBH_Delay (uint32_t Delay) |
| Delay routine for the USB Host Library. | |
Detailed Description
USB Host configuration file.
- Version:
- V1.1.0
- Date:
- 21-September-2015
- Attention:
© COPYRIGHT(c) 2015 STMicroelectronics
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file usbh_conf.c.
Function Documentation
| void HAL_HCD_Connect_Callback | ( | HCD_HandleTypeDef * | hhcd ) |
Connect callback.
- Parameters:
-
hhcd,: HCD handle
- Return values:
-
None
Definition at line 150 of file usbh_conf.c.
| void HAL_HCD_Disconnect_Callback | ( | HCD_HandleTypeDef * | hhcd ) |
Disconnect callback.
- Parameters:
-
hhcd,: HCD handle
- Return values:
-
None
Definition at line 163 of file usbh_conf.c.
| void HAL_HCD_HC_NotifyURBChange_Callback | ( | HCD_HandleTypeDef * | hhcd, |
| uint8_t | chnum, | ||
| HCD_URBStateTypeDef | urb_state | ||
| ) |
Notify URB state change callback.
- Parameters:
-
hhcd,: HCD handle chnum,: Channel number urb_state,: URB State
- Return values:
-
None
Definition at line 176 of file usbh_conf.c.
| void HAL_HCD_MspDeInit | ( | HCD_HandleTypeDef * | hhcd ) |
DeInitializes the HCD MSP.
- Parameters:
-
hhcd,: HCD handle
- Return values:
-
None
Definition at line 124 of file usbh_conf.c.
| void HAL_HCD_MspInit | ( | HCD_HandleTypeDef * | hhcd ) |
Initializes the HCD MSP.
- Parameters:
-
hhcd,: HCD handle
- Return values:
-
None
Definition at line 52 of file usbh_conf.c.
| void HAL_HCD_SOF_Callback | ( | HCD_HandleTypeDef * | hhcd ) |
SOF callback.
- Parameters:
-
hhcd,: HCD handle
- Return values:
-
None
Definition at line 140 of file usbh_conf.c.
| void USBH_Delay | ( | uint32_t | Delay ) |
Delay routine for the USB Host Library.
- Parameters:
-
Delay,: Delay in ms
- Return values:
-
None
Definition at line 471 of file usbh_conf.c.
| USBH_StatusTypeDef USBH_LL_ClosePipe | ( | USBH_HandleTypeDef * | phost, |
| uint8_t | pipe | ||
| ) |
Closes a pipe of the Low Level Driver.
- Parameters:
-
phost,: Host handle pipe,: Pipe index
- Return values:
-
USBH Status
Definition at line 337 of file usbh_conf.c.
| USBH_StatusTypeDef USBH_LL_DeInit | ( | USBH_HandleTypeDef * | phost ) |
De-Initializes the Low Level portion of the Host driver.
- Parameters:
-
phost,: Host handle
- Return values:
-
USBH Status
Definition at line 222 of file usbh_conf.c.
| USBH_StatusTypeDef USBH_LL_DriverVBUS | ( | USBH_HandleTypeDef * | phost, |
| uint8_t | state | ||
| ) |
Drives VBUS.
- Parameters:
-
phost,: Host handle state,: VBUS state This parameter can be one of these values: 0: VBUS Active 1: VBUS Inactive
- Return values:
-
USBH Status
Definition at line 418 of file usbh_conf.c.
| uint32_t USBH_LL_GetLastXferSize | ( | USBH_HandleTypeDef * | phost, |
| uint8_t | pipe | ||
| ) |
Returns the last transfered packet size.
- Parameters:
-
phost,: Host handle pipe,: Pipe index
- Return values:
-
Packet Size
Definition at line 297 of file usbh_conf.c.
| USBH_SpeedTypeDef USBH_LL_GetSpeed | ( | USBH_HandleTypeDef * | phost ) |
Returns the USB Host Speed from the Low Level Driver.
- Parameters:
-
phost,: Host handle
- Return values:
-
USBH Speeds
Definition at line 255 of file usbh_conf.c.
| uint8_t USBH_LL_GetToggle | ( | USBH_HandleTypeDef * | phost, |
| uint8_t | pipe | ||
| ) |
Returns the current toggle of a pipe.
- Parameters:
-
phost,: Host handle pipe,: Pipe index
- Return values:
-
toggle (0/1)
Definition at line 451 of file usbh_conf.c.
| USBH_URBStateTypeDef USBH_LL_GetURBState | ( | USBH_HandleTypeDef * | phost, |
| uint8_t | pipe | ||
| ) |
Gets a URB state from the low level driver.
- Parameters:
-
phost,: Host handle pipe,: Pipe index This parameter can be a value from 1 to 15
- Return values:
-
URB state This parameter can be one of these values: - URB_IDLE
- URB_DONE
- URB_NOTREADY
- URB_NYET
- URB_ERROR
- URB_STALL
Definition at line 404 of file usbh_conf.c.
| USBH_StatusTypeDef USBH_LL_Init | ( | USBH_HandleTypeDef * | phost ) |
Initializes the Low Level portion of the Host driver.
- Parameters:
-
phost,: Host handle
- Return values:
-
USBH Status
Definition at line 192 of file usbh_conf.c.
| USBH_StatusTypeDef USBH_LL_OpenPipe | ( | USBH_HandleTypeDef * | phost, |
| uint8_t | pipe, | ||
| uint8_t | epnum, | ||
| uint8_t | dev_address, | ||
| uint8_t | speed, | ||
| uint8_t | ep_type, | ||
| uint16_t | mps | ||
| ) |
Opens a pipe of the Low Level Driver.
- Parameters:
-
phost,: Host handle pipe,: Pipe index epnum,: Endpoint Number dev_address,: Device USB address speed,: Device Speed ep_type,: Endpoint Type mps,: Endpoint Max Packet Size
- Return values:
-
USBH Status
Definition at line 313 of file usbh_conf.c.
| USBH_StatusTypeDef USBH_LL_ResetPort | ( | USBH_HandleTypeDef * | phost ) |
Resets the Host Port of the Low Level Driver.
- Parameters:
-
phost,: Host handle
- Return values:
-
USBH Status
Definition at line 285 of file usbh_conf.c.
| USBH_StatusTypeDef USBH_LL_SetToggle | ( | USBH_HandleTypeDef * | phost, |
| uint8_t | pipe, | ||
| uint8_t | toggle | ||
| ) |
Sets toggle for a pipe.
- Parameters:
-
phost,: Host handle pipe,: Pipe index toggle,: toggle (0/1)
- Return values:
-
USBH Status
Definition at line 432 of file usbh_conf.c.
| USBH_StatusTypeDef USBH_LL_Start | ( | USBH_HandleTypeDef * | phost ) |
Starts the Low Level portion of the Host driver.
- Parameters:
-
phost,: Host handle
- Return values:
-
USBH Status
Definition at line 233 of file usbh_conf.c.
| USBH_StatusTypeDef USBH_LL_Stop | ( | USBH_HandleTypeDef * | phost ) |
Stops the Low Level portion of the Host driver.
- Parameters:
-
phost,: Host handle
- Return values:
-
USBH Status
Definition at line 244 of file usbh_conf.c.
| USBH_StatusTypeDef USBH_LL_SubmitURB | ( | USBH_HandleTypeDef * | phost, |
| uint8_t | pipe, | ||
| uint8_t | direction, | ||
| uint8_t | ep_type, | ||
| uint8_t | token, | ||
| uint8_t * | pbuff, | ||
| uint16_t | length, | ||
| uint8_t | do_ping | ||
| ) |
Submits a new URB to the low level driver.
- Parameters:
-
phost,: Host handle pipe,: Pipe index This parameter can be a value from 1 to 15 direction,: Channel number This parameter can be one of these values: 0: Output 1: Input ep_type,: Endpoint Type This parameter can be one of these values: - EP_TYPE_CTRL: Control type
- EP_TYPE_ISOC: Isochrounous type
- EP_TYPE_BULK: Bulk type
- EP_TYPE_INTR: Interrupt type
token,: Endpoint Type This parameter can be one of these values: - 0: PID_SETUP
- 1: PID_DATA
pbuff,: pointer to URB data length,: length of URB data do_ping,: activate do ping protocol (for high speed only) This parameter can be one of these values: 0: do ping inactive 1: do ping active
- Return values:
-
USBH Status
Definition at line 370 of file usbh_conf.c.
Generated on Tue Jul 12 2022 14:58:32 by
1.7.2