ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
Loading...
Searching...
No Matches
usbd_conf.c File Reference

Low-level glue between the ST USB device library and the HAL PCD driver of the STM32WB55 (USB FS device, PA11/PA12). More...

#include "usbd_conf.h"
#include "usbd_core.h"
#include "usbd_cdc.h"
#include "hw_conf.h"
#include "stm32wbxx_ll_crs.h"
#include "stm32wbxx_ll_rcc.h"
#include "stm32wbxx_ll_hsem.h"
#include "stm32wbxx_ll_bus.h"
Include dependency graph for usbd_conf.c:

Go to the source code of this file.

Functions

static void clk48_on (void)
 
void HAL_PCD_MspInit (PCD_HandleTypeDef *pcd)
 
void HAL_PCD_MspDeInit (PCD_HandleTypeDef *pcd)
 
void USB_LP_IRQHandler (void)
 
void HAL_PCD_SetupStageCallback (PCD_HandleTypeDef *pcd)
 
void HAL_PCD_DataOutStageCallback (PCD_HandleTypeDef *pcd, uint8_t ep)
 
void HAL_PCD_DataInStageCallback (PCD_HandleTypeDef *pcd, uint8_t ep)
 
void HAL_PCD_SOFCallback (PCD_HandleTypeDef *pcd)
 
void HAL_PCD_ResetCallback (PCD_HandleTypeDef *pcd)
 
void HAL_PCD_SuspendCallback (PCD_HandleTypeDef *pcd)
 
void HAL_PCD_ResumeCallback (PCD_HandleTypeDef *pcd)
 
void HAL_PCD_ISOOUTIncompleteCallback (PCD_HandleTypeDef *pcd, uint8_t ep)
 
void HAL_PCD_ISOINIncompleteCallback (PCD_HandleTypeDef *pcd, uint8_t ep)
 
void HAL_PCD_ConnectCallback (PCD_HandleTypeDef *pcd)
 
void HAL_PCD_DisconnectCallback (PCD_HandleTypeDef *pcd)
 
static USBD_StatusTypeDef st (HAL_StatusTypeDef h)
 
USBD_StatusTypeDef USBD_LL_Init (USBD_HandleTypeDef *pdev)
 
USBD_StatusTypeDef USBD_LL_DeInit (USBD_HandleTypeDef *pdev)
 
USBD_StatusTypeDef USBD_LL_Start (USBD_HandleTypeDef *pdev)
 
USBD_StatusTypeDef USBD_LL_Stop (USBD_HandleTypeDef *pdev)
 
USBD_StatusTypeDef USBD_LL_OpenEP (USBD_HandleTypeDef *pdev, uint8_t ep, uint8_t type, uint16_t mps)
 
USBD_StatusTypeDef USBD_LL_CloseEP (USBD_HandleTypeDef *pdev, uint8_t ep)
 
USBD_StatusTypeDef USBD_LL_FlushEP (USBD_HandleTypeDef *pdev, uint8_t ep)
 
USBD_StatusTypeDef USBD_LL_StallEP (USBD_HandleTypeDef *pdev, uint8_t ep)
 
USBD_StatusTypeDef USBD_LL_ClearStallEP (USBD_HandleTypeDef *pdev, uint8_t ep)
 
uint8_t USBD_LL_IsStallEP (USBD_HandleTypeDef *pdev, uint8_t ep)
 
USBD_StatusTypeDef USBD_LL_SetUSBAddress (USBD_HandleTypeDef *pdev, uint8_t addr)
 
USBD_StatusTypeDef USBD_LL_Transmit (USBD_HandleTypeDef *pdev, uint8_t ep, uint8_t *buf, uint32_t size)
 
USBD_StatusTypeDef USBD_LL_PrepareReceive (USBD_HandleTypeDef *pdev, uint8_t ep, uint8_t *buf, uint32_t size)
 
uint32_t USBD_LL_GetRxDataSize (USBD_HandleTypeDef *pdev, uint8_t ep)
 
void USBD_LL_Delay (uint32_t ms)
 
void * USBD_static_malloc (uint32_t size)
 
void USBD_static_free (void *p)
 

Variables

PCD_HandleTypeDef hpcd_USB_FS
 

