rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions | Variables
usbd_conf.c File Reference

Functions

void SystemClock_Config (void)
 
USBD_StatusTypeDef USBD_Get_USB_Status (HAL_StatusTypeDef hal_status)
 Retuns the USB status depending on the HAL status:
 
static void PCD_SetupStageCallback (PCD_HandleTypeDef *hpcd) void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd)
 Setup stage callback.
 
static void PCD_DataOutStageCallback (PCD_HandleTypeDef *hpcd, uint8_t epnum) void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd
 Data Out stage callback.
 
static void PCD_DataInStageCallback (PCD_HandleTypeDef *hpcd, uint8_t epnum) void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd
 Data In stage callback.
 
static void PCD_SOFCallback (PCD_HandleTypeDef *hpcd) void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd)
 SOF callback.
 
static void PCD_ResetCallback (PCD_HandleTypeDef *hpcd) void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd)
 Reset callback.
 
static void PCD_SuspendCallback (PCD_HandleTypeDef *hpcd) 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)
 
static void PCD_ResumeCallback (PCD_HandleTypeDef *hpcd) 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)
 
static void PCD_ISOOUTIncompleteCallback (PCD_HandleTypeDef *hpcd, uint8_t epnum) void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd
 ISOOUTIncomplete callback.
 
static void PCD_ISOINIncompleteCallback (PCD_HandleTypeDef *hpcd, uint8_t epnum) void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd
 ISOINIncomplete callback.
 
static void PCD_ConnectCallback (PCD_HandleTypeDef *hpcd) void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd)
 Connect callback.
 
static void PCD_DisconnectCallback (PCD_HandleTypeDef *hpcd) 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 transfered packet size.
 
void USBD_LL_Delay (uint32_t Delay)
 Delays routine for the USB Device Library.
 

Variables

PCD_HandleTypeDef hpcd_USB_OTG_FS
 
static void uint8_t epnum
 

Function Documentation

◆ PCD_ConnectCallback()

static void PCD_ConnectCallback ( PCD_HandleTypeDef *  hpcd)
static

Connect callback.

Parameters
hpcdPCD handle
Return values
None

Definition at line 251 of file usbd_conf.c.

255{
256 /* Configure Low connection state. */
257 UsbConnectHook(BLT_TRUE);
258 /* Inform lower layer. */
259 USBD_LL_DevConnected((USBD_HandleTypeDef*)hpcd->pData);
260}
USBD_StatusTypeDef USBD_LL_DevConnected(USBD_HandleTypeDef *pdev)
void UsbConnectHook(blt_bool connect)
Callback that gets called whenever the USB device should be connected to the USB bus.
Definition hooks.c:132

Referenced by USBD_LL_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCD_DataInStageCallback()

static void PCD_DataInStageCallback ( PCD_HandleTypeDef *  hpcd,
uint8_t  epnum 
)
static

Data In stage callback.

Parameters
hpcdPCD handle
epnumEndpoint number
Return values
None

Referenced by USBD_LL_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCD_DataOutStageCallback()

static void PCD_DataOutStageCallback ( PCD_HandleTypeDef *  hpcd,
uint8_t  epnum 
)
static

Data Out stage callback.

Parameters
hpcdPCD handle
epnumEndpoint number
Return values
None

Referenced by USBD_LL_Init().

Here is the caller graph for this function:

◆ PCD_DisconnectCallback()

static void PCD_DisconnectCallback ( PCD_HandleTypeDef *  hpcd)
static

Disconnect callback.

Parameters
hpcdPCD handle
Return values
None

Definition at line 268 of file usbd_conf.c.

272{
273 /* Configure High connection state. */
274 UsbConnectHook(BLT_FALSE);
275 /* Inform lower layer. */
276 USBD_LL_DevDisconnected((USBD_HandleTypeDef*)hpcd->pData);
277}
USBD_StatusTypeDef USBD_LL_DevDisconnected(USBD_HandleTypeDef *pdev)

Referenced by USBD_LL_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCD_ISOINIncompleteCallback()

static void PCD_ISOINIncompleteCallback ( PCD_HandleTypeDef *  hpcd,
uint8_t  epnum 
)
static

ISOINIncomplete callback.

Parameters
hpcdPCD handle
epnumEndpoint number
Return values
None

Referenced by USBD_LL_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCD_ISOOUTIncompleteCallback()

static void PCD_ISOOUTIncompleteCallback ( PCD_HandleTypeDef *  hpcd,
uint8_t  epnum 
)
static

ISOOUTIncomplete callback.

Parameters
hpcdPCD handle
epnumEndpoint number
Return values
None

Referenced by USBD_LL_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCD_ResetCallback()

static void PCD_ResetCallback ( PCD_HandleTypeDef *  hpcd)
static

Reset callback.

Parameters
hpcdPCD handle
Return values
None

Definition at line 143 of file usbd_conf.c.

147{
148 USBD_SpeedTypeDef speed = USBD_SPEED_FULL;
149
150 if ( hpcd->Init.speed == PCD_SPEED_HIGH)
151 {
152 speed = USBD_SPEED_HIGH;
153 }
154 else if ( hpcd->Init.speed == PCD_SPEED_FULL)
155 {
156 speed = USBD_SPEED_FULL;
157 }
158 else
159 {
160 ASSERT_RT(BLT_FALSE);
161 }
162 /* Set Speed. */
163 USBD_LL_SetSpeed((USBD_HandleTypeDef*)hpcd->pData, speed);
164
165 /* Reset Device. */
166 USBD_LL_Reset((USBD_HandleTypeDef*)hpcd->pData);
167}
USBD_StatusTypeDef USBD_LL_Reset(USBD_HandleTypeDef *pdev)
USBD_StatusTypeDef USBD_LL_SetSpeed(USBD_HandleTypeDef *pdev, USBD_SpeedTypeDef speed)

