📄 isr_config.c
字号:
/******************************************************************************/
//
// Name: BF533 EZ-KIT Interrupt Setup
//
/******************************************************************************
(C) Copyright 2003 - Analog Devices, Inc. All rights reserved.
File Name: ISR_Config.c
Date Modified: 10/25/04 TL Rev 0.2
Software: VisualDSP++3.1
Hardware: ADSP-BF533 EZ-KIT Board
Special Connections: None
Purpose: The file sets up all interrupts required
*********************************************************************************/
#include <services/services.h> // system service includes
#include <cdefBF533.h>
#include <sys\exception.h> //Interrupt Handling Header
#include <stdio.h>
#include "ezkitutilities.h"
#define FLAG_PERIPHERAL_DMA_ID (ADI_INT_DMA0_PPI)
#define FLAG_PERIPHERAL_ID (ADI_INT_PFA)
//#define
//#define FLAG_PERIPHERAL_ID (ADI_INT_DMA0_PPI)
//#define StartAddr ((volatile unsigned short *)0x00000000)
//#define Start ((volatile unsigned short *)0x00006000)
//#define Ep2_Addr ((volatile unsigned short *)0x20300000)
//#define Ep6_Addr ((volatile unsigned short *)0x20300000)
extern int TransFlag_1=1;
//volatile unsigned short * pRec=Ep6_Addr;
//volatile unsigned short pStart=Start;
//volatile unsigned short pStartAddr=StartAddr;
//volatile unsigned short * pTransAddr;
static u8 IntMgrData[(ADI_INT_SECONDARY_MEMORY)];
EX_INTERRUPT_HANDLER(PF1_ISR)
{
// adi_int_SICDisable(FLAG_PERIPHERAL_ID);
// adi_int_ClearIMaskBits(19);
int nBytes;
int i = 1;
int j=2;
volatile unsigned short * p;
volatile unsigned char * pChar;
*pSIC_IMASK=0x00000000;
ezDelay(500);
adi_flag_Clear(ADI_FLAG_PF8);
//turn on all the led
printf("\n Interrupt entry!\n");
// for(i=0;i<18;i++)
// {
ezCycleLEDs();
// }
// adi_int_SICEnable(FLAG_PERIPHERAL_ID);
// ezDisableButtonInterrupt(4);
nBytes=720*525;
// nBytes=20000;
// p=pStartAddr;
// pChar=pStart;
// p = (unsigned short *) 0x00;
/* for (i=0;i<10000;i++)
{
// *pChar=i;
// pChar++;
*p=i;
//if (i%2)
p++;
}
*/
pTransAddr = Ep2_Addr;
p=pStartAddr;
// pChar=pStart;
/* for (i=0;i<nBytes;i++)
{
* pTransAddr = * pChar;
pChar ++;
for (j=0;j<4;j++)
{
}
}
*/
p = (unsigned short *) 0x00;
Trans_Ram(p,nBytes,TransFlag_1);
// printf("\n short is tranfered \n");
/* if (*pFIO_FLAG_D&&PF1)
{
printf("\nPF1 is high voltage\n");
*pFIO_FLAG_C&=PF1;
} else {
*p=*pRec;
p++;
}*/
// Trans_Ram(pChar,nBytes,TransFlag_1);
printf("\n Interrupt pF1 had been done !\n");
*pSIC_IMASK=0x00080000; //enable pf1 interrupt again
// return stating that we processed the interrupt
//pSIC_IMASK=0x00000100;
// *pDMA0_CONFIG = 0x1;
return(ADI_INT_RESULT_PROCESSED);
}
/*
EX_INTERRUPT_HANDLER(DMA0_PPI_ISR) // <--|declaration in exception.h -->
{ // |declaration with _pragma(interrupt) the ISR Startaddress
//disable the interrupt request
*pDMA0_IRQ_STATUS = 0x1;
*pSIC_IMASK=0x00080000;
printf( "\nThe DMA0 PPI Interrupt has been entered!\n" );
}//end DMA0_PPI_ISR
*/
void Init_Interrupts(void)
{
u32 ResponseCount;
u32 i; // counter
u32 IVG; // IVG
u8 j;
ezConfigureFlashA();
for ( j = 4; j <= 7; j++) {
ezEnableButtonInterrupt(j);
}
//ezErrorCheck(adi_int_Init(IntMgrData, sizeof(IntMgrData), &ResponseCount, NULL));
ezErrorCheck(adi_int_Init(NULL, 0, &i, NULL));
ezInitButtons();
ezErrorCheck(adi_int_SICGetIVG(FLAG_PERIPHERAL_ID, &IVG));
// hook our interrupt handler into the IVG for the programmable flags
ezErrorCheck(adi_int_CECHook(IVG,PF1_ISR, NULL, FALSE));
// configure the SIC to pass flag interrupts to the CEC
ezErrorCheck(adi_int_SICEnable(FLAG_PERIPHERAL_ID));
// initialize the buttons (which are connected to the flag pins of the processor)
// (this only has to be done once but may be repeated for demonstration purposes)
//ezInitButtons();
// find out which IVG the flags are mapped into
// ezErrorCheck(adi_int_SICGetIVG(FLAG_PERIPHERAL_DMA_ID, &IVG));
// hook our interrupt handler into the IVG for the programmable flags
// ezErrorCheck(adi_int_CECHook(IVG,DMA0_PPI_ISR, NULL, FALSE));
// configure the SIC to pass flag interrupts to the CEC
// ezErrorCheck(adi_int_SICEnable(FLAG_PERIPHERAL_DMA_ID));
/* *pSIC_IAR0 = *pSIC_IAR0 & 0xffffffff | 0x00000000;
*pSIC_IAR1 = *pSIC_IAR1 & 0xffffffff | 0x00000001; // map DMA0 PPI Interrupt -> IVG8
*pSIC_IAR2 = *pSIC_IAR2 & 0xffffffff | 0x00005000;
register_handler(ik_ivg8, DMA0_PPI_ISR); // assign DMA0 PPI ISR to interrupt vector 8
register_handler(ik_ivg12, PF1_ISR);
*pSIC_IMASK=0x00080100; // all interrupts 0=disabled but DMA0 PPI interrupt enabled
*/
printf("interrupt ini over\n");
}//end Init_Interrupts
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -