STM32L4xx_HAL_Driver  1.14.0
stm32l4xx_hal_pcd.c File Reference

PCD HAL module driver. This file provides firmware functions to manage the following functionalities of the USB Peripheral Controller: More...

Go to the source code of this file.

Functions

static HAL_StatusTypeDef PCD_WriteEmptyTxFifo (PCD_HandleTypeDef *hpcd, uint32_t epnum)
 Check FIFO for the next packet to be loaded. More...
 
static HAL_StatusTypeDef PCD_EP_OutXfrComplete_int (PCD_HandleTypeDef *hpcd, uint32_t epnum)
 process EP OUT transfer complete interrupt. More...
 
static HAL_StatusTypeDef PCD_EP_OutSetupPacket_int (PCD_HandleTypeDef *hpcd, uint32_t epnum)
 process EP OUT setup packet received interrupt. More...
 
static HAL_StatusTypeDef PCD_EP_ISR_Handler (PCD_HandleTypeDef *hpcd)
 This function handles PCD Endpoint interrupt request. More...
 
HAL_StatusTypeDef HAL_PCD_Init (PCD_HandleTypeDef *hpcd)
 Initializes the PCD according to the specified parameters in the PCD_InitTypeDef and initialize the associated handle. More...
 
HAL_StatusTypeDef HAL_PCD_DeInit (PCD_HandleTypeDef *hpcd)
 DeInitializes the PCD peripheral. More...
 
void HAL_PCD_MspInit (PCD_HandleTypeDef *hpcd)
 Initializes the PCD MSP. More...
 
void HAL_PCD_MspDeInit (PCD_HandleTypeDef *hpcd)
 DeInitializes PCD MSP. More...
 
HAL_StatusTypeDef HAL_PCD_RegisterCallback (PCD_HandleTypeDef *hpcd, HAL_PCD_CallbackIDTypeDef CallbackID, pPCD_CallbackTypeDef pCallback)
 Register a User USB PCD Callback To be used instead of the weak predefined callback. More...
 
HAL_StatusTypeDef HAL_PCD_UnRegisterCallback (PCD_HandleTypeDef *hpcd, HAL_PCD_CallbackIDTypeDef CallbackID)
 Unregister an USB PCD Callback USB PCD callabck is redirected to the weak predefined callback. More...
 
HAL_StatusTypeDef HAL_PCD_RegisterDataOutStageCallback (PCD_HandleTypeDef *hpcd, pPCD_DataOutStageCallbackTypeDef pCallback)
 Register USB PCD Data OUT Stage Callback To be used instead of the weak HAL_PCD_DataOutStageCallback() predefined callback. More...
 
HAL_StatusTypeDef HAL_PCD_UnRegisterDataOutStageCallback (PCD_HandleTypeDef *hpcd)
 UnRegister the USB PCD Data OUT Stage Callback USB PCD Data OUT Stage Callback is redirected to the weak HAL_PCD_DataOutStageCallback() predefined callback. More...
 
HAL_StatusTypeDef HAL_PCD_RegisterDataInStageCallback (PCD_HandleTypeDef *hpcd, pPCD_DataInStageCallbackTypeDef pCallback)
 Register USB PCD Data IN Stage Callback To be used instead of the weak HAL_PCD_DataInStageCallback() predefined callback. More...
 
HAL_StatusTypeDef HAL_PCD_UnRegisterDataInStageCallback (PCD_HandleTypeDef *hpcd)
 UnRegister the USB PCD Data IN Stage Callback USB PCD Data OUT Stage Callback is redirected to the weak HAL_PCD_DataInStageCallback() predefined callback. More...
 
HAL_StatusTypeDef HAL_PCD_RegisterIsoOutIncpltCallback (PCD_HandleTypeDef *hpcd, pPCD_IsoOutIncpltCallbackTypeDef pCallback)
 Register USB PCD Iso OUT incomplete Callback To be used instead of the weak HAL_PCD_ISOOUTIncompleteCallback() predefined callback. More...
 
HAL_StatusTypeDef HAL_PCD_UnRegisterIsoOutIncpltCallback (PCD_HandleTypeDef *hpcd)
 UnRegister the USB PCD Iso OUT incomplete Callback USB PCD Iso OUT incomplete Callback is redirected to the weak HAL_PCD_ISOOUTIncompleteCallback() predefined callback. More...
 
HAL_StatusTypeDef HAL_PCD_RegisterIsoInIncpltCallback (PCD_HandleTypeDef *hpcd, pPCD_IsoInIncpltCallbackTypeDef pCallback)
 Register USB PCD Iso IN incomplete Callback To be used instead of the weak HAL_PCD_ISOINIncompleteCallback() predefined callback. More...
 
HAL_StatusTypeDef HAL_PCD_UnRegisterIsoInIncpltCallback (PCD_HandleTypeDef *hpcd)
 UnRegister the USB PCD Iso IN incomplete Callback USB PCD Iso IN incomplete Callback is redirected to the weak HAL_PCD_ISOINIncompleteCallback() predefined callback. More...
 
HAL_StatusTypeDef HAL_PCD_RegisterBcdCallback (PCD_HandleTypeDef *hpcd, pPCD_BcdCallbackTypeDef pCallback)
 Register USB PCD BCD Callback To be used instead of the weak HAL_PCDEx_BCD_Callback() predefined callback. More...
 
HAL_StatusTypeDef HAL_PCD_UnRegisterBcdCallback (PCD_HandleTypeDef *hpcd)
 UnRegister the USB PCD BCD Callback USB BCD Callback is redirected to the weak HAL_PCDEx_BCD_Callback() predefined callback. More...
 
