Subversion Repositories DashDisplay

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 5
Line 1... Line 1...
1
/**
1
/**
2
  ******************************************************************************
2
  ******************************************************************************
3
  * @file    stm32f1xx_ll_usb.c
3
  * @file    stm32f1xx_ll_usb.c
4
  * @author  MCD Application Team
4
  * @author  MCD Application Team
5
  * @version V1.0.1
5
  * @version V1.0.4
6
  * @date    31-July-2015
6
  * @date    29-April-2016
7
  * @brief   USB Low Layer HAL module driver.
7
  * @brief   USB Low Layer HAL module driver.
8
  *
8
  *
9
  *          This file provides firmware functions to manage the following
9
  *          This file provides firmware functions to manage the following
10
  *          functionalities of the USB Peripheral Controller:
10
  *          functionalities of the USB Peripheral Controller:
11
  *           + Initialization/de-initialization functions
11
  *           + Initialization/de-initialization functions
Line 26... Line 26...
26
 
26
 
27
  @endverbatim
27
  @endverbatim
28
  ******************************************************************************
28
  ******************************************************************************
29
  * @attention
29
  * @attention
30
  *
30
  *
31
  * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
31
  * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
32
  *
32
  *
33
  * Redistribution and use in source and binary forms, with or without modification,
33
  * Redistribution and use in source and binary forms, with or without modification,
34
  * are permitted provided that the following conditions are met:
34
  * are permitted provided that the following conditions are met:
35
  *   1. Redistributions of source code must retain the above copyright notice,
35
  *   1. Redistributions of source code must retain the above copyright notice,
36
  *      this list of conditions and the following disclaimer.
36
  *      this list of conditions and the following disclaimer.
Line 203... Line 203...
203
    USBx->DIEPTXF[index] = 0;
203
    USBx->DIEPTXF[index] = 0;
204
  }
204
  }
205
 
205
 
206
  /*Activate VBUS Sensing B */
206
  /*Activate VBUS Sensing B */
207
  USBx->GCCFG |= USB_OTG_GCCFG_VBUSBSEN;
207
  USBx->GCCFG |= USB_OTG_GCCFG_VBUSBSEN;
208
 
-
 
209
  if (cfg.vbus_sensing_enable == 0)
-
 
210
  {
-
 
211
    USBx->GCCFG |= USB_OTG_GCCFG_NOVBUSSENS;
-
 
212
  }
-
 
213
 
208
 
214
  /* Restart the Phy Clock */
209
  /* Restart the Phy Clock */
215
  USBx_PCGCCTL = 0;
210
  USBx_PCGCCTL = 0;
216
 
211
 
217
  /* Device mode configuration */
212
  /* Device mode configuration */
218
  USBx_DEVICE->DCFG |= DCFG_FRAME_INTERVAL_80;
213
  USBx_DEVICE->DCFG |= DCFG_FRAME_INTERVAL_80;
Line 937... Line 932...
937
  USBx_PCGCCTL = 0;
932
  USBx_PCGCCTL = 0;
938
 
933
 
939
  /* no VBUS sensing*/
934
  /* no VBUS sensing*/
940
  USBx->GCCFG &=~ (USB_OTG_GCCFG_VBUSASEN);
935
  USBx->GCCFG &=~ (USB_OTG_GCCFG_VBUSASEN);
941
  USBx->GCCFG &=~ (USB_OTG_GCCFG_VBUSBSEN);
936
  USBx->GCCFG &=~ (USB_OTG_GCCFG_VBUSBSEN);
942
  USBx->GCCFG |= USB_OTG_GCCFG_NOVBUSSENS;
-
 
943
 
937
 
944
  /* Disable the FS/LS support mode only */
938
  /* Disable the FS/LS support mode only */
945
  if((cfg.speed == USB_OTG_SPEED_FULL)&&
939
  if((cfg.speed == USB_OTG_SPEED_FULL)&&
946
     (USBx != USB_OTG_FS))
940
     (USBx != USB_OTG_FS))
947
  {
941
  {