STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
Peripheral Control functions

management functions More...

Collaboration diagram for Peripheral Control functions:

Functions

HAL_StatusTypeDef HAL_PCD_DevConnect (PCD_HandleTypeDef *hpcd)
 Connect the USB device.
 
HAL_StatusTypeDef HAL_PCD_DevDisconnect (PCD_HandleTypeDef *hpcd)
 Disconnect the USB device.
 
HAL_StatusTypeDef HAL_PCD_SetAddress (PCD_HandleTypeDef *hpcd, uint8_t address)
 Set the USB Device address.
 
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.
 
HAL_StatusTypeDef HAL_PCD_EP_Close (PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
 Deactivate an endpoint.
 
HAL_StatusTypeDef HAL_PCD_EP_Receive (PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len)
 Receive an amount of data.
 
HAL_StatusTypeDef HAL_PCD_EP_Transmit (PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len)
 Send an amount of data.
 
HAL_StatusTypeDef HAL_PCD_EP_SetStall (PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
 Set a STALL condition over an endpoint.
 
HAL_StatusTypeDef HAL_PCD_EP_ClrStall (PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
 Clear a STALL condition over in an endpoint.
 
HAL_StatusTypeDef HAL_PCD_EP_Flush (PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
 Flush an endpoint.
 
HAL_StatusTypeDef HAL_PCD_EP_Abort (PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
 Abort an USB EP transaction.
 
HAL_StatusTypeDef HAL_PCD_ActivateRemoteWakeup (PCD_HandleTypeDef *hpcd)
 Activate remote wakeup signalling.
 
HAL_StatusTypeDef HAL_PCD_DeActivateRemoteWakeup (PCD_HandleTypeDef *hpcd)
 De-activate remote wakeup signalling.
 
HAL_StatusTypeDef HAL_PCD_SetTestMode (const PCD_HandleTypeDef *hpcd, uint8_t testmode)
 Set the USB Device high speed test mode.
 
uint32_t HAL_PCD_EP_GetRxCount (PCD_HandleTypeDef const *hpcd, uint8_t ep_addr)
 Get Received Data Size.
 

Detailed Description

management functions

 ===============================================================================
                      ##### Peripheral Control functions #####
 ===============================================================================
    [..]
    This subsection provides a set of functions allowing to control the PCD data
    transfers.

Function Documentation

◆ HAL_PCD_DevConnect()

HAL_StatusTypeDef HAL_PCD_DevConnect ( PCD_HandleTypeDef * hpcd)

#include <stm32f4xx_hal_pcd.h>

Connect the USB device.

Parameters
hpcdPCD handle
Return values
HALstatus

Definition at line 1749 of file stm32f4xx_hal_pcd.c.

References __HAL_LOCK, __HAL_UNLOCK, HAL_OK, PCD_HandleTypeDef::Init, and PCD_HandleTypeDef::Instance.

◆ HAL_PCD_DevDisconnect()

HAL_StatusTypeDef HAL_PCD_DevDisconnect ( PCD_HandleTypeDef * hpcd)

#include <stm32f4xx_hal_pcd.h>

Disconnect the USB device.

Parameters
hpcdPCD handle
Return values
HALstatus

Definition at line 1772 of file stm32f4xx_hal_pcd.c.

References __HAL_LOCK, __HAL_UNLOCK, HAL_OK, PCD_HandleTypeDef::Init, and PCD_HandleTypeDef::Instance.

◆ HAL_PCD_SetAddress()

HAL_StatusTypeDef HAL_PCD_SetAddress ( PCD_HandleTypeDef * hpcd,
uint8_t address )

#include <stm32f4xx_hal_pcd.h>

Set the USB Device address.

Parameters
hpcdPCD handle
addressnew device address
Return values
HALstatus

Definition at line 1797 of file stm32f4xx_hal_pcd.c.

References __HAL_LOCK, __HAL_UNLOCK, HAL_OK, PCD_HandleTypeDef::Instance, and PCD_HandleTypeDef::USB_Address.

◆ HAL_PCD_EP_Open()

HAL_StatusTypeDef HAL_PCD_EP_Open ( PCD_HandleTypeDef * hpcd,
uint8_t ep_addr,
uint16_t ep_mps,
uint8_t ep_type )

#include <stm32f4xx_hal_pcd.h>

Open and configure an endpoint.

Parameters
hpcdPCD handle
ep_addrendpoint address
ep_mpsendpoint max packet size
ep_typeendpoint type
Return values
HALstatus

Definition at line 1814 of file stm32f4xx_hal_pcd.c.

References __HAL_LOCK, __HAL_UNLOCK, HAL_OK, PCD_HandleTypeDef::IN_ep, PCD_HandleTypeDef::Instance, and PCD_HandleTypeDef::OUT_ep.

◆ HAL_PCD_EP_Close()

HAL_StatusTypeDef HAL_PCD_EP_Close ( PCD_HandleTypeDef * hpcd,
uint8_t ep_addr )

#include <stm32f4xx_hal_pcd.h>

Deactivate an endpoint.

Parameters
hpcdPCD handle
ep_addrendpoint address
Return values
HALstatus

Definition at line 1860 of file stm32f4xx_hal_pcd.c.

References __HAL_LOCK, __HAL_UNLOCK, HAL_OK, PCD_HandleTypeDef::IN_ep, PCD_HandleTypeDef::Instance, and PCD_HandleTypeDef::OUT_ep.

◆ HAL_PCD_EP_Receive()

HAL_StatusTypeDef HAL_PCD_EP_Receive ( PCD_HandleTypeDef * hpcd,
uint8_t ep_addr,
uint8_t * pBuf,
uint32_t len )

#include <stm32f4xx_hal_pcd.h>

Receive an amount of data.

Parameters
hpcdPCD handle
ep_addrendpoint address
pBufpointer to the reception buffer
lenamount of data to be received
Return values
HALstatus

Definition at line 1891 of file stm32f4xx_hal_pcd.c.

References HAL_OK, PCD_HandleTypeDef::Init, PCD_HandleTypeDef::Instance, and PCD_HandleTypeDef::OUT_ep.

◆ HAL_PCD_EP_Transmit()

HAL_StatusTypeDef HAL_PCD_EP_Transmit ( PCD_HandleTypeDef * hpcd,
uint8_t ep_addr,
uint8_t * pBuf,
uint32_t len )

#include <stm32f4xx_hal_pcd.h>

Send an amount of data.

Parameters
hpcdPCD handle
ep_addrendpoint address
pBufpointer to the transmission buffer
lenamount of data to be sent
Return values
HALstatus

Definition at line 1932 of file stm32f4xx_hal_pcd.c.

References HAL_OK, PCD_HandleTypeDef::IN_ep, PCD_HandleTypeDef::Init, and PCD_HandleTypeDef::Instance.

◆ HAL_PCD_EP_SetStall()

HAL_StatusTypeDef HAL_PCD_EP_SetStall ( PCD_HandleTypeDef * hpcd,
uint8_t ep_addr )

#include <stm32f4xx_hal_pcd.h>

Set a STALL condition over an endpoint.

Parameters
hpcdPCD handle
ep_addrendpoint address
Return values
HALstatus

Definition at line 1961 of file stm32f4xx_hal_pcd.c.

References __HAL_LOCK, __HAL_UNLOCK, HAL_ERROR, HAL_OK, PCD_HandleTypeDef::IN_ep, PCD_HandleTypeDef::Init, PCD_HandleTypeDef::Instance, PCD_HandleTypeDef::OUT_ep, and PCD_HandleTypeDef::Setup.

◆ HAL_PCD_EP_ClrStall()

HAL_StatusTypeDef HAL_PCD_EP_ClrStall ( PCD_HandleTypeDef * hpcd,
uint8_t ep_addr )

#include <stm32f4xx_hal_pcd.h>

Clear a STALL condition over in an endpoint.

Parameters
hpcdPCD handle
ep_addrendpoint address
Return values
HALstatus

Definition at line 2004 of file stm32f4xx_hal_pcd.c.

References __HAL_LOCK, __HAL_UNLOCK, HAL_ERROR, HAL_OK, PCD_HandleTypeDef::IN_ep, PCD_HandleTypeDef::Init, PCD_HandleTypeDef::Instance, and PCD_HandleTypeDef::OUT_ep.

◆ HAL_PCD_EP_Flush()

HAL_StatusTypeDef HAL_PCD_EP_Flush ( PCD_HandleTypeDef * hpcd,
uint8_t ep_addr )

#include <stm32f4xx_hal_pcd.h>

Flush an endpoint.

Parameters
hpcdPCD handle
ep_addrendpoint address
Return values
HALstatus

Definition at line 2066 of file stm32f4xx_hal_pcd.c.

References __HAL_LOCK, __HAL_UNLOCK, HAL_OK, and PCD_HandleTypeDef::Instance.

◆ HAL_PCD_EP_Abort()

HAL_StatusTypeDef HAL_PCD_EP_Abort ( PCD_HandleTypeDef * hpcd,
uint8_t ep_addr )

#include <stm32f4xx_hal_pcd.h>

Abort an USB EP transaction.

Parameters
hpcdPCD handle
ep_addrendpoint address
Return values
HALstatus

Definition at line 2040 of file stm32f4xx_hal_pcd.c.

References PCD_HandleTypeDef::IN_ep, PCD_HandleTypeDef::Instance, and PCD_HandleTypeDef::OUT_ep.

Referenced by HAL_PCD_IRQHandler().

◆ HAL_PCD_ActivateRemoteWakeup()

HAL_StatusTypeDef HAL_PCD_ActivateRemoteWakeup ( PCD_HandleTypeDef * hpcd)

#include <stm32f4xx_hal_pcd.h>

Activate remote wakeup signalling.

Parameters
hpcdPCD handle
Return values
HALstatus

Definition at line 2089 of file stm32f4xx_hal_pcd.c.

References PCD_HandleTypeDef::Instance.

◆ HAL_PCD_DeActivateRemoteWakeup()

HAL_StatusTypeDef HAL_PCD_DeActivateRemoteWakeup ( PCD_HandleTypeDef * hpcd)

#include <stm32f4xx_hal_pcd.h>

De-activate remote wakeup signalling.

Parameters
hpcdPCD handle
Return values
HALstatus

Definition at line 2099 of file stm32f4xx_hal_pcd.c.

References PCD_HandleTypeDef::Instance.

◆ HAL_PCD_SetTestMode()

HAL_StatusTypeDef HAL_PCD_SetTestMode ( const PCD_HandleTypeDef * hpcd,
uint8_t testmode )

#include <stm32f4xx_hal_pcd.h>

Set the USB Device high speed test mode.

Parameters
hpcdPCD handle
testmodeUSB Device high speed test mode
Return values
HALstatus

Definition at line 2140 of file stm32f4xx_hal_pcd.c.

References HAL_OK, and PCD_HandleTypeDef::Instance.

◆ HAL_PCD_EP_GetRxCount()

uint32_t HAL_PCD_EP_GetRxCount ( PCD_HandleTypeDef const * hpcd,
uint8_t ep_addr )

#include <stm32f4xx_hal_pcd.h>

Get Received Data Size.

Parameters
hpcdPCD handle
ep_addrendpoint address
Return values
DataSize

Definition at line 1920 of file stm32f4xx_hal_pcd.c.

References PCD_HandleTypeDef::OUT_ep.