void InitGpio(void)
{
// Set GPIO A port pins,AL(Bits 7:0)(input)-AH(Bits 15:8) (output) 8bits
// Input Qualifier =0, none
EALLOW;
//EVA配置
GpioMuxRegs.GPAMUX.all=0x0f0f; // 配置PWM1,PWM2,PWM3,PWM4,QEP1,QEP2等的功能口
GpioMuxRegs.GPAQUAL.all=0x0000; // Input qualifier disabled
//配置刹车,方向控制信号
GpioMuxRegs.GPBMUX.all = 0x0000; //配置为I/O口
// GpioMuxRegs.GPBMUX.bit.PWM7_GPIOB0 = 0; //配置为I/O口
// GpioMuxRegs.GPBMUX.bit.PWM8_GPIOB1 = 0;
// GpioMuxRegs.GPBDIR.bit.GPIOB0 = 1; //输出引脚,电机刹车控制,break
// GpioMuxRegs.GPBDIR.bit.GPIOB1 = 1; //输出引脚,电机方向控制,dir
GpioMuxRegs.GPBDIR.all = 0xffff; //配置为输出引脚
GpioMuxRegs.GPBQUAL.all=0x0000; // Input qualifier disabled
EDIS;
GpioDataRegs.GPBDAT.all = 0xff00; //高8位为DA输出控制制动器
} |