在28377的例程中,有部分关于CLA的初始化代码,其中不明白Cla1Task1和cla1Isr1的区别,代码如下:

void CLA_initCpu1Cla1(void)

{

// Compute all CLA task vectors

// On Type-1 CLAs the MVECT registers accept full 16-bit task addresses as

// opposed to offsets used on older Type-0 CLAs

EALLOW;

Cla1Regs.MVECT1 = (uint16_t)(&Cla1Task1);

Cla1Regs.MVECT2 = (uint16_t)(&Cla1Task2);

Cla1Regs.MVECT3 = (uint16_t)(&Cla1Task3);

Cla1Regs.MVECT4 = (uint16_t)(&Cla1Task4);

Cla1Regs.MVECT5 = (uint16_t)(&Cla1Task5);

Cla1Regs.MVECT6 = (uint16_t)(&Cla1Task6);

Cla1Regs.MVECT7 = (uint16_t)(&Cla1Task7);

Cla1Regs.MVECT8 = (uint16_t)(&Cla1Task8);

// Enable the IACK instruction to start a task on CLA in software

// for all 8 CLA tasks. Also, globally enable all 8 tasks (or a

// subset of tasks) by writing to their respective bits in the

// MIER register

Cla1Regs.MCTL.bit.IACKE = 1;

Cla1Regs.MIER.all = (M_INT8 | M_INT7);

// Configure the vectors for the end-of-task interrupt for all

// 8 tasks

PieVectTable.CLA1_1_INT = &cla1Isr1;

PieVectTable.CLA1_2_INT = &cla1Isr2;

PieVectTable.CLA1_3_INT = &cla1Isr3;

PieVectTable.CLA1_4_INT = &cla1Isr4;

PieVectTable.CLA1_5_INT = &cla1Isr5;

PieVectTable.CLA1_6_INT = &cla1Isr6;

PieVectTable.CLA1_7_INT = &cla1Isr7;

PieVectTable.CLA1_8_INT = &cla1Isr8;

// Set the adca.1 as the trigger for task 7

DmaClaSrcSelRegs.CLA1TASKSRCSEL2.bit.TASK7 = CLAINTSRCSEL;

// Enable CLA interrupts at the group and subgroup levels

PieCtrlRegs.PIEIER11.all = 0xFFFF;

IER |= (M_INT11 );

EDIS;

}

更多推荐