You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.5 KiB
52 lines
1.5 KiB
/* USER CODE BEGIN Header */ |
|
/** |
|
****************************************************************************** |
|
* @file : usbh_platform.c |
|
|
|
* @brief : This file implements the USB platform |
|
****************************************************************************** |
|
* @attention |
|
* |
|
* Copyright (c) 2022 STMicroelectronics. |
|
* All rights reserved. |
|
* |
|
* This software is licensed under terms that can be found in the LICENSE file |
|
* in the root directory of this software component. |
|
* If no LICENSE file comes with this software, it is provided AS-IS. |
|
* |
|
****************************************************************************** |
|
*/ |
|
/* USER CODE END Header */ |
|
|
|
/* Includes ------------------------------------------------------------------*/ |
|
#include "usbh_platform.h" |
|
|
|
/* USER CODE BEGIN INCLUDE */ |
|
|
|
/* USER CODE END INCLUDE */ |
|
|
|
/** |
|
* @brief Drive VBUS. |
|
* @param state : VBUS state |
|
* This parameter can be one of the these values: |
|
* - 1 : VBUS Active |
|
* - 0 : VBUS Inactive |
|
*/ |
|
void MX_DriverVbusFS(uint8_t state) |
|
{ |
|
uint8_t data = state; |
|
/* USER CODE BEGIN PREPARE_GPIO_DATA_VBUS_FS */ |
|
if(state == 0) |
|
{ |
|
/* Drive high Charge pump */ |
|
data = GPIO_PIN_RESET; |
|
} |
|
else |
|
{ |
|
/* Drive low Charge pump */ |
|
data = GPIO_PIN_SET; |
|
} |
|
/* USER CODE END PREPARE_GPIO_DATA_VBUS_FS */ |
|
HAL_GPIO_WritePin(GPIOB,GPIO_PIN_2,(GPIO_PinState)data); |
|
} |
|
|
|
|