Detailed Description

Low-level glue between the ST USB device library and the HAL PCD driver of the STM32WB55 (USB FS device, PA11/PA12).

Written after the ST template usbd_conf_template.c and the STM32CubeWB CDC examples.

Clocking: the USB peripheral runs from HSI48, trimmed by the CRS on the USB start-of-frame (no crystal needed). On the WB55, CPU2 also uses HSI48 (RNG): CPU1 holds hardware semaphore CFG_HW_CLK48_CONFIG_SEMID while USB is on, so CPU2 never switches HSI48 off (AN5289 ยง4.7).

Definition in file usbd_conf.c.

Function Documentation

◆ clk48_on()

static void clk48_on ( void  )
static

Definition at line 25 of file usbd_conf.c.

Referenced by HAL_PCD_MspInit().

Here is the caller graph for this function:

◆ HAL_PCD_MspInit()

void HAL_PCD_MspInit ( PCD_HandleTypeDef *  pcd)

Definition at line 47 of file usbd_conf.c.

References clk48_on().

Here is the call graph for this function:

◆ HAL_PCD_MspDeInit()

void HAL_PCD_MspDeInit ( PCD_HandleTypeDef *  pcd)

Definition at line 59 of file usbd_conf.c.

◆ USB_LP_IRQHandler()

void USB_LP_IRQHandler ( void  )

Definition at line 66 of file usbd_conf.c.

References hpcd_USB_FS.

◆ HAL_PCD_SetupStageCallback()

void HAL_PCD_SetupStageCallback ( PCD_HandleTypeDef *  pcd)

Definition at line 69 of file usbd_conf.c.

◆ HAL_PCD_DataOutStageCallback()

void HAL_PCD_DataOutStageCallback ( PCD_HandleTypeDef *  pcd,
uint8_t  ep 
)

Definition at line 70 of file usbd_conf.c.

◆ HAL_PCD_DataInStageCallback()

void HAL_PCD_DataInStageCallback ( PCD_HandleTypeDef *  pcd,
uint8_t  ep 
)

Definition at line 71 of file usbd_conf.c.

◆ HAL_PCD_SOFCallback()

void HAL_PCD_SOFCallback ( PCD_HandleTypeDef *  pcd)

Definition at line 72 of file usbd_conf.c.

◆ HAL_PCD_ResetCallback()

void HAL_PCD_ResetCallback ( PCD_HandleTypeDef *  pcd)

Definition at line 73 of file usbd_conf.c.

◆ HAL_PCD_SuspendCallback()

void HAL_PCD_SuspendCallback ( PCD_HandleTypeDef *  pcd)

Definition at line 78 of file usbd_conf.c.

◆ HAL_PCD_ResumeCallback()

void HAL_PCD_ResumeCallback ( PCD_HandleTypeDef *  pcd)

Definition at line 79 of file usbd_conf.c.

◆ HAL_PCD_ISOOUTIncompleteCallback()

void HAL_PCD_ISOOUTIncompleteCallback ( PCD_HandleTypeDef *  pcd,
uint8_t  ep 
)

Definition at line 80 of file usbd_conf.c.

◆ HAL_PCD_ISOINIncompleteCallback()

void HAL_PCD_ISOINIncompleteCallback ( PCD_HandleTypeDef *  pcd,
uint8_t  ep 
)

Definition at line 81 of file usbd_conf.c.

◆ HAL_PCD_ConnectCallback()

void HAL_PCD_ConnectCallback ( PCD_HandleTypeDef *  pcd)

Definition at line 82 of file usbd_conf.c.

◆ HAL_PCD_DisconnectCallback()

void HAL_PCD_DisconnectCallback ( PCD_HandleTypeDef *  pcd)

Definition at line 83 of file usbd_conf.c.

◆ st()

static USBD_StatusTypeDef st ( HAL_StatusTypeDef  h)
static

◆ USBD_LL_Init()

USBD_StatusTypeDef USBD_LL_Init ( USBD_HandleTypeDef *  pdev)

Definition at line 91 of file usbd_conf.c.

References hpcd_USB_FS.

◆ USBD_LL_DeInit()