Referenced by USBD_LL_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCD_ResumeCallback()

static void PCD_ResumeCallback ( PCD_HandleTypeDef *  hpcd)
static

Resume callback. When Low power mode is enabled the debug cannot be used (IAR, Keil doesn't support it)

Parameters
hpcdPCD handle
Return values
None

Definition at line 203 of file usbd_conf.c.

207{
208 /* USER CODE BEGIN 3 */
209 /* Inform application that the USB left low power mode. */
211 /* USER CODE END 3 */
212 USBD_LL_Resume((USBD_HandleTypeDef*)hpcd->pData);
213}
USBD_StatusTypeDef USBD_LL_Resume(USBD_HandleTypeDef *pdev)
void UsbLeaveLowPowerModeHook(void)
Callback that gets called whenever the USB host requests the device to exit low power mode.
Definition hooks.c:156

Referenced by USBD_LL_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCD_SetupStageCallback()

static void PCD_SetupStageCallback ( PCD_HandleTypeDef *  hpcd)
static

Setup stage callback.

Parameters
hpcdPCD handle
Return values
None

Definition at line 85 of file usbd_conf.c.

89{
90 USBD_LL_SetupStage((USBD_HandleTypeDef*)hpcd->pData, (uint8_t *)hpcd->Setup);
91}
USBD_StatusTypeDef USBD_LL_SetupStage(USBD_HandleTypeDef *pdev, uint8_t *psetup)

Referenced by USBD_LL_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCD_SOFCallback()

static void PCD_SOFCallback ( PCD_HandleTypeDef *  hpcd)
static

SOF callback.

Parameters
hpcdPCD handle
Return values
None

Definition at line 129 of file usbd_conf.c.

133{
134 USBD_LL_SOF((USBD_HandleTypeDef*)hpcd->pData);
135}
USBD_StatusTypeDef USBD_LL_SOF(USBD_HandleTypeDef *pdev)

Referenced by USBD_LL_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCD_SuspendCallback()

static void PCD_SuspendCallback ( PCD_HandleTypeDef *  hpcd)
static

Suspend callback. When Low power mode is enabled the debug cannot be used (IAR, Keil doesn't support it)

Parameters
hpcdPCD handle
Return values
None

Definition at line 176 of file usbd_conf.c.

180{
181 /* Inform USB library that core enters in suspend Mode. */
182 USBD_LL_Suspend((USBD_HandleTypeDef*)hpcd->pData);
183 __HAL_PCD_GATE_PHYCLOCK(hpcd);
184 /* Enter in STOP mode. */
185 /* USER CODE BEGIN 2 */
186 if (hpcd->Init.low_power_enable)
187 {
188 /* Set SLEEPDEEP bit and SleepOnExit of Cortex System Control Register. */
189 SCB->SCR |= (uint32_t)((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk));
190 }
191 /* Inform application that the USB entered low power mode. */
193 /* USER CODE END 2 */
194}
USBD_StatusTypeDef USBD_LL_Suspend(USBD_HandleTypeDef *pdev)
void UsbEnterLowPowerModeHook(void)
Callback that gets called whenever the USB host requests the device to enter a low power mode.
Definition hooks.c:144

Referenced by USBD_LL_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SystemClock_Config()

void SystemClock_Config ( void  )

◆ USBD_Get_USB_Status()

USBD_StatusTypeDef USBD_Get_USB_Status ( HAL_StatusTypeDef  hal_status)

Retuns the USB status depending on the HAL status:

Parameters
hal_statusHAL status
Return values
USBstatus

Definition at line 580 of file usbd_conf.c.

581{
582 USBD_StatusTypeDef usb_status = USBD_OK;
583
584 switch (hal_status)
585 {
586 case HAL_OK :
587 usb_status = USBD_OK;
588 break;
589 case HAL_ERROR :
590 usb_status = USBD_FAIL;
591 break;
592 case HAL_BUSY :
593 usb_status = USBD_BUSY;
594 break;
595 case HAL_TIMEOUT :
596 usb_status = USBD_FAIL;
597 break;
598 default :
599 usb_status = USBD_FAIL;
600 break;
601 }
602 return usb_status;
603}

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().

Here is the caller graph for this function:

Variable Documentation

◆ epnum

static void uint8_t epnum
Initial value:
{
USBD_LL_DataOutStage((USBD_HandleTypeDef*)hpcd->pData, epnum, hpcd->OUT_ep[epnum].xfer_buff)
USBD_StatusTypeDef USBD_LL_DataOutStage(USBD_HandleTypeDef *pdev, uint8_t epnum, uint8_t *pdata)
static void uint8_t epnum
Definition usbd_conf.c:104

Definition at line 102 of file usbd_conf.c.

Referenced by PCD_DataInStageCallback(), PCD_ISOINIncompleteCallback(), PCD_ISOOUTIncompleteCallback(), and USBD_Bulk_DataOut().

◆ hpcd_USB_OTG_FS

PCD_HandleTypeDef hpcd_USB_OTG_FS

Definition at line 54 of file usbd_conf.c.

Referenced by USBD_LL_Init().

Go to the source code of this file.