📄 dspint.h
字号:
//////////////////////////////////////////////////////////////////////////
// Copyright (C) 2004, Eyoka @ Microunit
// All Rights Reserved
//________________________________________________________________________
//
// FILENAME: dspint.h
// PROJECT: High-Resolution Video System On OMAP
// MODULE: DSP System
// DESCRIPTION: DSP Interrupt support.
// TARGET CPU: DSP-C55xx of OMAP5910
// VERSION: 1.1
//________________________________________________________________________
//
// REVISE HISTORY
// DATE VERSION AUTHOR DESCRIPTION
// 2004-10-13 1.1 Eyoka Modify small functions as inline.
// 2004-10-13 1.0 Eyoka First release.
//////////////////////////////////////////////////////////////////////////
#ifndef _DSPINT_H_
#define _DSPINT_H_
#include "datatypes.h"
/////////////////////////////////////////////////////////////////////
// INTERRUPT REGISTERS
/////////////////////////////////////////////////////////////////////
#define INT_IVPD REG16(0x000049)
#define INT_IVPH REG16(0x00004A)
#define INT_IFR0 REG16(0x000001)
#define INT_IFR1 REG16(0x000046)
#define INT_IER0 REG16(0x000000)
#define INT_IER1 REG16(0x000045)
/////////////////////////////////////////////////////////////////////
// INTERRUPT EVENTS
/////////////////////////////////////////////////////////////////////
#define INT_EVT_EMU 2
#define INT_EVT_LEVEL2 3
#define INT_EVT_TCABORT 4
#define INT_EVT_MAILBOX1 5
// RESERVED 6
#define INT_EVT_GPIO 7
#define INT_EVT_TIMER3 8
#define INT_EVT_DMA1 9
#define INT_EVT_MPU 10
// RESERVED 11
#define INT_EVT_UART 12
#define INT_EVT_WDGTIMER 13
#define INT_EVT_DMA4 14
#define INT_EVT_DMA5 15
#define INT_EVT_EMIF 16
#define INT_EVT_LOCALBUS 17
#define INT_EVT_DMA0 18
#define INT_EVT_MAILBOX2 19
#define INT_EVT_DMA2 20
#define INT_EVT_DMA3 21
#define INT_EVT_TIMER2 22
#define INT_EVT_TIMER1 23
/////////////////////////////////////////////////////////////////////
// INTERRUPT FUNCTIONS
/////////////////////////////////////////////////////////////////////
//___________________________________________________________________
// Function: INT_GlobalEnable
// Usage: Enable all maskable interrupts
// Parameters:
// N/A
// Return Values:
// N/A
//___________________________________________________________________
//
inline void INT_GlobalEnable(void)
{
asm(" BCLR INTM");
}
//___________________________________________________________________
// Function: INT_GlobalDisable
// Usage: Disable all maskable interrupts
// Parameters:
// N/A
// Return Values:
// N/A
//___________________________________________________________________
//
inline void INT_GlobalDisable(void)
{
asm(" BSET INTM");
}
//___________________________________________________________________
// Function: INT_Enable
// Usage: Enable the specified event in the IER0/1 register flags.
// Parameters:
// event - INT#
// Return Values:
// N/A
//___________________________________________________________________
//
void INT_Enable(WORD event);
//___________________________________________________________________
// Function: INT_Disable
// Usage: Disable the specified event in the IER0/1 register flags.
// Parameters:
// event - INT#
// Return Values:
// N/A
//___________________________________________________________________
//
void INT_Disable(WORD event);
//___________________________________________________________________
// Function: INT_EnableAll
// Usage: Mask all interrputs.
// Parameters:
// N/A
// Return Values:
// N/A
//___________________________________________________________________
//
inline void INT_EnableAll(void)
{
INT_IER0 |= 0xFFFC;
INT_IER1 |= 0x07FF;
}
//___________________________________________________________________
// Function: INT_DisableAll
// Usage: Unmask all interrputs.
// Parameters:
// N/A
// Return Values:
// N/A
//___________________________________________________________________
//
inline void INT_DisableAll(void)
{
INT_IER0 &= 0x0003;
INT_IER1 &= 0xF800;
}
//___________________________________________________________________
// Function: INT_IVT_Move
// Usage: Set Interrupt Vector Table position.
// Parameters:
// ivpDSP - DSP IVT, BYTE address
// ivpHost - ARM IVT, BYTE address
// Return Values:
// N/A
//___________________________________________________________________
//
inline void INT_IVT_Move(DWORD ivpDSP, DWORD ivpHost)
{
INT_IVPD = (WORD)(ivpDSP>>8);
INT_IVPH = (WORD)(ivpHost>>8);
}
//___________________________________________________________________
// Function: INT_IVT_Insert
// Usage: Insert a new entry to Interrupt Vector Table.
// Parameters:
// event - INT#
// addrISR - BYTE address of the Interrupt Service Routine
// Return Values:
// N/A
//___________________________________________________________________
//
void INT_IVT_Insert(WORD event, DWORD addrISR);
#endif // ifndef _DSPINT_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -