This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

请教TI工程师,TI异步电机控制例程F281XACI33中,f281x_en.c源程序模块的作用?



请问,在中断函数中以下语句的作用?

// ------------------------------------------------------------------------------
// Connect inputs of the EN_DRV module and call the enable/disable PWM signal
// update function. (FOR DMC1500 ONLY)
// ------------------------------------------------------------------------------
drv1.EnableFlag = EnableFlag;
drv1.update(&drv1);


 F281X_EN.C源程序如下

#include "DSP281x_Device.h"
#include "f281x_en.h"

void F281X_EV1_DRIVE_Init(DRIVE *p)
{
// IOPB4: strobe_ (T1PWM_GPIOA6); IO PB6: enable_ (TDIRA_GPIOA11)
EALLOW; // Enable EALLOW
GpioMuxRegs.GPAMUX.bit.T1PWM_GPIOA6 = 0;
GpioMuxRegs.GPAMUX.bit.TDIRA_GPIOA11 = 0;

// config IOPB4 & IOPB6 as outputs and output "1" to disable drive
GpioMuxRegs.GPADIR.bit.GPIOA6 = 1;
GpioMuxRegs.GPADIR.bit.GPIOA11 = 1;
EDIS; // Disable EALLOW

}

void F281X_EV1_DRIVE_Update(DRIVE *p)
{
if (p->EnableFlag==1) // Enable PWM drive on DMC1500
{
GpioDataRegs.GPADAT.bit.GPIOA6 = 0; // IOPB4 low (T1PWM_GPIOA6)
GpioDataRegs.GPADAT.bit.GPIOA6 = 1; // IOPB4 high (T1PWM_GPIOA6)
GpioDataRegs.GPADAT.bit.GPIOA11 = 0; // IOPB6 low (T1PWM_GPIOA11)
}
else if (p->EnableFlag==0) // Disable PWM drive on DMC1500
{
GpioDataRegs.GPADAT.all |= 0x0840; // IOPB4 (T1PWM_GPIOA6) & IOPB6 (T1PWM_GPIOA11) outputs high
}

}

请问,我如果将TI的例程移值到另外一块开发板上,这段程序是否要加入?还是说要做一些改动?谢谢