在线时间2 小时
UID93117
ST金币0
蝴蝶豆0
注册时间2008-11-20
新手上路
- 最后登录
- 2020-11-14
|
a0a.1 0b0c
我使用STM32F103C8T6这颗料来学习USB,其中PA11为UART1_CTS/CANRX/USBDM,PA12为USART1_RTS/CANTX/USB_DP.我想知道的是怎么设置才能将这二个IO设置为USB口.我看了一下网上提供的例程,一直没搞明白.例程中并没有对IO进行设置,只是对USB的中断进行了设置,难道这样IO的功能就使能为USB的D+和D-了吗?
例程中为:
NVIC_InitStructure.NVIC_IRQChannel = USB_LP_CAN_RX0_IRQChannel;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
NVIC_InitStructure.NVIC_IRQChannel = USB_HP_CAN_TX_IRQChannel;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
|
|