📄 drvsys.h
字号:
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006-2007 MStar Semiconductor, Inc.
// All rights reserved.
//
// Unless otherwise stipulated in writing, any and all information contained
// herein regardless in any format shall remain the sole proprietary of
// MStar Semiconductor Inc. and be kept in strict confidence
// (¨MStar Confidential Information〃) by the recipient.
// Any unauthorized act including without limitation unauthorized disclosure,
// copying, use, reproduction, sale, distribution, modification, disassembling,
// reverse engineering and compiling of the contents of MStar Confidential
// Information is unlawful and strictly prohibited. MStar hereby reserves the
// rights to any and all damages, losses, costs and expenses resulting therefrom.
//
////////////////////////////////////////////////////////////////////////////////
#ifndef _DRVSYS_H_
#define _DRVSYS_H_
#include "debug.h"
#include "DataType.h"
////////////////////////////////////////////////////////////////////////////////
// 8051 Interrupt functions
////////////////////////////////////////////////////////////////////////////////
// R8051XC
#define _GetInt_GLOBAL() (EAL)
#define _GetInt_SERIAL0() (ES0)
#define _GetInt_SERIAL1() (IEN2 & 0x01)
#define _GetInt_TIMER0() (ET0)
#define _GetInt_TIMER1() (ET1)
#define _GetInt_TIMER2() (ET2)
#define _GetInt_TIMER2EX() (EXEN2)
#define _GetInt_EX0() (EX0)
#define _GetInt_EX1() (EX1)
#define _GetInt_EX2() (EX2)
#define _GetInt_EX3() (EX3)
#define _GetInt_EX4() (EX4)
#define _GetInt_EX5() (EX5)
#define _GetInt_EX6() (EX6)
#define _GetInt_EX7() (EX7)
#define _GetInt_EX8() (IEN2 & 0x02)
#define _GetInt_EX9() (IEN2 & 0x04)
#define _GetInt_EX10() (IEN2 & 0x08)
#define _GetInt_EX11() (IEN2 & 0x10)
#define _GetInt_EX12() (IEN2 & 0x20)
#define _SetInt_GLOBAL( bEnable ) (EAL = bEnable)
#define _SetInt_SERIAL0( bEnable ) (ES0 = bEnable)
#define _SetInt_SERIAL1( bEnable ) (IEN2 = ((bEnable) ? (IEN2 | 0x01) : (IEN2 & ~0x01)))
#define _SetInt_TIMER0( bEnable ) (ET0 = bEnable)
#define _SetInt_TIMER1( bEnable ) (ET1 = bEnable)
#define _SetInt_TIMER2( bEnable ) (ET2 = bEnable)
#define _SetInt_TIMER2EX( bEnable ) (EXEN2 = bEnable) // Timer2 external reload
#define _SetInt_EX0( bEnable ) (EX0 = bEnable)
#define _SetInt_EX1( bEnable ) (EX1 = bEnable)
#define _SetInt_EX2( bEnable ) (EX2 = bEnable)
#define _SetInt_EX3( bEnable ) (EX3 = bEnable)
#define _SetInt_EX4( bEnable ) (EX4 = bEnable)
#define _SetInt_EX5( bEnable ) (EX5 = bEnable)
#define _SetInt_EX6( bEnable ) (EX6 = bEnable)
#define _SetInt_EX7( bEnable ) (EX7 = bEnable)
#define _SetInt_EX8( bEnable ) (IEN2 = ((bEnable) ? (IEN2 | 0x02) : (IEN2 & ~0x02)))
#define _SetInt_EX9( bEnable ) (IEN2 = ((bEnable) ? (IEN2 | 0x04) : (IEN2 & ~0x04)))
#define _SetInt_EX10( bEnable ) (IEN2 = ((bEnable) ? (IEN2 | 0x08) : (IEN2 & ~0x08)))
#define _SetInt_EX11( bEnable ) (IEN2 = ((bEnable) ? (IEN2 | 0x10) : (IEN2 & ~0x10)))
#define _SetInt_EX12( bEnable ) (IEN2 = ((bEnable) ? (IEN2 | 0x20) : (IEN2 & ~0x20)))
// EX0
#define _GetInt_EX0_BIT( IntSrc ) (XBYTE[EX0_INT_MASK + (IntSrc / 8)] & (1 << (IntSrc & 0x07)))
#define _GetInt_EX0_TIMER0() _GetInt_EX0_BIT( 0 )
#define _GetInt_EX0_TIMER1() _GetInt_EX0_BIT( 1 )
#define _GetInt_EX0_WDT() _GetInt_EX0_BIT( 2 )
#define _GetInt_EX0_AEON_TO_8051() _GetInt_EX0_BIT( 3 )
#define _GetInt_EX0_8051_TO_AEON() _GetInt_EX0_BIT( 4 )
#define _GetInt_EX0_HDMI_NON_PCM() _GetInt_EX0_BIT( 18 )
#define _GetInt_EX0_SPDIF_IN_NON_PCM() _GetInt_EX0_BIT( 19 )
#define _GetInt_EX0_DMA_DONE() _GetInt_EX0_BIT( 20 )
#define _GetInt_EX0_VSYNC_VE4VBI() _GetInt_EX0_BIT( 21 )
#define _GetInt_EX0_FIELD_VE4VBI() _GetInt_EX0_BIT( 22 )
#define _GetInt_EX0_VDMCU() _GetInt_EX0_BIT( 23 )
#define _GetInt_EX0_CCFL() _GetInt_EX0_BIT( 25 )
#define _GetInt_EX0_INT_IN() _GetInt_EX0_BIT( 26 )
#define _GetInt_EX0_IR() _GetInt_EX0_BIT( 27 )
#define _GetInt_EX0_AFEC_VSYNC() _GetInt_EX0_BIT( 28 )
#define _GetInt_EX0_DSP2IP _GetInt_EX0_BIT( 29 )
#define _GetInt_EX0_EDGE_TRIGGER() _GetInt_EX0_BIT( 31 )
#define _SetInt_EX0_BIT( IntSrc, bEnable ) \
(XBYTE[EX0_INT_MASK + (IntSrc / 8)] = \
((bEnable) ? (XBYTE[EX0_INT_MASK + (IntSrc / 8)] & ~(1 << (IntSrc & 0x07))) : \
(XBYTE[EX0_INT_MASK + (IntSrc / 8)] | (1 << (IntSrc & 0x07)))))
#define _SetInt_EX0_TIMER0( bEnable ) _SetInt_EX0_BIT( 0, bEnable )
#define _SetInt_EX0_TIMER1( bEnable ) _SetInt_EX0_BIT( 1, bEnable )
#define _SetInt_EX0_WDT( bEnable ) _SetInt_EX0_BIT( 2, bEnable )
#define _SetInt_EX0_AEON_TO_8051( bEnable ) _SetInt_EX0_BIT( 3, bEnable )
#define _SetInt_EX0_8051_TO_AEON( bEnable ) _SetInt_EX0_BIT( 4, bEnable )
#define _SetInt_EX0_HDMI_NON_PCM( bEnable ) _SetInt_EX0_BIT( 18, bEnable )
#define _SetInt_EX0_SPDIF_IN_NON_PCM( bEnable ) _SetInt_EX0_BIT( 19, bEnable )
#define _SetInt_EX0_DMA_DONE( bEnable ) _SetInt_EX0_BIT( 20, bEnable )
#define _SetInt_EX0_VSYNC_VE4VBI( bEnable ) _SetInt_EX0_BIT( 21, bEnable )
#define _SetInt_EX0_FIELD_VE4VBI( bEnable ) _SetInt_EX0_BIT( 22, bEnable )
#define _SetInt_EX0_VDMCU( bEnable ) _SetInt_EX0_BIT( 23, bEnable )
#define _SetInt_EX0_CCFL( bEnable ) _SetInt_EX0_BIT( 25, bEnable )
#define _SetInt_EX0_INT_IN( bEnable ) _SetInt_EX0_BIT( 26, bEnable )
#define _SetInt_EX0_IR( bEnable ) _SetInt_EX0_BIT( 27, bEnable )
#define _SetInt_EX0_AFEC_VSYNC( bEnable ) _SetInt_EX0_BIT( 28, bEnable )
#define _SetInt_EX0_DSP2IP( bEnable ) _SetInt_EX0_BIT( 29, bEnable )
#define _SetInt_EX0_EDGE_TRIGGER( bEnable ) _SetInt_EX0_BIT( 31, bEnable )
// EX1
#define _GetInt_EX1_BIT( IntSrc ) (XBYTE[EX1_INT_MASK + (IntSrc / 8)] & (1 << (IntSrc & 0x07)))
#define _GetInt_EX1_DISP() _GetInt_EX1_BIT( 10 )
#define _GetInt_EX1_DHC() _GetInt_EX1_BIT( 11 )
#define _GetInt_EX1_CYTLIF() _GetInt_EX1_BIT( 12 )
#define _GetInt_EX1_SBM() _GetInt_EX1_BIT( 13 )
#define _GetInt_EX1_COMB() _GetInt_EX1_BIT( 14 )
#define _GetInt_EX1_ECC_DERR() _GetInt_EX1_BIT( 15 )
#define _GetInt_EX1_TSP2HK() _GetInt_EX1_BIT( 16 )
#define _GetInt_EX1_VE() _GetInt_EX1_BIT( 17 )
#define _GetInt_EX1_CIMAX2MCU() _GetInt_EX1_BIT( 18 )
#define _GetInt_EX1_DC() _GetInt_EX1_BIT( 19 )
#define _GetInt_EX1_GOP() _GetInt_EX1_BIT( 20 )
#define _GetInt_EX1_PCM2MCU() _GetInt_EX1_BIT( 21 )
#define _GetInt_EX1_IIC0() _GetInt_EX1_BIT( 22 )
#define _GetInt_EX1_RTC() _GetInt_EX1_BIT( 23 )
#define _GetInt_EX1_KEYPAD() _GetInt_EX1_BIT( 24 )
#define _GetInt_EX1_PM() _GetInt_EX1_BIT( 25 )
#define _GetInt_EX1_DDC2BI() _GetInt_EX1_BIT( 26 )
#define _GetInt_EX1_SCM() _GetInt_EX1_BIT( 27 )
#define _GetInt_EX1_VBI() _GetInt_EX1_BIT( 28 )
#define _GetInt_EX1_M4V() _GetInt_EX1_BIT( 29 )
#define _GetInt_EX1_FCIE2RIU() _GetInt_EX1_BIT( 30 )
#define _GetInt_EX1_ADCDVI2RIU() _GetInt_EX1_BIT( 31 )
#define _SetInt_EX1_BIT( IntSrc, bEnable ) \
(XBYTE[EX1_INT_MASK + (IntSrc / 8)] = \
((bEnable) ? (XBYTE[EX1_INT_MASK + (IntSrc / 8)] & ~(1 << (IntSrc & 0x07))) : \
(XBYTE[EX1_INT_MASK + (IntSrc / 8)] | (1 << (IntSrc & 0x07)))))
#define _SetInt_EX1_DISP( bEnable ) _SetInt_EX1_BIT( 10, bEnable )
#define _SetInt_EX1_DHC( bEnable ) _SetInt_EX1_BIT( 11, bEnable )
#define _SetInt_EX1_CYTLIF( bEnable ) _SetInt_EX1_BIT( 12, bEnable )
#define _SetInt_EX1_SBM( bEnable ) _SetInt_EX1_BIT( 13, bEnable )
#define _SetInt_EX1_COMB( bEnable ) _SetInt_EX1_BIT( 14, bEnable )
#define _SetInt_EX1_ECC_DERR( bEnable ) _SetInt_EX1_BIT( 15, bEnable )
#define _SetInt_EX1_TSP2HK( bEnable ) _SetInt_EX1_BIT( 16, bEnable )
#define _SetInt_EX1_VE( bEnable ) _SetInt_EX1_BIT( 17, bEnable )
#define _SetInt_EX1_CIMAX2MCU( bEnable ) _SetInt_EX1_BIT( 18, bEnable )
#define _SetInt_EX1_DC( bEnable ) _SetInt_EX1_BIT( 19, bEnable )
#define _SetInt_EX1_GOP( bEnable ) _SetInt_EX1_BIT( 20, bEnable )
#define _SetInt_EX1_PCM2MCU( bEnable ) _SetInt_EX1_BIT( 21, bEnable )
#define _SetInt_EX1_IIC0( bEnable ) _SetInt_EX1_BIT( 22, bEnable )
#define _SetInt_EX1_RTC( bEnable ) _SetInt_EX1_BIT( 23, bEnable )
#define _SetInt_EX1_KEYPAD( bEnable ) _SetInt_EX1_BIT( 24, bEnable )
#define _SetInt_EX1_PM( bEnable ) _SetInt_EX1_BIT( 25, bEnable )
#define _SetInt_EX1_DDC2BI( bEnable ) _SetInt_EX1_BIT( 26, bEnable )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -