STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
usb_device.c
Go to the documentation of this file.
1/* USER CODE BEGIN Header */
2/**
3 ******************************************************************************
4 * @file : usb_device.c
5 * @version : v1.0_Cube
6 * @brief : This file implements the USB Device
7 ******************************************************************************
8 * @attention
9 *
10 * Copyright (c) 2026 STMicroelectronics.
11 * All rights reserved.
12 *
13 * This software is licensed under terms that can be found in the LICENSE file
14 * in the root directory of this software component.
15 * If no LICENSE file comes with this software, it is provided AS-IS.
16 *
17 ******************************************************************************
18 */
19/* USER CODE END Header */
20
21/* Includes ------------------------------------------------------------------*/
22
23#include "usb_device.h"
24#include "usbd_core.h"
25#include "usbd_desc.h"
26#include "usbd_cdc.h"
27#include "usbd_cdc_if.h"
28
29/* USER CODE BEGIN Includes */
30
31/* USER CODE END Includes */
32
33/* USER CODE BEGIN PV */
34/* Private variables ---------------------------------------------------------*/
35
36/* USER CODE END PV */
37
38/* USER CODE BEGIN PFP */
39/* Private function prototypes -----------------------------------------------*/
40
41/* USER CODE END PFP */
42
43/* USB Device Core handle declaration. */
45
46/*
47 * -- Insert your variables declaration here --
48 */
49/* USER CODE BEGIN 0 */
50
51/* USER CODE END 0 */
52
53/*
54 * -- Insert your external function declaration here --
55 */
56/* USER CODE BEGIN 1 */
57
58/* USER CODE END 1 */
59
60/**
61 * Init USB device Library, add supported class and start the library
62 * @retval None
63 */
65{
66 /* USER CODE BEGIN USB_DEVICE_Init_PreTreatment */
67
68 /* USER CODE END USB_DEVICE_Init_PreTreatment */
69
70 /* Init Device Library, add supported class and start the library. */
72 {
74 }
76 {
78 }
80 {
82 }
84 {
86 }
87
88 /* USER CODE BEGIN USB_DEVICE_Init_PostTreatment */
90
91 /* USER CODE END USB_DEVICE_Init_PostTreatment */
92}
93
94/**
95 * @}
96 */
97
98/**
99 * @}
100 */
101
void Error_Handler(void)
This function is executed in case of error occurrence.
Definition main.c:1145
void HAL_PWREx_EnableUSBVoltageDetector(void)
USBD_HandleTypeDef hUsbDeviceHS
Definition usb_device.c:44
USBD_CDC_ItfTypeDef USBD_Interface_fops_HS
CDC Interface callback.
#define DEVICE_HS
Definition usbd_conf.h:81
USBD_StatusTypeDef USBD_RegisterClass(USBD_HandleTypeDef *pdev, USBD_ClassTypeDef *pclass)
USBD_RegisterClass Link class driver to Device Core.
Definition usbd_core.c:202
USBD_StatusTypeDef USBD_Start(USBD_HandleTypeDef *pdev)
USBD_Start Start the USB Device Core.
Definition usbd_core.c:384
USBD_StatusTypeDef USBD_Init(USBD_HandleTypeDef *pdev, USBD_DescriptorsTypeDef *pdesc, uint8_t id)
USBD_Init Initialize the device stack and load the class driver.
Definition usbd_core.c:92
USBD_ClassTypeDef USBD_CDC
Definition usbd_cdc.c:141
struct _USBD_HandleTypeDef USBD_HandleTypeDef
@ USBD_OK
Definition usbd_def.h:281
USBD_DescriptorsTypeDef HS_Desc
Descriptor for the Usb device.
Definition usbd_desc.c:134
void MX_USB_DEVICE_Init(void)
Init USB device Library, add supported class and start the library.
Definition usb_device.c:64
uint8_t USBD_CDC_RegisterInterface(USBD_HandleTypeDef *pdev, USBD_CDC_ItfTypeDef *fops)
USBD_CDC_RegisterInterface.
Definition usbd_cdc.c:738
: Header for usb_device.c file.
header file for the usbd_cdc.c file.
: Header for usbd_cdc_if.c file.
Header file for usbd_core.c file.