Skip to main content
Visitor II
January 23, 2020
Question

hi iam doing usb otg in stm32 f107 ,i had a reference code with me which is working good , iam able to do all USB operations properly wit that code ,but when am trying to understand the code USB DM,DP,USB_ID ,V-BUS are not defined in pin configuratio

  • January 23, 2020
  • 0 replies
  • 435 views
void USB_OTG_BSP_Init(void)
{
 GPIO_InitTypeDef GPIO_InitStructure;
 
 /* Select USBCLK source */
 RCC_OTGFSCLKConfig(RCC_OTGFSCLKSource_PLLVCO_Div3);
 
 /* Enable the USB clock */ 
 RCC_AHBPeriphClockCmd(RCC_AHBPeriph_OTG_FS, ENABLE) ;
 
 RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOC| RCC_APB2Periph_GPIOB| RCC_APB2Periph_GPIOA, ENABLE); 		
 
#ifdef SOF_OUTPUT_ENABLED
 /* To enable SOF pulse out on PAD */
 
 
 
 /* Configure SOF Pin */
 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;
 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
 GPIO_Init( GPIOA, &GPIO_InitStructure);
#endif 
 
 
 
			 
 
}

is it possible to use a peripheral without configuring the GPIO pins assigned to it ?

    This topic has been closed for replies.