 Linux-2.6.x/drivers/input/touchscreen  드라이버를 변경하여 Mouse mode 에서 그림을 그리도록 하자.

Slides:



Advertisements
Similar presentations
13-1 Bard, Gerstlauer, Valvano, Erez, Telang, Yerraballi EE 319K Introduction to Embedded Systems Lecture 13: 2-D Arrays, Bitmaps, Sprites, Structs, Lab.
Advertisements

OPTIMIZING C CODE FOR THE ARM PROCESSOR Optimizing code takes time and reduces source code readability Usually done for functions that are critical for.
Integer Arithmetic: Multiply, Divide, and Bitwise Operations
Computer Graphics Tz-Huan Huang National Taiwan University (Slides are based on Prof. Chen’s)
DOS and BIOS Interrupts DOS and BIOS interrupts are used to perform some very useful functions, such as displaying data to the monitor, reading data from.
VGA Text Mode An introduction to font selection and to reprogramming of the Character Generator ram.
Swish Sleeve Software Design Narrative Team 7: Stephen MacNeil, Michael Kobit, Sriharsh Achukola, Augustus Hong 1Team 7 - Swish Sleeve.
Display Hardware Yingcai Xiao Display Hardware Yingcai Xiao.
Buffers Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
Buffers Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
The CRT Controller How to modify CRTC registers to achieve a non-standard horizontal and vertical screen resolution.
EET Advanced Digital Display Adapters. A vital part to the system provides the visual part of the Human/Computer interface In boot process, goes.
Other I/O LCD display Flash ROM Keyboard (PS/2) UART connectors.
Computer System Overview
Early PC Graphics Capabilities of the IBM Color Graphics Adapter (CGA) and Enhanced Graphics Adapter (EGA)
SiS 315 An introductory exploration of features of the SVGA graphics processor used in our classroom’s workstations.
EET Advanced Digital Display Adapters. A vital part to the system provides the visual part of the Human/Computer interface In boot process, goes.
Embedded Programming and Robotics Lesson 9 Keypad and LCD Display 1.
Video Monitor Uses raster scanning to display images
Go to the MTSD Home Page In the URL add “/admin”
Basics of a Computer Graphics System Introduction to Computer Graphics CSE 470/598 Arizona State University Dianne Hansford.
Computer Systems Overview. Page 2 W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware resources of one.
ECE291 Computer Engineering II Lecture 9 Josh Potts University of Illinois at Urbana- Champaign.
Video Monitor Uses raster scanning to display images –Beam of electrons illuminates phosphorus dots on the screen called pixels. Starting at the top of.
1/2002JNM1 Positional Notation (Hex Digits). 1/2002JNM2 Problem The 8086 has a 20-bit address bus. Therefore, it can access 1,048,576 bytes of memory.
1-1 NET+OS Software Group Flash API Multiple flash memory bank support New Flash API introduction Detailed Flash API Function presentation Supporting.
Lab 8 Bit-Mapped Graphics Moving from text-based graphics to bit- mapped graphics. Easy to draw graphic points and lines using INT 10h, Function 0Ch (write.
Using HiColor graphics
13-1 Bard, Gerstlauer, Valvano, Yerraballi EE 319K Introduction to Embedded Systems Lecture 13: 2-D Arrays, Bitmaps, Sprites, Structs, Lab 10.
GameBoy Advance Programming Tiles. Atari 196?: As an engineering student at the University of Utah, Nolan Bushnell liked to sneak into the computer labs.
CISCO NETWORKING ACADEMY Chabot College ELEC Binary Introduction.
GameBoy Advance Programming Timers. Common Practice Game timing is normally synchronized with the vertical blank. For certain applications such as precise.
Unix Session IV.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
CS1372: HELPING TO PUT THE COMPUTING IN ECE CS1372 Some Basics.
ECE 103 Engineering Programming Chapter 53 Generic Algorithms Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.
10H Interrupt. Option 0H – Sets video mode. Registers used: – AH = 0H – AL = Video Mode. 3H - CGA Color text of 80X25 7H - Monochrome text of 80X25 Ex:
영상 획득 영상 저장 카메라 파라메터 커스텀 이미지
E-Board Features North Dakota University System 2008.
ECE 447: Lecture 11 Introduction to Programming in Assembly Language.
F28HS2 Hardware-Software Interface Lecture 6 - Programming in C 6.
WCL 조윤정 Arduino Bootloader 코드 분석. BAUD_RATE 설정 /* set the UART baud rate defaults */ #ifndef BAUD_RATE #if F_CPU >= L #define BAUD_RATE.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Steve Andre Eric Glover Shaun Greene Russell Willmot.
Lecture 11 Text mode video
제 11 장 Virtual Memory. kuic.kyonggi.ac.kr/~dssung 11.1 Comparison of Cache and Virtual Memory CPU Cache Memory Hit CPU address = Memory address Cache.
Graphics OpenGL OpenGL Introduction 컴퓨터 그래픽스 김 창 헌.
Basic of Buffer Over Flow
 Backlight 에서 나온 백색광이 액정 셀을 통과하면 서 투과율이 조절되고 red, green, blue 의 color filter 를 투과해 나오는 빛의 혼합을 통해 색이 구 성됨  Color filter 는 셀사이의 빛을 차단하는 black matrix,
ECE 447: Lecture 3 Microcontroller Programming in C.
Problems in IO CS 1550 Recitation December 2 nd /4 th, 2002 The questions in this slide are from Andrew S. Tanenbaum's textbook page 376, 377.
Sitarambhai Naranjibhai Patel Institute of Technology and Research Centre, Umrakh, Bardoli. A Presentation On “ 16x2 LCD Interfacing with AVR atmega32.
Computer Systems Overview. Lecture 1/Page 2AE4B33OSS W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware.
Flowchart of basic interrupt mechanism
UNIVERSAL COLLEGE OF ENGINEERING & TECHNOLOGY
Introduction to Computer Graphics with WebGL
The Hardware Interface
For Example: User level quicksort program Three address code.
UART Protocol Chapter 11 Sepehr Naimi
Programming Embedded Systems in C++
Images to play around with
LCD and Keyboard Sepehr Naimi
Binary “There are 10 types of people in the world: Those who understand binary, and those who don't.”
EE 319K Introduction to Embedded Systems
MIPS Arithmetic and Logic Instructions
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Bit Manipulations CS212.
An Introduction to the ARM CORTEX M0+ Instructions
Presentation transcript:

 Linux-2.6.x/drivers/input/touchscreen  드라이버를 변경하여 Mouse mode 에서 그림을 그리도록 하자.

 Sub LCD display control ◦ 주소 : 0x ◦ Reminder (from LCD slides)  Bit control ◦ 0-2: BG Mode ◦ 3: (Engine A) BG0 2D/3D Selection (instead CGB Mode) (0=2D, 1=3D) ◦ 8: Screen Display BG0 (0=Off, 1=On) ◦ 9: Screen Display BG1 (0=Off, 1=On) ◦ 10: Screen Display BG2 (0=Off, 1=On) ◦ 11: Screen Display BG3 (0=Off, 1=On) ◦ 16-17: Display Mode (Engine A: 0..6, Engine B: 0..5) ◦ 18-19: (Engine A) VRAM block (0..3=VRAM A..D) (For Capture & above Display Mode=2) ◦ 24-26: (Engine A) Character Base (in 64K steps) (merged with 16K step in BGxCNT) ◦ 27-29: (Engine A) Screen Base (in 64K steps) (merged with 2K step in BGxCNT) ◦ 30: BG Extended Palettes (0=Disable, 1=Enable)

Sub 2D Engine ModeBG0BG1BG2BG3 Mode 0Text Mode 1Text Rotation Mode 2Text Rotation Mode 3Text Extended Mode 4Text RotationExtended Mode 5Text Extended 우리가 원하는 mode 우리가 원하는 frame buffer BG mode = 5, Display mode = 1 (2D) BG3 를 사용 -> 11 번 bit x

 VRAM control register ◦ 0x 부터 1 바이트 ◦ VRAM A  0x ◦ VRAM B  0x ◦ VRAM C  0x ◦ … ◦ VRAM I  0x VRAM C 쓰자 VRAM A/B 는 Main LCD 에서 쓰고 있음

 VRAM 설정 ◦ Bit control  0-2 VRAM MST ;Bit2 not used by VRAM-A,B,H,I  3-4 VRAM Offset (0-3) ;Offset not used by VRAM-E,H,I  5-6 Not used  7 VRAM Enable (0=Disable, 1=Enable)  VRAM C 사용, Sub LCD ◦ Sub LCD 주소는 0x ◦ olvram 의 사용 가능 모드 참조 olvram  우리가 사용할 모드 VRAM SIZE MST OFS ARM9, 2D Graphics Engine B, BG-VRAM (max 128K) C 128K h

 BG3 control register ◦ 0x E  0-1 BG Priority (0-3, 0=Highest)  2: 8-bit (0), 16-bit (1)  3-5 Not used (must be zero)  6 Mosaic (0=Disable, 1=Enable)  7 Colors/Palettes (0=16/16, 1=256/1)  8-12 Screen Base Block (0-31, in units of 2 KBytes) (=BG Map Data)  13 Display Area Overflow (0=Transparent, 1=Wraparound; BG2CNT/BG3CNT only)  Screen Size (0-3) ◦ Screen size Value Text Mode Rotation/Scaling Mode 0 256x256 (2K) 128x128 (256 bytes) 1 512x256 (4K) 256x256 (1K) 2 256x512 (4K) 512x512 (4K) 3 512x512 (8K) 1024x1024 (16K) 14 번 bit 1

 SUB_BG3_XDX (*(volatile u16*)0x ) ◦ X 크기 : 256  SUB_BG3_XDY (*(volatile u16*)0x ) ◦ rotation  SUB_BG3_YDX (*(volatile u16*)0x ) ◦ rotation  SUB_BG3_YDY (*(volatile u16*)0x ) ◦ Y 크기 : 256  SUB_BG3_CX (*(volatile u32*)0x ) ◦ X offset  SUB_BG3_CY (*(volatile u32*)0x C) ◦ Y offset

 Define 문장 추가 #define MODE_5_2D0x10005 #define DISPLAY_BG3_ACTIVE (1 << 11) #define SUB_BG3_CR (*(volatile u16*)0x E) #define BG_BMP16_256x256 ((1<<14)|(1<<7)|(1<<2)) #define SUB_BG3_XDX (*(volatile u16*)0x ) #define SUB_BG3_XDY (*(volatile u16*)0x ) #define SUB_BG3_YDX (*(volatile u16*)0x ) #define SUB_BG3_YDY (*(volatile u16*)0x ) #define SUB_BG3_CX (*(volatile u32*)0x ) #define SUB_BG3_CY (*(volatile u32*)0x C) #define SUB_LCD_BASE 0x

 rgb 함수 추가 static unsigned short rgb(unsigned char r, unsigned char g, unsigned char b) { return ( (r&0x1f) | ((g&0x1f)<<5) | ((b&0x1f)<<10) | (1<<15) ); }  switch_to_mouse_mode(void) 끝에 추가 SUB_DISPLAY_CR = MODE_5_2D | DISPLAY_BG3_ACTIVE; VRAM_C_CR = VRAM_ENABLE | VRAM_C_SUB_BG_0x ; SUB_BG3_CR = BG_BMP16_256x256; SUB_BG3_XDX = 1 << 8; SUB_BG3_XDY = 0; SUB_BG3_YDX = 0; SUB_BG3_YDY = 1 << 8; SUB_BG3_CX = 0; SUB_BG3_CY = 0; // Clear the screen for(i=0;i<256*192;i++) *((volatile u16*)SUB_LCD_BASE + i)=rgb(0,0,0);

 Switch_to_keyboard_mode(void) 첫 문장 추가 draw_keyboard(0); // to change graphics mode  ndstouch_input_event(..) 에 추가 ◦ MOUSE_MODE 에서 input_sync(dev); // 원래 있던 코드 *((volatile u16*)SUB_LCD_BASE+x+y*256)=rgb(255,0,0); // 추가 – 터치되는 곳을 붉은 색으로 !

 DSLinux 를 다시 빌드  Image (nds 파일 ) 를 NDSL 에 복사, 수행  SUB LCD 의 우측 상단 M 을 눌러 mouse mode 로 전환 후, 화면 실행을 확인

1. 두 개의 점을 찍으면 사각형을 그려보자. 2. 두 개의 점을 찍으면 선을 그려보자. 3. Rubber band 를 구현해 보자.