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

📄 lcd_screen.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    Device/LCD/LCD_Screen.h
*
*  $Id: LCD_Screen.h,v 1.1 2005/06/08 08:12:24 qilj Exp $
*
*  \author  Huacheng Ke <sese_zju@yahoo.com.cn>
*/
//=============================================================================

#ifndef LCD__LCD_SCREEN_H_INCLUDED
#define LCD__LCD_SCREEN_H_INCLUDED

#include <Core/Global.h>
#include <Core/Observer.h>

#include "./LCD.h"


class wxClientDC;

class wxPen;

class wxTimerEvent;

#define LCD_BASE 0x


namespace LCD { 

	class LCD_Widget;

	class LCD_API LCD_Screen : public Core::Observer
	{
		DECLARE_DYNAMIC_CLASS(LCD_Screen)
	public:
		LCD_Screen(void);
		LCD_Screen(Core::u32 width, Core::u32 height, Core::u32 depth);
		virtual ~LCD_Screen(void);
		virtual void update(Core::Part & part);
		virtual void reset(Core::Part & part){}
		virtual void show(void);
		virtual void hide(void);
		virtual void on_create(void);
		virtual void on_destroy(void);

		void config();

		void draw_pixel(wxCoord x, wxCoord y);

		void init(Core::u32 width, Core::u32 height, Core::u32 depth);

		//! malloc space for frame-buffer
		void malloc_fb();
		
		//! write LCD's frame-buffer 
		void write_fb(Core::u32 addr, Core::u32 data);

		void fresh_screen();

		void set_palette();

		bool creat_bitmap();

		virtual void enable(Core::u32 width, Core::u32 height, Core::u32 depth);
		
	protected:
		LCD_Widget * dialog_;
		wxClientDC * dc_;
		wxPen pen_;
		wxBitmap bitmap_;
		wxPalette palette_;
		unsigned char * fb_;

		Core::u32 width_;
		Core::u32 height_;
		Core::u32 depth_;
		bool enable_;
		Core::u32 base_addr_;
		bool lcd_update_;
		unsigned char r1b[2],g1b[2],b1b[2],					\
					  r4b[16],g4b[16],b4b[16],				\
					  r8b[256],g8b[256],b8b[256];

		
	};

} //namespace

#endif



⌨️ 快捷键说明

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