|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
: This file implements the board support package for the USB device library More...
#include "stm32h7xx.h"#include "stm32h7xx_hal.h"#include "usbd_def.h"#include "usbd_core.h"#include "usbd_cdc.h"#include <stdbool.h>Go to the source code of this file.
Functions | |
| void | Error_Handler (void) |
| This function is executed in case of error occurrence. | |
| USBD_StatusTypeDef | USBD_Get_USB_Status (HAL_StatusTypeDef hal_status) |
| Returns the USB status depending on the HAL status: | |
| void | HAL_PCD_MspInit (PCD_HandleTypeDef *pcdHandle) |
| void | HAL_PCD_MspDeInit (PCD_HandleTypeDef *pcdHandle) |
| void | HAL_PCD_SetupStageCallback (PCD_HandleTypeDef *hpcd) |
| Setup stage callback. | |
| void | HAL_PCD_DataOutStageCallback (PCD_HandleTypeDef *hpcd, uint8_t epnum) |
| Data Out stage callback. | |
| void | HAL_PCD_DataInStageCallback (PCD_HandleTypeDef *hpcd, uint8_t epnum) |
| Data In stage callback. | |
| void | HAL_PCD_SOFCallback (PCD_HandleTypeDef *hpcd) |
| SOF callback. | |
| void | HAL_PCD_ResetCallback (PCD_HandleTypeDef *hpcd) |
| Reset callback. | |
| void | HAL_PCD_SuspendCallback (PCD_HandleTypeDef *hpcd) |
| Suspend callback. | |
| void | HAL_PCD_ResumeCallback (PCD_HandleTypeDef *hpcd) |
| Resume callback. | |
| void | HAL_PCD_ISOOUTIncompleteCallback (PCD_HandleTypeDef *hpcd, uint8_t epnum) |
| ISOOUTIncomplete callback. | |
| void | HAL_PCD_ISOINIncompleteCallback (PCD_HandleTypeDef *hpcd, uint8_t epnum) |
| ISOINIncomplete callback. | |
| void | HAL_PCD_ConnectCallback (PCD_HandleTypeDef *hpcd) |
| Connect callback. | |
| void | HAL_PCD_DisconnectCallback (PCD_HandleTypeDef *hpcd) |
| Disconnect callback. | |
| USBD_StatusTypeDef | USBD_LL_Init (USBD_HandleTypeDef *pdev) |
| Initializes the low level portion of the device driver. | |
| USBD_StatusTypeDef | USBD_LL_DeInit (USBD_HandleTypeDef *pdev) |
| De-Initializes the low level portion of the device driver. | |
| USBD_StatusTypeDef | USBD_LL_Start (USBD_HandleTypeDef *pdev) |
| Starts the low level portion of the device driver. | |
| USBD_StatusTypeDef | USBD_LL_Stop (USBD_HandleTypeDef *pdev) |
| Stops the low level portion of the device driver. | |
| USBD_StatusTypeDef | USBD_LL_OpenEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_mps) |
| Opens an endpoint of the low level driver. | |
| USBD_StatusTypeDef | USBD_LL_CloseEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr) |
| Closes an endpoint of the low level driver. | |
| USBD_StatusTypeDef | USBD_LL_FlushEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr) |
| Flushes an endpoint of the Low Level Driver. | |
| USBD_StatusTypeDef | USBD_LL_StallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr) |
| Sets a Stall condition on an endpoint of the Low Level Driver. | |
| USBD_StatusTypeDef | USBD_LL_ClearStallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr) |
| Clears a Stall condition on an endpoint of the Low Level Driver. | |
| uint8_t | USBD_LL_IsStallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr) |
| Returns Stall condition. | |
| USBD_StatusTypeDef | USBD_LL_SetUSBAddress (USBD_HandleTypeDef *pdev, uint8_t dev_addr) |
| Assigns a USB address to the device. | |
| USBD_StatusTypeDef | USBD_LL_Transmit (USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t size) |
| Transmits data over an endpoint. | |
| USBD_StatusTypeDef | USBD_LL_PrepareReceive (USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t size) |
| Prepares an endpoint for reception. | |
| uint32_t | USBD_LL_GetRxDataSize (USBD_HandleTypeDef *pdev, uint8_t ep_addr) |
| Returns the last transferred packet size. | |
| void * | USBD_static_malloc (uint32_t size) |
| Static single allocation. | |
| void | USBD_static_free (void *p) |
| Dummy memory free. | |
| void | USBD_LL_Delay (uint32_t Delay) |
| Delays routine for the USB device library. | |
Variables | |
| volatile bool | g_usb_terminal_connected |
| PCD_HandleTypeDef | hpcd_USB_OTG_HS |
: This file implements the board support package for the USB device library
Copyright (c) 2026 STMicroelectronics. All rights reserved.
This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.
Definition in file usbd_conf.c.
| void Error_Handler | ( | void | ) |
This function is executed in case of error occurrence.
| None |
Definition at line 1145 of file main.c.
Referenced by HAL_PCD_MspInit(), HAL_PCD_ResetCallback(), MX_ADC1_Init(), MX_I2C4_Init(), MX_RTC_Init(), MX_SDMMC1_MMC_Init(), MX_SPI1_Init(), MX_SPI2_Init(), MX_SPI3_Init(), MX_SPI4_Init(), MX_TIM1_Init(), MX_TIM2_Init(), MX_TIM3_Init(), MX_UART9_Init(), SystemClock_Config(), and USBD_LL_Init().
| void HAL_PCD_ConnectCallback | ( | PCD_HandleTypeDef * | hpcd | ) |
Connect callback.
| hpcd | PCD handle |
| None |
Definition at line 294 of file usbd_conf.c.
References USBD_LL_DevConnected().
| void HAL_PCD_DataInStageCallback | ( | PCD_HandleTypeDef * | hpcd, |
| uint8_t | epnum ) |
Data In stage callback.
| hpcd | PCD handle |
| epnum | Endpoint number |
| None |
Definition at line 161 of file usbd_conf.c.
References USBD_LL_DataInStage().
| void HAL_PCD_DataOutStageCallback | ( | PCD_HandleTypeDef * | hpcd, |
| uint8_t | epnum ) |
Data Out stage callback.
| hpcd | PCD handle |
| epnum | Endpoint number |
| None |
Definition at line 146 of file usbd_conf.c.
References USBD_LL_DataOutStage().
| void HAL_PCD_DisconnectCallback | ( | PCD_HandleTypeDef * | hpcd | ) |
Disconnect callback.
| hpcd | PCD handle |
| None |
Definition at line 308 of file usbd_conf.c.
References USBD_LL_DevDisconnected().
| void HAL_PCD_ISOINIncompleteCallback | ( | PCD_HandleTypeDef * | hpcd, |
| uint8_t | epnum ) |
ISOINIncomplete callback.
| hpcd | PCD handle |
| epnum | Endpoint number |
| None |
Definition at line 280 of file usbd_conf.c.
References USBD_LL_IsoINIncomplete().
| void HAL_PCD_ISOOUTIncompleteCallback | ( | PCD_HandleTypeDef * | hpcd, |
| uint8_t | epnum ) |
ISOOUTIncomplete callback.
| hpcd | PCD handle |
| epnum | Endpoint number |
| None |
Definition at line 265 of file usbd_conf.c.
References USBD_LL_IsoOUTIncomplete().
| void HAL_PCD_MspDeInit | ( | PCD_HandleTypeDef * | pcdHandle | ) |
Definition at line 102 of file usbd_conf.c.
References HAL_NVIC_DisableIRQ(), OTG_HS_EP1_IN_IRQn, OTG_HS_IRQn, and USB_OTG_HS.
| void HAL_PCD_MspInit | ( | PCD_HandleTypeDef * | pcdHandle | ) |
Initializes the peripherals clock
Enable USB Voltage detector
Definition at line 66 of file usbd_conf.c.
References Error_Handler(), HAL_NVIC_EnableIRQ(), HAL_NVIC_SetPriority(), HAL_OK, HAL_PWREx_EnableUSBVoltageDetector(), HAL_RCCEx_PeriphCLKConfig(), OTG_HS_EP1_IN_IRQn, OTG_HS_IRQn, RCC_PeriphCLKInitTypeDef::PeriphClockSelection, RCC_PERIPHCLK_USB, RCC_USBCLKSOURCE_HSI48, USB_OTG_HS, and RCC_PeriphCLKInitTypeDef::UsbClockSelection.
| void HAL_PCD_ResetCallback | ( | PCD_HandleTypeDef * | hpcd | ) |
Reset callback.
| hpcd | PCD handle |
| None |
Definition at line 189 of file usbd_conf.c.
References Error_Handler(), USBD_LL_Reset(), USBD_LL_SetSpeed(), USBD_SPEED_FULL, and USBD_SPEED_HIGH.
| void HAL_PCD_ResumeCallback | ( | PCD_HandleTypeDef * | hpcd | ) |
Resume callback.
When Low power mode is enabled the debug cannot be used (IAR, Keil doesn't support it)
| hpcd | PCD handle |
| None |
Definition at line 247 of file usbd_conf.c.
References USBD_LL_Resume().
| void HAL_PCD_SetupStageCallback | ( | PCD_HandleTypeDef * | hpcd | ) |
Setup stage callback.
| hpcd | PCD handle |
| None |
Definition at line 131 of file usbd_conf.c.
References USBD_LL_SetupStage().
| void HAL_PCD_SOFCallback | ( | PCD_HandleTypeDef * | hpcd | ) |
SOF callback.
| hpcd | PCD handle |
| None |
Definition at line 175 of file usbd_conf.c.
References USBD_LL_SOF().
| void HAL_PCD_SuspendCallback | ( | PCD_HandleTypeDef * | hpcd | ) |
Suspend callback.
When Low power mode is enabled the debug cannot be used (IAR, Keil doesn't support it)
| hpcd | PCD handle |
| None |
Definition at line 222 of file usbd_conf.c.
References SCB, SCB_SCR_SLEEPDEEP_Msk, SCB_SCR_SLEEPONEXIT_Msk, and USBD_LL_Suspend().
| USBD_StatusTypeDef USBD_Get_USB_Status | ( | HAL_StatusTypeDef | hal_status | ) |
Returns the USB status depending on the HAL status:
| hal_status | HAL status |
| USB | status |
Definition at line 655 of file usbd_conf.c.
References HAL_BUSY, HAL_ERROR, HAL_OK, HAL_TIMEOUT, USBD_BUSY, USBD_FAIL, and USBD_OK.
Referenced by USBD_LL_ClearStallEP(), USBD_LL_CloseEP(), USBD_LL_DeInit(), USBD_LL_FlushEP(), USBD_LL_OpenEP(), USBD_LL_PrepareReceive(), USBD_LL_SetUSBAddress(), USBD_LL_StallEP(), USBD_LL_Start(), USBD_LL_Stop(), and USBD_LL_Transmit().
| PCD_HandleTypeDef hpcd_USB_OTG_HS |
Definition at line 41 of file usbd_conf.c.
Referenced by OTG_HS_EP1_IN_IRQHandler(), OTG_HS_IRQHandler(), and USBD_LL_Init().