// Soc Generate
EPwm1Regs.ETSEL.bit.SOCBSEL = ET_CTR_PRD;
EPwm1Regs.ETSEL.bit.SOCBEN = 1;
EPwm1Regs.ETPS.bit.SOCBPRD = ET_1ST;
//init soc gpio10
EALLOW;
GpioCtrlRegs.GPAGMUX1.bit.GPIO10 = 0; // Configure GPIO10 as ADCSOCBO
GpioCtrlRegs.GPAMUX1.bit.GPIO10 = 3; // Configure GPIO10 as ADCSOCBO
EDIS;
Susan Yang:
不是直接输出的,还是需要配置的。
您需要设置ADCSOCOUTSELECT等,您可以参考一下下面的代码
//ADCSOCBOTrigRegs.ADCSOCOUTSELECT.bit.PWM7SOCBEN = 1;GpioCtrlRegs.GPAMUX1.bit.GPIO10 = 3;GpioCtrlRegs.GPAGMUX1.bit.GPIO10 = 0;GpioCtrlRegs.GPADIR.bit.GPIO10 = dGPIO_DIR_OUT;GpioCtrlRegs.GPAPUD.bit.GPIO10 = dGPIO_NO_PULL_UP;//Outputbar 6OutputXbarRegs.OUTPUT6MUX0TO15CFG.bit.Mux15 = 0x01;OutputXbarRegs.OUTPUT6MUXENABLE.bit.Mux15 = 1;GpioCtrlRegs.GPAMUX1.bit.GPIO9 = 3;GpioCtrlRegs.GPAGMUX1.bit.GPIO9 = 0;GpioCtrlRegs.GPADIR.bit.GPIO9 = dGPIO_DIR_OUT;GpioCtrlRegs.GPAPUD.bit.GPIO9 = dGPIO_NO_PULL_UP;