Functions
Initialization and de-initialization functions
Peripheral Driver » HAL Driver » USB » Functions

Initialization and de-initializations functions. More...

Collaboration diagram for Initialization and de-initialization functions:

## Functions
hal_status_t | hal_usb_init (usb_handle_t *p_usb)
| Initialize the USB according to the specified parameters in the usb_init_t and initialize the associated handle. More...
hal_status_t | hal_usb_deinit (usb_handle_t *p_usb)
| De-initialize the USB peripheral. More...
void | hal_usb_msp_init (usb_handle_t *p_usb)
| Initialize the USB MSP. More...
void | hal_usb_msp_deinit (usb_handle_t *p_usb)
| De-initialize the USB MSP. More...

## Detailed Description

Initialization and de-initializations functions.

     ===============================================================================
                  ##### Initialization and de-initialization functions #####
     ===============================================================================
        [..]  This subsection provides a set of functions allowing to initialize and
              de-initialize the USBx peripheral:

          (+) User must implement hal_usb_msp_init() function in which he configures
              all related peripherals resources (GPIO, DMA, IT and NVIC ).

          (+) Call the function hal_usb_init() to configure the selected device with
              the selected configuration:
            (++) Data Size
            (++) Clock Polarity
            (++) Audio Frequency

          (+) Call the function hal_usb_deinit() to restore the default configuration
              of the selected USBx peripheral.

## Function Documentation

## ◆ hal_usb_deinit()

hal_status_t hal_usb_deinit | ( | usb_handle_t * | p_usb | ) |

De-initialize the USB peripheral.

Parameters

  [in] | p_usb | Pointer to an USB handle which contains the configuration information for the specified USB module.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_usb_init()

hal_status_t hal_usb_init | ( | usb_handle_t * | p_usb | ) |

Initialize the USB according to the specified parameters in the usb_init_t and initialize the associated handle.

Parameters

  [in] | p_usb | Pointer to an USB handle which contains the configuration information for the specified USB module.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_usb_msp_deinit()

void hal_usb_msp_deinit | ( | usb_handle_t * | p_usb | ) |

De-initialize the USB MSP.

Note
  This function should not be modified. When the callback is needed, the hal_usb_msp_deinit can be implemented in the user file.

Parameters

  [in] | p_usb | Pointer to an USB handle which contains the configuration information for the specified USB module.

## ◆ hal_usb_msp_init()

void hal_usb_msp_init | ( | usb_handle_t * | p_usb | ) |

Initialize the USB MSP.

Note
  This function should not be modified. When the callback is needed, the hal_usb_msp_deinit can be implemented in the user file.

Parameters

  [in] | p_usb | Pointer to an USB handle which contains the configuration information for the specified USB module.