📄 defaultisr_nonbios.c
字号:
/**********************************************************************
* File: DefaultIsr_nonBIOS.c
* Devices: TMS320F2808, TMS320F2806, TMS320F2801
* Author: David M. Alter, Texas Instruments Inc.
* History:
* 02/11/05 - original (D. Alter)
**********************************************************************/
#include "DSP280x_Device.h"
#ifdef EXAMPLE_BIOS
#include "example_BIOS.h"
#endif
#ifdef EXAMPLE_NONBIOS
#include "example_nonBIOS.h"
#endif
/*** Global variables used by ADCINT_ISR() ***/
#define ADC_buf_len 50 // ADC buffer length
Uint16 ADC_buf[ADC_buf_len]; // ADC buffer allocation
/*** Global variables used by ECAP1_INT_ISR() ***/
Uint32 PWM_duty; // measured PWM duty cycle
Uint32 PWM_period; // measured PWM period
/*********************************************************************/
interrupt void INT13_ISR(void) // 0x000D1A INT13 - XINT13 (or CPU Timer1, reserved for TI)
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void INT14_ISR(void) // 0x000D1C INT14 - CPU Timer2, reserved for TI
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void DATALOG_ISR(void) // 0x000D1E DATALOG - CPU data logging interrupt
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void RTOSINT_ISR(void) // 0x000D20 RTOSINT - CPU RTOS interrupt
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void EMUINT_ISR(void) // 0x000D22 EMUINT - CPU emulation interrupt
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void NMI_ISR(void) // 0x000D24 NMI - XNMI interrupt
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void ILLEGAL_ISR(void) // 0x000D26 ILLEGAL - illegal operation trap
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void USER1_ISR(void) // 0x000D28 USER1 - software interrupt #1
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void USER2_ISR(void) // 0x000D2A USER2 - software interrupt #2
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void USER3_ISR(void) // 0x000D2C USER3 - software interrupt #3
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void USER4_ISR(void) // 0x000D2E USER4 - software interrupt #4
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void USER5_ISR(void) // 0x000D30 USER5 - software interrupt #5
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void USER6_ISR(void) // 0x000D32 USER6 - software interrupt #6
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void USER7_ISR(void) // 0x000D34 USER7 - software interrupt #7
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void USER8_ISR(void) // 0x000D36 USER8 - software interrupt #8
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void USER9_ISR(void) // 0x000D38 USER9 - software interrupt #9
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void USER10_ISR(void) // 0x000D3A USER10 - software interrupt #10
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void USER11_ISR(void) // 0x000D3C USER11 - software interrupt #11
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void USER12_ISR(void) // 0x000D3E USER12 - software interrupt #12
{
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void SEQ1INT_ISR(void) // 0x000D40 SEQ1INT (ADC SEQ1)
{
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; // Must acknowledge the PIE group
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void SEQ2INT_ISR(void) // 0x000D42 SEQ2INT (ADC SEQ2)
{
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; // Must acknowledge the PIE group
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
// 0x000D44 reserved
/*********************************************************************/
interrupt void XINT1_ISR(void) // 0x000D46 XINT1
{
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; // Must acknowledge the PIE group
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void XINT2_ISR(void) // 0x000D48 XINT2
{
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; // Must acknowledge the PIE group
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void ADCINT_ISR(void) // 0x000D4A ADCINT (ADC)
{
static volatile Uint16 GPIO34_count = 0; // Counter for pin toggle
static Uint16 *ADC_buf_ptr = ADC_buf; // Pointer to buffer
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; // Must acknowledge the PIE group
/*** Manage the ADC registers ***/
AdcRegs.ADCTRL2.bit.RST_SEQ1 = 1; // Reset SEQ1 to CONV00 state
AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1; // Clear ADC SEQ1 interrupt flag
/*** Read the ADC result ***/
*ADC_buf_ptr++ = AdcRegs.ADCRESULT0 >> 4; // Read the result
/*** Brute-force the circular buffer ***/
if( ADC_buf_ptr == (ADC_buf + ADC_buf_len) )
ADC_buf_ptr = ADC_buf; // Rewind the pointer to beginning
/*** Example: Toggle GPIO34, which is connected to the LED on the eZdsp board ***/
if(GPIO34_count++ > 12500) // Toggle slowly to see the LED blink
{
GpioDataRegs.GPBTOGGLE.bit.GPIO34 = 1; // Toggle the pin
GPIO34_count = 0; // Reset the counter
}
}
/*********************************************************************/
interrupt void TINT0_ISR(void) // 0x000D4C TINT0 (CPU TIMER 0)
{
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; // Must acknowledge the PIE group
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void WAKEINT_ISR(void) // 0x000D4E WAKEINT (LPM/WD)
{
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; // Must acknowledge the PIE group
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void EPWM1_TZINT_ISR(void) // 0x000D50 EPWM1_TZINT (EPWM1)
{
PieCtrlRegs.PIEACK.all = PIEACK_GROUP2; // Must acknowledge the PIE group
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void EPWM2_TZINT_ISR(void) // 0x000D52 EPWM2_TZINT (EPWM2)
{
PieCtrlRegs.PIEACK.all = PIEACK_GROUP2; // Must acknowledge the PIE group
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void EPWM3_TZINT_ISR(void) // 0x000D54 EPWM3_TZINT (EPWM3)
{
PieCtrlRegs.PIEACK.all = PIEACK_GROUP2; // Must acknowledge the PIE group
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void EPWM4_TZINT_ISR(void) // 0x000D56 EPWM4_TZINT (EPWM4)
{
PieCtrlRegs.PIEACK.all = PIEACK_GROUP2; // Must acknowledge the PIE group
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void EPWM5_TZINT_ISR(void) // 0x000D58 EPWM5_TZINT (EPWM5)
{
PieCtrlRegs.PIEACK.all = PIEACK_GROUP2; // Must acknowledge the PIE group
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void EPWM6_TZINT_ISR(void) // 0x000D5A EPWM6_TZINT (EPWM6)
{
PieCtrlRegs.PIEACK.all = PIEACK_GROUP2; // Must acknowledge the PIE group
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
// 0x000D5C reserved
// 0x000D5E reserved
/*********************************************************************/
interrupt void EPWM1_INT_ISR(void) // 0x000D60 EPWM1_INT (EPWM1)
{
PieCtrlRegs.PIEACK.all = PIEACK_GROUP3; // Must acknowledge the PIE group
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void EPWM2_INT_ISR(void) // 0x000D62 EPWM2_INT (EPWM2)
{
PieCtrlRegs.PIEACK.all = PIEACK_GROUP3; // Must acknowledge the PIE group
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void EPWM3_INT_ISR(void) // 0x000D64 EPWM3_INT (EPWM3)
{
PieCtrlRegs.PIEACK.all = PIEACK_GROUP3; // Must acknowledge the PIE group
// Next two lines for debug only - remove after inserting your ISR
asm (" ESTOP0"); // Emulator Halt instruction
while(1);
}
/*********************************************************************/
interrupt void EPWM4_INT_ISR(void) // 0x000D66 EPWM4_INT (EPWM4)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -