⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 board_ep7312_i.h

📁 浙江大学的悟空嵌入式系统模拟器
💻 H
字号:
/*
*  Copyright (c) 2005 Zhejiang University, P.R.China
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software
*  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ 

//=============================================================================
/**
*  @file    ARM/Board_EP7312_i.h
*
*  $Id: Board_EP7312_i.h,v 1.3 2005/06/08 07:40:44 qilj Exp $
*
*  @author  Lingjie Qi <lingjie_qi@163.com> 
*/
//=============================================================================

inline void Board_EP7312::set_signal(Extern_Signal which, bool val)
{
	signal_[which] = val;
}

inline bool Board_EP7312::test_signal(Extern_Signal which)
{
	return signal_[which];
}

inline Core::u32 & Board_EP7312::get_int_reg(INT_Reg which)
{
	return int_reg_[which];
}

inline void Board_EP7312::clear(INT_Reg whick)
{
	int_reg_[whick] = 0;
}

inline void Board_EP7312::clear_clock()
{
	clock = 0;
}

inline void Board_EP7312::descend_clock()
{
	if (tc_prescale >0)
		tc_prescale--;
}

inline bool Board_EP7312::test_clock()
{
	return (clock==0);
}

inline void Board_EP7312::reset_clock()
{
	tc_prescale = 50;
}

inline Core::u32  Board_EP7312::get_clock()
{
	return clock;
}

inline void Board_EP7312::descend_io_prescale()
{
	if(io_prescale_ > 0)
		io_prescale_--;
}

inline void Board_EP7312::reset_io_prescale()
{
	io_prescale_ = 50;
}

inline bool Board_EP7312::test_io_prescale()
{
	return (io_prescale_ == 0);
}

inline void Board_EP7312::set_external_interrupt()
{
	Core::u32 request;
	request = int_reg_[INTSR1] &int_reg_[INTMR1];
	if( request &0x2300)
		set_signal(Board_EP7312::IRQ_sig, true);
	else
		set_signal(Board_EP7312::IRQ_sig, false);
}

inline void Board_EP7312::update_lcd()
{
	//ep7312_lcd_disable(state);
	int width, height, depth;

	Core::u32  lcdcon = lcd_reg_[LCDCON];
	Core::u32  vbufsiz = lcdcon & VBUFSIZ;
	Core::u32  linelen = (lcdcon & LINELEN) >> LINELEN_SHIFT;

	switch (lcdcon & (GSEN|GSMD))
	{
	case GSEN:
		depth = 2;
		break;
	case GSEN|GSMD:
		depth = 4;
		break;
	default:
		depth = 1;
		break;
	}

	depth=8;
	width = (linelen + 1) * 16;
	height = (vbufsiz + 1) * 128 / depth / width;  //for 1b,2b,4b,8b, the register is big enough for the size 
	
	//ep7312_lcd_enable(state, width, height, depth);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -