|
以下这段是void InitECanbGpio(void)中的代码,为什么要对选定的引脚进行使能上拉呢?不同步为什么只对CANRXB引脚?
//对于选定的引脚使能内部上拉
GpioCtrlRegs.GPAPUD.bit.GPIO16 = 0; // Enable pull-up for GPIO16 (CANTXB)
GpioCtrlRegs.GPAPUD.bit.GPIO17 = 0; // Enable pull-up for GPIO17 (CANRXB)
//配置GPIO PORT A选择限制2寄存器 不同步
GpioCtrlRegs.GPAQSEL2.bit.GPIO17 = 3; // Asynch qual for GPIO17 (CANRXB)
//配置GPIO为CAN引脚
GpioCtrlRegs.GPAMUX2.bit.GPIO16 = 2; // Configure GPIO16 for CANTXB operation
GpioCtrlRegs.GPAMUX2.bit.GPIO17 = 2; // Configure GPIO17 for CANRXB operation
|
|