WebRadioApp  0.1
usbh_conf.h
Go to the documentation of this file.
1 /* USER CODE BEGIN Header */
24 /* USER CODE END Header */
25 
26 /* Define to prevent recursive inclusion -------------------------------------*/
27 #ifndef __USBH_CONF__H__
28 #define __USBH_CONF__H__
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 /* Includes ------------------------------------------------------------------*/
33 
34 #include <stdio.h>
35 #include <stdlib.h>
36 #include <string.h>
37 #include "main.h"
38 
39 #include "stm32h7xx.h"
40 #include "stm32h7xx_hal.h"
41 
42 /* USER CODE BEGIN INCLUDE */
43 
44 /* USER CODE END INCLUDE */
45 
69 /*---------- -----------*/
70 #define USBH_MAX_NUM_ENDPOINTS 2U
71 
72 /*---------- -----------*/
73 #define USBH_MAX_NUM_INTERFACES 2U
74 
75 /*---------- -----------*/
76 #define USBH_MAX_NUM_CONFIGURATION 1U
77 
78 /*---------- -----------*/
79 #define USBH_KEEP_CFG_DESCRIPTOR 1U
80 
81 /*---------- -----------*/
82 #define USBH_MAX_NUM_SUPPORTED_CLASS 1U
83 
84 /*---------- -----------*/
85 #define USBH_MAX_SIZE_CONFIGURATION 256U
86 
87 /*---------- -----------*/
88 #define USBH_MAX_DATA_BUFFER 512U
89 
90 /*---------- -----------*/
91 #define USBH_DEBUG_LEVEL 3U
92 
93 /*---------- -----------*/
94 #define USBH_USE_OS 0U
95 
96 /****************************************/
97 /* #define for FS and HS identification */
98 #define HOST_HS 0
99 #define HOST_FS 1
100 
101 #if (USBH_USE_OS == 1)
102 #include "cmsis_os.h"
103 #define USBH_PROCESS_PRIO osPriorityNormal
104 #define USBH_PROCESS_STACK_SIZE ((uint16_t)0)
105 #endif /* (USBH_USE_OS == 1) */
106 
116 /* Memory management macros */
117 
119 #define USBH_malloc malloc
120 
122 #define USBH_free free
123 
125 #define USBH_memset memset
126 
128 #define USBH_memcpy memcpy
129 
130 /* DEBUG macros */
131 
132 #if (USBH_DEBUG_LEVEL > 0U)
133 #define USBH_UsrLog(...) \
134  do { \
135  printf(__VA_ARGS__); \
136  printf("\n\r"); \
137  } while (0)
138 #else
139 #define USBH_UsrLog(...) \
140  do { \
141  } while (0)
142 #endif
143 
144 #if (USBH_DEBUG_LEVEL > 1U)
145 
146 #define USBH_ErrLog(...) \
147  do { \
148  printf("ERROR: "); \
149  printf(__VA_ARGS__); \
150  printf("\n\r"); \
151  } while (0)
152 #else
153 #define USBH_ErrLog(...) \
154  do { \
155  } while (0)
156 #endif
157 
158 #if (USBH_DEBUG_LEVEL > 2U)
159 #define USBH_DbgLog(...) \
160  do { \
161  printf("DEBUG : "); \
162  printf(__VA_ARGS__); \
163  printf("\n\r"); \
164  } while (0)
165 #else
166 #define USBH_DbgLog(...) \
167  do { \
168  } while (0)
169 #endif
170 
190 /* Exported functions -------------------------------------------------------*/
191 
204 #ifdef __cplusplus
205 }
206 #endif
207 
208 #endif /* __USBH_CONF__H__ */
209 
214 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
USBH_LL_OpenPipe
USBH_StatusTypeDef USBH_LL_OpenPipe(USBH_HandleTypeDef *phost, uint8_t pipe_num, uint8_t epnum, uint8_t dev_address, uint8_t speed, uint8_t ep_type, uint16_t mps)
Open a pipe of the low level driver.
Definition: usbh_conf.c:408
HAL_HCD_Connect_Callback
void HAL_HCD_Connect_Callback(HCD_HandleTypeDef *hhcd)
SOF callback.
Definition: usbh_conf.c:205
USBH_Get_USB_Status
USBH_StatusTypeDef USBH_Get_USB_Status(HAL_StatusTypeDef hal_status)
Retuns the USB status depending on the HAL status:
Definition: usbh_conf.c:584
HAL_HCD_MspDeInit
void HAL_HCD_MspDeInit(HCD_HandleTypeDef *hcdHandle)
Definition: usbh_conf.c:145
HOST_HS
#define HOST_HS
Definition: usbh_conf.h:98
HAL_HCD_HC_NotifyURBChange_Callback
void HAL_HCD_HC_NotifyURBChange_Callback(HCD_HandleTypeDef *hhcd, uint8_t chnum, HCD_URBStateTypeDef urb_state)
Notify URB state change callback.
Definition: usbh_conf.c:227
Error_Handler
void Error_Handler(void)
This function is executed in case of error occurrence.
Definition: main.cpp:693
USBH_LL_SubmitURB
USBH_StatusTypeDef USBH_LL_SubmitURB(USBH_HandleTypeDef *phost, uint8_t pipe, uint8_t direction, uint8_t ep_type, uint8_t token, uint8_t *pbuff, uint16_t length, uint8_t do_ping)
Submit a new URB to the low level driver.
Definition: usbh_conf.c:469
USBH_LL_DeInit
USBH_StatusTypeDef USBH_LL_DeInit(USBH_HandleTypeDef *phost)
De-Initialize the low level portion of the host driver.
Definition: usbh_conf.c:294
USBH_LL_GetURBState
USBH_URBStateTypeDef USBH_LL_GetURBState(USBH_HandleTypeDef *phost, uint8_t pipe)
Get a URB state from the low level driver.
Definition: usbh_conf.c:498
HAL_HCD_MspInit
void HAL_HCD_MspInit(HCD_HandleTypeDef *hcdHandle)
Definition: usbh_conf.c:68
USBH_LL_Stop
USBH_StatusTypeDef USBH_LL_Stop(USBH_HandleTypeDef *phost)
Stop the low level portion of the host driver.
Definition: usbh_conf.c:328
HAL_HCD_SOF_Callback
void HAL_HCD_SOF_Callback(HCD_HandleTypeDef *hhcd)
SOF callback.
Definition: usbh_conf.c:195
USBH_LL_Init
USBH_StatusTypeDef USBH_LL_Init(USBH_HandleTypeDef *phost)
Initialize the low level portion of the host driver.
Definition: usbh_conf.c:264
USBH_LL_GetSpeed
USBH_SpeedTypeDef USBH_LL_GetSpeed(USBH_HandleTypeDef *phost)
Return the USB host speed from the low level driver.
Definition: usbh_conf.c:345
USBH_LL_GetLastXferSize
uint32_t USBH_LL_GetLastXferSize(USBH_HandleTypeDef *phost, uint8_t pipe)
Return the last transfered packet size.
Definition: usbh_conf.c:392
USBH_LL_Start
USBH_StatusTypeDef USBH_LL_Start(USBH_HandleTypeDef *phost)
Start the low level portion of the host driver.
Definition: usbh_conf.c:311
USBH_LL_ClosePipe
USBH_StatusTypeDef USBH_LL_ClosePipe(USBH_HandleTypeDef *phost, uint8_t pipe)
Close a pipe of the low level driver.
Definition: usbh_conf.c:430
USBH_LL_GetToggle
uint8_t USBH_LL_GetToggle(USBH_HandleTypeDef *phost, uint8_t pipe)
Return the current toggle of a pipe.
Definition: usbh_conf.c:555
USBH_LL_ResetPort
USBH_StatusTypeDef USBH_LL_ResetPort(USBH_HandleTypeDef *phost)
Reset the Host port of the low level driver.
Definition: usbh_conf.c:374
usbh_platform.h
: Header for usbh_platform.c file.
HAL_HCD_PortEnabled_Callback
void HAL_HCD_PortEnabled_Callback(HCD_HandleTypeDef *hhcd)
Port Port Enabled callback.
Definition: usbh_conf.c:240
USBH_Delay
void USBH_Delay(uint32_t Delay)
Delay routine for the USB Host Library.
Definition: usbh_conf.c:574
hhcd_USB_OTG_HS
HCD_HandleTypeDef hhcd_USB_OTG_HS
Definition: usbh_conf.c:44
HAL_HCD_PortDisabled_Callback
void HAL_HCD_PortDisabled_Callback(HCD_HandleTypeDef *hhcd)
Port Port Disabled callback.
Definition: usbh_conf.c:250
USBH_LL_DriverVBUS
USBH_StatusTypeDef USBH_LL_DriverVBUS(USBH_HandleTypeDef *phost, uint8_t state)
Drive VBUS.
Definition: usbh_conf.c:513
MX_DriverVbusHS
void MX_DriverVbusHS(uint8_t state)
Drive VBUS.
Definition: usbh_platform.c:40
USBH_LL_SetToggle
USBH_StatusTypeDef USBH_LL_SetToggle(USBH_HandleTypeDef *phost, uint8_t pipe, uint8_t toggle)
Set toggle for a pipe.
Definition: usbh_conf.c:534
HAL_HCD_Disconnect_Callback
void HAL_HCD_Disconnect_Callback(HCD_HandleTypeDef *hhcd)
SOF callback.
Definition: usbh_conf.c:215