新手上路
- 积分
- 34
- 金钱
- 34
- 注册时间
- 2016-8-17
- 在线时间
- 6 小时
|
1金钱
在usbd_cdc_vcp.c这个文件中,
static uint16_t VCP_Init(void)
{
NVIC_InitTypeDef NVIC_InitStructure;
/* EVAL_COM1 default configuration */
/* EVAL_COM1 configured as follow:
- BaudRate = 115200 baud
- Word Length = 8 Bits
- One Stop Bit
- Parity Odd
- Hardware flow control disabled
- Receive and transmit enabled
*/
USART_InitStructure.USART_BaudRate = 115200;
USART_InitStructure.USART_WordLength = USART_WordLength_8b;
USART_InitStructure.USART_StopBits = USART_StopBits_1;
USART_InitStructure.USART_Parity = USART_Parity_Odd;
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
/* Configure and enable the USART */
STM_EVAL_COMInit(COM1, &USART_InitStructure);
/* Enable the USART Receive interrupt */
USART_ITConfig(EVAL_COM1, USART_IT_RXNE, ENABLE);
/* Enable USART Interrupt */
NVIC_InitStructure.NVIC_IRQChannel = EVAL_COM1_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
return USBD_OK;
}
这个初始化的是哪个串口呀?
/* Configure and enable the USART */
STM_EVAL_COMInit(COM1, &USART_InitStructure);
/* Enable the USART Receive interrupt */
USART_ITConfig(EVAL_COM1, USART_IT_RXNE, ENABLE);
定义都找不到,是初始化的虚拟串口还是实际的串口呀?
|
|