stm32f407 CAN 配制问题 把pd0 pd1 配制成CAN 怎么都没有数据输出。
GPIO_InitTypeDef GPIO_InitStructure; CAN_InitTypeDef CAN_InitStructure; CAN_FilterInitTypeDef CAN_FilterInitStructure;#if CAN1_RX0_INT_ENABLE NVIC_InitTypeDef NVIC_InitStructure;#endif //使能相关时钟 RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD ENABLE);//使能PORTA时钟 RCC_APB1PeriphClockCmd(RCC_APB1Periph_CAN1 ENABLE);//使能CAN1时钟 //初始化GPIO GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0| GPIO_Pin_1; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;//复用功能 GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;//推挽输出 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;//上拉 GPIO_Init(GPIOD &GPIO_InitStructure);//初始化PA11PA12 //引脚复用映射配置 GPIO_PinAFConfig(GPIODGPIO_PinSource0GPIO_AF_CAN1); //GPIOA11复用为CAN1 GPIO_PinAFConfig(GPIODGPIO_PinSource1GPIO_AF_CAN1); //GPIOA12复用为CAN1