STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
usbd_core.h
Go to the documentation of this file.
1/**
2 ******************************************************************************
3 * @file usbd_core.h
4 * @author MCD Application Team
5 * @brief Header file for usbd_core.c file
6 ******************************************************************************
7 * @attention
8 *
9 * Copyright (c) 2015 STMicroelectronics.
10 * All rights reserved.
11 *
12 * This software is licensed under terms that can be found in the LICENSE file
13 * in the root directory of this software component.
14 * If no LICENSE file comes with this software, it is provided AS-IS.
15 *
16 ******************************************************************************
17 */
18
19/* Define to prevent recursive inclusion -------------------------------------*/
20#ifndef __USBD_CORE_H
21#define __USBD_CORE_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/* Includes ------------------------------------------------------------------*/
28#include "usbd_conf.h"
29#include "usbd_def.h"
30#include "usbd_ioreq.h"
31#include "usbd_ctlreq.h"
32
33/** @addtogroup STM32_USB_DEVICE_LIBRARY
34 * @{
35 */
36
37/** @defgroup USBD_CORE
38 * @brief This file is the Header file for usbd_core.c file
39 * @{
40 */
41
42
43/** @defgroup USBD_CORE_Exported_Defines
44 * @{
45 */
46#ifndef USBD_DEBUG_LEVEL
47#define USBD_DEBUG_LEVEL 0U
48#endif /* USBD_DEBUG_LEVEL */
49/**
50 * @}
51 */
52
53
54/** @defgroup USBD_CORE_Exported_TypesDefinitions
55 * @{
56 */
57
58
59/**
60 * @}
61 */
62
63
64
65/** @defgroup USBD_CORE_Exported_Macros
66 * @{
67 */
68
69/**
70 * @}
71 */
72
73/** @defgroup USBD_CORE_Exported_Variables
74 * @{
75 */
76#define USBD_SOF USBD_LL_SOF
77/**
78 * @}
79 */
80
81/** @defgroup USBD_CORE_Exported_FunctionsPrototype
82 * @{
83 */
89#if (USBD_USER_REGISTER_CALLBACK == 1U)
90USBD_StatusTypeDef USBD_RegisterDevStateCallback(USBD_HandleTypeDef *pdev, USBD_DevStateCallbackTypeDef pUserCallback);
91#endif /* USBD_USER_REGISTER_CALLBACK */
92
93#ifdef USE_USBD_COMPOSITE
94USBD_StatusTypeDef USBD_RegisterClassComposite(USBD_HandleTypeDef *pdev, USBD_ClassTypeDef *pclass,
95 USBD_CompositeClassTypeDef classtype, uint8_t *EpAddr);
96
97USBD_StatusTypeDef USBD_UnRegisterClassComposite(USBD_HandleTypeDef *pdev);
98uint8_t USBD_CoreGetEPAdd(USBD_HandleTypeDef *pdev, uint8_t ep_dir, uint8_t ep_type, uint8_t ClassId);
99#endif /* USE_USBD_COMPOSITE */
100
101uint8_t USBD_CoreFindIF(USBD_HandleTypeDef *pdev, uint8_t index);
102uint8_t USBD_CoreFindEP(USBD_HandleTypeDef *pdev, uint8_t index);
103
107
109USBD_StatusTypeDef USBD_LL_DataOutStage(USBD_HandleTypeDef *pdev, uint8_t epnum, uint8_t *pdata);
110USBD_StatusTypeDef USBD_LL_DataInStage(USBD_HandleTypeDef *pdev, uint8_t epnum, uint8_t *pdata);
111
116
120
123
124/* USBD Low Level Driver */
129
131 uint8_t ep_type, uint16_t ep_mps);
132
138
140 uint8_t *pbuf, uint32_t size);
141
143 uint8_t *pbuf, uint32_t size);
144
145#ifdef USBD_HS_TESTMODE_ENABLE
146USBD_StatusTypeDef USBD_LL_SetTestMode(USBD_HandleTypeDef *pdev, uint8_t testmode);
147#endif /* USBD_HS_TESTMODE_ENABLE */
148
149uint8_t USBD_LL_IsStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr);
150uint32_t USBD_LL_GetRxDataSize(USBD_HandleTypeDef *pdev, uint8_t ep_addr);
151
152void USBD_LL_Delay(uint32_t Delay);
153
154void *USBD_GetEpDesc(uint8_t *pConfDesc, uint8_t EpAddr);
155USBD_DescHeaderTypeDef *USBD_GetNextDesc(uint8_t *pbuf, uint16_t *ptr);
156
157/**
158 * @}
159 */
160
161#ifdef __cplusplus
162}
163#endif
164
165#endif /* __USBD_CORE_H */
166
167/**
168 * @}
169 */
170
171/**
172 * @}
173 */
174
175
USBD_StatusTypeDef USBD_LL_Transmit(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t size)
Transmits data over an endpoint.
Definition usbd_conf.c:560
USBD_StatusTypeDef USBD_LL_DevDisconnected(USBD_HandleTypeDef *pdev)
USBD_LL_DevDisconnected Handle device disconnection event.
Definition usbd_core.c:1001
USBD_StatusTypeDef USBD_LL_DataInStage(USBD_HandleTypeDef *pdev, uint8_t epnum, uint8_t *pdata)
USBD_LL_DataInStage Handle data in stage.
Definition usbd_core.c:684
USBD_StatusTypeDef USBD_ClrClassConfig(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
USBD_ClrClassConfig Clear current configuration.
Definition usbd_core.c:505
USBD_StatusTypeDef USBD_SetClassConfig(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
USBD_SetClassConfig Configure device and start the interface.
Definition usbd_core.c:465
USBD_StatusTypeDef USBD_LL_FlushEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Flushes an endpoint of the Low Level Driver.
Definition usbd_conf.c:466
USBD_StatusTypeDef USBD_LL_DataOutStage(USBD_HandleTypeDef *pdev, uint8_t epnum, uint8_t *pdata)
USBD_LL_DataOutStage Handle data OUT stage.
Definition usbd_core.c:586
USBD_StatusTypeDef USBD_LL_IsoOUTIncomplete(USBD_HandleTypeDef *pdev, uint8_t epnum)
USBD_LL_IsoOUTIncomplete Handle iso out incomplete event.
Definition usbd_core.c:962
USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev)
Initializes the low level portion of the device driver.
Definition usbd_conf.c:323
uint8_t USBD_LL_IsStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Returns Stall condition.
Definition usbd_conf.c:520
USBD_StatusTypeDef USBD_RunTestMode(USBD_HandleTypeDef *pdev)
USBD_RunTestMode Launch test mode process.
Definition usbd_core.c:440
void USBD_LL_Delay(uint32_t Delay)
Delays routine for the USB device library.
Definition usbd_conf.c:645
USBD_StatusTypeDef USBD_RegisterClass(USBD_HandleTypeDef *pdev, USBD_ClassTypeDef *pclass)
USBD_RegisterClass Link class driver to Device Core.
Definition usbd_core.c:202
USBD_DescHeaderTypeDef * USBD_GetNextDesc(uint8_t *pbuf, uint16_t *ptr)
USBD_GetNextDesc This function return the next descriptor header.
Definition usbd_core.c:1198
USBD_StatusTypeDef USBD_LL_Start(USBD_HandleTypeDef *pdev)
Starts the low level portion of the device driver.
Definition usbd_conf.c:393
USBD_StatusTypeDef USBD_Start(USBD_HandleTypeDef *pdev)
USBD_Start Start the USB Device Core.
Definition usbd_core.c:384
uint8_t USBD_CoreFindEP(USBD_HandleTypeDef *pdev, uint8_t index)
USBD_CoreFindEP return the class index relative to the selected endpoint.
Definition usbd_core.c:1086
USBD_StatusTypeDef USBD_Stop(USBD_HandleTypeDef *pdev)
USBD_Stop Stop the USB Device Core.
Definition usbd_core.c:400
uint8_t USBD_CoreFindIF(USBD_HandleTypeDef *pdev, uint8_t index)
USBD_CoreFindIF return the class index relative to the selected interface.
Definition usbd_core.c:1046
USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t size)
Prepares an endpoint for reception.
Definition usbd_conf.c:580
USBD_StatusTypeDef USBD_LL_IsoINIncomplete(USBD_HandleTypeDef *pdev, uint8_t epnum)
USBD_LL_IsoINIncomplete Handle iso in incomplete event.
Definition usbd_core.c:936
USBD_StatusTypeDef USBD_LL_Suspend(USBD_HandleTypeDef *pdev)
USBD_LL_Suspend Handle Suspend event.
Definition usbd_core.c:859
USBD_StatusTypeDef USBD_LL_Reset(USBD_HandleTypeDef *pdev)
USBD_LL_Reset Handle Reset event.
Definition usbd_core.c:777
USBD_StatusTypeDef USBD_DeInit(USBD_HandleTypeDef *pdev)
USBD_DeInit De-Initialize the device library.
Definition usbd_core.c:149
USBD_StatusTypeDef USBD_LL_DeInit(USBD_HandleTypeDef *pdev)
De-Initializes the low level portion of the device driver.
Definition usbd_conf.c:376
USBD_StatusTypeDef USBD_LL_SetSpeed(USBD_HandleTypeDef *pdev, USBD_SpeedTypeDef speed)
USBD_LL_SetSpeed Handle Reset event.
Definition usbd_core.c:845
USBD_StatusTypeDef USBD_LL_DevConnected(USBD_HandleTypeDef *pdev)
USBD_LL_DevConnected Handle device connection event.
Definition usbd_core.c:987
USBD_StatusTypeDef USBD_LL_StallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Sets a Stall condition on an endpoint of the Low Level Driver.
Definition usbd_conf.c:484
USBD_StatusTypeDef USBD_LL_SetupStage(USBD_HandleTypeDef *pdev, uint8_t *psetup)
USBD_LL_SetupStage Handle the setup stage.
Definition usbd_core.c:546
USBD_StatusTypeDef USBD_LL_Stop(USBD_HandleTypeDef *pdev)
Stops the low level portion of the device driver.
Definition usbd_conf.c:410
USBD_StatusTypeDef USBD_LL_SOF(USBD_HandleTypeDef *pdev)
USBD_LL_SOF Handle SOF event.
Definition usbd_core.c:893
USBD_StatusTypeDef USBD_LL_Resume(USBD_HandleTypeDef *pdev)
USBD_LL_Resume Handle Resume event.
Definition usbd_core.c:877
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_StatusTypeDef USBD_LL_SetUSBAddress(USBD_HandleTypeDef *pdev, uint8_t dev_addr)
Assigns a USB address to the device.
Definition usbd_conf.c:540
USBD_StatusTypeDef USBD_LL_ClearStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Clears a Stall condition on an endpoint of the Low Level Driver.
Definition usbd_conf.c:502
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.
Definition usbd_conf.c:430
USBD_StatusTypeDef USBD_LL_CloseEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Closes an endpoint of the low level driver.
Definition usbd_conf.c:448
uint32_t USBD_LL_GetRxDataSize(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Returns the last transferred packet size.
Definition usbd_conf.c:598
void * USBD_GetEpDesc(uint8_t *pConfDesc, uint8_t EpAddr)
USBD_GetEpDesc This function return the Endpoint descriptor.
Definition usbd_core.c:1157
struct _USBD_HandleTypeDef USBD_HandleTypeDef
USBD_SpeedTypeDef
Definition usbd_def.h:272
struct _Device_cb USBD_ClassTypeDef
USBD_StatusTypeDef
Definition usbd_def.h:280
*brief write string representation of the JSON pointer to stream *sa const json_pointer & ptr
Definition json.hpp:13895
: Header for usbd_conf.c file.
General defines for the usb device library.
Header file for the usbd_ioreq.c file.