xref: /btstack/port/stm32-f4discovery-usb/USB_HOST/Target/usbh_platform.c (revision a8f7f3fcbcd51f8d2e92aca076b6a9f812db358c)
1 /* USER CODE BEGIN Header */
2 /**
3   ******************************************************************************
4   * @file           : usbh_platform.c
5 
6   * @brief          : This file implements the USB platform
7   ******************************************************************************
8   * @attention
9   *
10   * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
11   * All rights reserved.</center></h2>
12   *
13   * This software component is licensed by ST under Ultimate Liberty license
14   * SLA0044, the "License"; You may not use this file except in compliance with
15   * the License. You may obtain a copy of the License at:
16   *                             www.st.com/SLA0044
17   *
18   ******************************************************************************
19   */
20 /* USER CODE END Header */
21 
22 /* Includes ------------------------------------------------------------------*/
23 #include "usbh_platform.h"
24 
25 /* USER CODE BEGIN INCLUDE */
26 
27 /* USER CODE END INCLUDE */
28 
29 /**
30   * @brief  Drive VBUS.
31   * @param  state : VBUS state
32   *          This parameter can be one of the these values:
33   *           - 1 : VBUS Active
34   *           - 0 : VBUS Inactive
35   */
MX_DriverVbusFS(uint8_t state)36 void MX_DriverVbusFS(uint8_t state)
37 {
38   uint8_t data = state;
39   /* USER CODE BEGIN PREPARE_GPIO_DATA_VBUS_FS */
40   if(state == 0)
41   {
42     /* Drive high Charge pump */
43     data = GPIO_PIN_SET;
44   }
45   else
46   {
47     /* Drive low Charge pump */
48     data = GPIO_PIN_RESET;
49   }
50   /* USER CODE END PREPARE_GPIO_DATA_VBUS_FS */
51   HAL_GPIO_WritePin(GPIOC,GPIO_PIN_0,(GPIO_PinState)data);
52 }
53 
54 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
55