USBD_StatusTypeDef USBD_LL_DeInit ( USBD_HandleTypeDef *  pdev)

Definition at line 114 of file usbd_conf.c.

References st().

Here is the call graph for this function:

◆ USBD_LL_Start()

USBD_StatusTypeDef USBD_LL_Start ( USBD_HandleTypeDef *  pdev)

Definition at line 115 of file usbd_conf.c.

References st().

Here is the call graph for this function:

◆ USBD_LL_Stop()

USBD_StatusTypeDef USBD_LL_Stop ( USBD_HandleTypeDef *  pdev)

Definition at line 116 of file usbd_conf.c.

References st().

Here is the call graph for this function:

◆ USBD_LL_OpenEP()

USBD_StatusTypeDef USBD_LL_OpenEP ( USBD_HandleTypeDef *  pdev,
uint8_t  ep,
uint8_t  type,
uint16_t  mps 
)

Definition at line 118 of file usbd_conf.c.

References st().

Here is the call graph for this function:

◆ USBD_LL_CloseEP()

USBD_StatusTypeDef USBD_LL_CloseEP ( USBD_HandleTypeDef *  pdev,
uint8_t  ep 
)

Definition at line 122 of file usbd_conf.c.

References st().

Here is the call graph for this function:

◆ USBD_LL_FlushEP()

USBD_StatusTypeDef USBD_LL_FlushEP ( USBD_HandleTypeDef *  pdev,
uint8_t  ep 
)

Definition at line 123 of file usbd_conf.c.

References st().

Here is the call graph for this function:

◆ USBD_LL_StallEP()

USBD_StatusTypeDef USBD_LL_StallEP ( USBD_HandleTypeDef *  pdev,
uint8_t  ep 
)

Definition at line 124 of file usbd_conf.c.

References st().

Here is the call graph for this function:

◆ USBD_LL_ClearStallEP()

USBD_StatusTypeDef USBD_LL_ClearStallEP ( USBD_HandleTypeDef *  pdev,
uint8_t  ep 
)

Definition at line 125 of file usbd_conf.c.

References st().

Here is the call graph for this function:

◆ USBD_LL_IsStallEP()

uint8_t USBD_LL_IsStallEP ( USBD_HandleTypeDef *  pdev,
uint8_t  ep 
)

Definition at line 127 of file usbd_conf.c.

◆ USBD_LL_SetUSBAddress()

USBD_StatusTypeDef USBD_LL_SetUSBAddress ( USBD_HandleTypeDef *  pdev,
uint8_t  addr 
)

Definition at line 133 of file usbd_conf.c.

References addr(), and st().

Here is the call graph for this function:

◆ USBD_LL_Transmit()

USBD_StatusTypeDef USBD_LL_Transmit ( USBD_HandleTypeDef *  pdev,
uint8_t  ep,
uint8_t *  buf,
uint32_t  size 
)

Definition at line 138 of file usbd_conf.c.

References st().

Here is the call graph for this function:

◆ USBD_LL_PrepareReceive()

USBD_StatusTypeDef USBD_LL_PrepareReceive ( USBD_HandleTypeDef *  pdev,
uint8_t  ep,
uint8_t *  buf,
uint32_t  size 
)

Definition at line 143 of file usbd_conf.c.

References st().

Here is the call graph for this function:

◆ USBD_LL_GetRxDataSize()

uint32_t USBD_LL_GetRxDataSize ( USBD_HandleTypeDef *  pdev,
uint8_t  ep 
)

Definition at line 148 of file usbd_conf.c.

◆ USBD_LL_Delay()

void USBD_LL_Delay ( uint32_t  ms)

Definition at line 153 of file usbd_conf.c.

References ms.

◆ USBD_static_malloc()

void * USBD_static_malloc ( uint32_t  size)

Definition at line 156 of file usbd_conf.c.

◆ USBD_static_free()

void USBD_static_free ( void *  p)

Definition at line 161 of file usbd_conf.c.

Variable Documentation

◆ hpcd_USB_FS

PCD_HandleTypeDef hpcd_USB_FS

Definition at line 22 of file usbd_conf.c.

Referenced by USB_LP_IRQHandler(), and USBD_LL_Init().