Example #1
0
/**
  * @brief  Stops the Low Level portion of the Device driver.
  * @param  pdev: Device handle
  * @retval USBD Status
  */
USBD_StatusTypeDef USBD_LL_Stop(USBD_HandleTypeDef *pdev)
{
	HAL_PCD_Stop(pdev->pData);
	//ui_led_ctl( &ui_led_usb, UI_LED_MODE_OFF );

	return USBD_OK;
}
/**
  * @brief  Stops the Low Level portion of the Device driver.
  * @param  pdev: Device handle
  * @retval USBD Status
  */
USBD_StatusTypeDef  USBD_LL_Stop (USBD_HandleTypeDef *pdev)
{
  HAL_StatusTypeDef hal_status = HAL_OK;
  USBD_StatusTypeDef usb_status = USBD_OK;
 
  hal_status = HAL_PCD_Stop(pdev->pData);
     
  switch (hal_status) {
    case HAL_OK :
      usb_status = USBD_OK;
    break;
    case HAL_ERROR :
      usb_status = USBD_FAIL;
    break;
    case HAL_BUSY :
      usb_status = USBD_BUSY;
    break;
    case HAL_TIMEOUT :
      usb_status = USBD_FAIL;
    break;
    default :
      usb_status = USBD_FAIL;
    break;
  }
  return usb_status; 
}
Example #3
0
File: usbc.c Project: Gitsyshk/lk
status_t usbc_set_active(bool active)
{
    LTRACEF("active %u\n", active);

    if (active) {
        HAL_PCD_Start(&usbc.handle);
    } else {
        HAL_PCD_Stop(&usbc.handle);
    }

    return NO_ERROR;
}
Example #4
0
/**
  * @brief  DeInitializes the PCD peripheral 
  * @param  hpcd: PCD handle
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_PCD_DeInit(PCD_HandleTypeDef * hpcd)
{
	/* Check the PCD handle allocation */
	if (hpcd == NULL) {
		return HAL_ERROR;
	}

	hpcd->State = PCD_BUSY;

	/* Stop Device */
	HAL_PCD_Stop(hpcd);

	/* DeInit the low level hardware */
	HAL_PCD_MspDeInit(hpcd);

	hpcd->State = PCD_READY;

	return HAL_OK;
}
Example #5
0
/**
  * @brief  Stops the Low Level portion of the Device driver.
  * @param  pdev: Device handle
  * @retval USBD Status
  */
USBD_StatusTypeDef USBD_LL_Stop(USBD_HandleTypeDef *pdev)
{
  HAL_PCD_Stop(pdev->pData);
  return USBD_OK;
}