HAL_StatusTypeDef HAL_PCD_RegisterLpmCallback (PCD_HandleTypeDef *hpcd, pPCD_LpmCallbackTypeDef pCallback)
 Register USB PCD LPM Callback To be used instead of the weak HAL_PCDEx_LPM_Callback() predefined callback. More...
 
HAL_StatusTypeDef HAL_PCD_UnRegisterLpmCallback (PCD_HandleTypeDef *hpcd)
 UnRegister the USB PCD LPM Callback USB LPM Callback is redirected to the weak HAL_PCDEx_LPM_Callback() predefined callback. More...
 
HAL_StatusTypeDef HAL_PCD_Start (PCD_HandleTypeDef *hpcd)
 Start the USB device. More...
 
HAL_StatusTypeDef HAL_PCD_Stop (PCD_HandleTypeDef *hpcd)
 Stop the USB device. More...
 
void HAL_PCD_IRQHandler (PCD_HandleTypeDef *hpcd)
 Handles PCD interrupt request. More...
 
void HAL_PCD_DataOutStageCallback (PCD_HandleTypeDef *hpcd, uint8_t epnum)
 Data OUT stage callback. More...
 
void HAL_PCD_DataInStageCallback (PCD_HandleTypeDef *hpcd, uint8_t epnum)
 Data IN stage callback. More...
 
void HAL_PCD_SetupStageCallback (PCD_HandleTypeDef *hpcd)
 Setup stage callback. More...
 
void HAL_PCD_SOFCallback (PCD_HandleTypeDef *hpcd)
 USB Start Of Frame callback. More...
 
void HAL_PCD_ResetCallback (PCD_HandleTypeDef *hpcd)
 USB Reset callback. More...
 
void HAL_PCD_SuspendCallback (PCD_HandleTypeDef *hpcd)
 Suspend event callback. More...
 
void HAL_PCD_ResumeCallback (PCD_HandleTypeDef *hpcd)
 Resume event callback. More...
 
void HAL_PCD_ISOOUTIncompleteCallback (PCD_HandleTypeDef *hpcd, uint8_t epnum)
 Incomplete ISO OUT callback. More...
 
void HAL_PCD_ISOINIncompleteCallback (PCD_HandleTypeDef *hpcd, uint8_t epnum)
 Incomplete ISO IN callback. More...
 
void HAL_PCD_ConnectCallback (PCD_HandleTypeDef *hpcd)
 Connection event callback. More...
 
void HAL_PCD_DisconnectCallback (PCD_HandleTypeDef *hpcd)
 Disconnection event callback. More...
 
HAL_StatusTypeDef HAL_PCD_DevConnect (PCD_HandleTypeDef *hpcd)
 Connect the USB device. More...
 
HAL_StatusTypeDef HAL_PCD_DevDisconnect (PCD_HandleTypeDef *hpcd)
 Disconnect the USB device. More...
 
HAL_StatusTypeDef HAL_PCD_SetAddress (PCD_HandleTypeDef *hpcd, uint8_t address)
 Set the USB Device address. More...
 
HAL_StatusTypeDef HAL_PCD_EP_Open (PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint16_t ep_mps, uint8_t ep_type)
 Open and configure an endpoint. More...
 
HAL_StatusTypeDef HAL_PCD_EP_Close (PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
 Deactivate an endpoint. More...
 
HAL_StatusTypeDef HAL_PCD_EP_Receive (PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len)
 Receive an amount of data. More...
 
uint32_t HAL_PCD_EP_GetRxCount (PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
 Get Received Data Size. More...
 
HAL_StatusTypeDef HAL_PCD_EP_Transmit (PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len)
 Send an amount of data. More...
 
HAL_StatusTypeDef HAL_PCD_EP_SetStall (PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
 Set a STALL condition over an endpoint. More...
 
HAL_StatusTypeDef HAL_PCD_EP_ClrStall (PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
 Clear a STALL condition over in an endpoint. More...
 
HAL_StatusTypeDef HAL_PCD_EP_Flush (PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
 Flush an endpoint. More...
 
HAL_StatusTypeDef HAL_PCD_ActivateRemoteWakeup (PCD_HandleTypeDef *hpcd)
 Activate remote wakeup signalling. More...
 
HAL_StatusTypeDef HAL_PCD_DeActivateRemoteWakeup (PCD_HandleTypeDef *hpcd)
 De-activate remote wakeup signalling. More...
 
PCD_StateTypeDef HAL_PCD_GetState (PCD_HandleTypeDef *hpcd)
 Return the PCD handle state. More...
 

Detailed Description

PCD HAL module driver. This file provides firmware functions to manage the following functionalities of the USB Peripheral Controller:

Author
MCD Application Team
  • Initialization and de-initialization functions
  • IO operation functions
  • Peripheral Control functions
  • Peripheral State functions
==============================================================================
                  ##### How to use this driver #####
==============================================================================
  [..]
    The PCD HAL driver can be used as follows:

   (#) Declare a PCD_HandleTypeDef handle structure, for example:
       PCD_HandleTypeDef  hpcd;

   (#) Fill parameters of Init structure in HCD handle

   (#) Call HAL_PCD_Init() API to initialize the PCD peripheral (Core, Device core, ...)

   (#) Initialize the PCD low level resources through the HAL_PCD_MspInit() API:
       (##) Enable the PCD/USB Low Level interface clock using
            (+++) __HAL_RCC_USB_CLK_ENABLE(); For USB Device only FS peripheral

       (##) Initialize the related GPIO clocks
       (##) Configure PCD pin-out
       (##) Configure PCD NVIC interrupt

   (#)Associate the Upper USB device stack to the HAL PCD Driver:
       (##) hpcd.pData = pdev;

   (#)Enable PCD transmission and reception:
       (##) HAL_PCD_Start();
Attention

© Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32l4xx_hal_pcd.c.