/***********************************************************************/ /* */ /* FILE :Lcd.c */ /* DATE :Wed, Nov 02, 2011 */ /* DESCRIPTION :Main Program */ /* CPU TYPE :H8/3052F */ /* */ /* This file is generated by Renesas Project Generator (Ver.4.16). */ /* */ /***********************************************************************/ #include "iodefine.h" void Data_Out(int x,int y); void out(struct rgb c); struct rgb{ unsigned char r:6; unsigned char g:6; unsigned char b:6; }; union bf{ unsigned char byte; struct{ unsigned char b7:1; unsigned char b6:1; unsigned char b5:1; unsigned char b4:1; unsigned char b3:1; unsigned char b2:1; unsigned char b1:1; unsigned char b0:1; }bit; }; volatile struct rgb green ={20,0,63}; volatile struct rgb red ={20,60,0}; volatile struct rgb vrom[96][400]; volatile unsigned int edge_flg; void main(void); #ifdef __cplusplus extern "C" { void abort(void); } #endif void main(void) { while(1){ } } void Data_Out(int x,int y){ if( x > 300){ green.r=60; green.g=30; green.b=33; out(green); }else if( x > 200){ green.r=20; green.g=60; green.b=23; out(green); } else if(x > 100){ green.r=20; green.g=50; green.b=63; out(green); }else{ green.r=60; green.g=60; green.b=63; out(green); } } void out(struct rgb c){ union bf b; b.byte=c.r; P3.DR.BYTE=c.r; P3.DR.BIT.B0=b.bit.b5; P3.DR.BIT.B1=b.bit.b4; P3.DR.BIT.B2=b.bit.b3; P3.DR.BIT.B3=b.bit.b2; P3.DR.BIT.B4=b.bit.b1; P3.DR.BIT.B5=b.bit.b0; b.byte=c.g; P2.DR.BYTE=c.g; P2.DR.BIT.B0=b.bit.b5; P2.DR.BIT.B1=b.bit.b4; P2.DR.BIT.B2=b.bit.b3; P2.DR.BIT.B4=b.bit.b2; P2.DR.BIT.B5=b.bit.b1; P2.DR.BIT.B6=b.bit.b0; b.byte=c.b; P1.DR.BYTE=c.b; P1.DR.BIT.B0=b.bit.b5; P1.DR.BIT.B1=b.bit.b4; P1.DR.BIT.B2=b.bit.b3; P1.DR.BIT.B3=b.bit.b2; P1.DR.BIT.B4=b.bit.b1; P1.DR.BIT.B5=b.bit.b0; } #ifdef __cplusplus void abort(void) { } #endif