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

📄 lcd.lst

📁 ATmega64单片机
💻 LST
📖 第 1 页 / 共 3 页
字号:
 196               	lcdUpdateDisplay:
 198               	.LM13:
 199               	.LFBB5:
 200               	/* prologue: frame size=0 */
 166:LCD\LCD.c     **** }
 167:LCD\LCD.c     **** 
 168:LCD\LCD.c     **** /** Update the display, actually transfer the data of the SRAM to LCD through SPI ****/
 169:LCD\LCD.c     **** void lcdUpdateDisplay(void)
 170:LCD\LCD.c     **** {
 201               	push r28
 202               		push r29
 203               	/* prologue end (size=4) */
 204               	.LBB18:
 205 003e 0F93      	.LBB19:
 207 0042 CF93      	.LM14:
 208 0044 DF93      		ldi r24,lo8(80)
 209               		out 45-0x20,r24
 211               	.LM15:
 212               		sbi 46-0x20,0
 213               	.LBE19:
 214 0046 80E5      	.LBE18:
 216               	.LM16:
 217               		lds r24,98
 218 004a 709A      		andi r24,lo8(-5)
 219               		sts 98,r24
 220               		ldi r16,lo8(disBuf)
 171:LCD\LCD.c     **** 	//unsigned int n = 504;
 172:LCD\LCD.c     **** 	unsigned char * p = disBuf;
 173:LCD\LCD.c     **** 	unsigned int i,j;
 174:LCD\LCD.c     **** 
 175:LCD\LCD.c     **** #if HW_SPI			/* If hardware SPI is used, adjust the SPI speed*/
 176:LCD\LCD.c     **** 	lcdSpiSpeedSet();	/* Other SPI device may share the SPI & they may change the speed */
 177:LCD\LCD.c     **** #endif
 178:LCD\LCD.c     **** 
 179:LCD\LCD.c     **** 	LCD_E_L;		/* Chip select */
 221               	
 222               		ldi r28,lo8(0)
 223 004c 8091 6200 		ldi r29,hi8(0)
 224 0050 8B7F      	.L21:
 226 0056 00E0      	.LM17:
 227 0058 10E0      		movw r18,r28
 228 005a C0E0      		ori r18,lo8(64)
 229 005c D0E0      		mov r24,r18
 230               		call lcdWriteCmd
 180:LCD\LCD.c     **** 
 181:LCD\LCD.c     **** /***************************************************************************/
 182:LCD\LCD.c     **** /*** It seems that some 3310lcd do not support the following code  ****/
 183:LCD\LCD.c     **** 
 184:LCD\LCD.c     ****  	//lcdWriteCmd(0x0c);
 185:LCD\LCD.c     **** 	//lcdWriteCmd(0x40 | 0);	/* Set row to 0 */
 186:LCD\LCD.c     ****   	//lcdWriteCmd(0x80 | 0);	/* Set column to 0*/
 187:LCD\LCD.c     **** 							/* To make sure the data always start at codinate(0,0) */
 188:LCD\LCD.c     **** 	//while(n--)
 189:LCD\LCD.c     **** 	//	lcdWriteByte(*p++);
 190:LCD\LCD.c     **** /***************************************************************************/
 191:LCD\LCD.c     **** 
 192:LCD\LCD.c     **** /* so we use this, set the address at each row */	
 193:LCD\LCD.c     **** 	for(i=0;i<6;i++)
 194:LCD\LCD.c     **** 	{
 195:LCD\LCD.c     **** 		lcdWriteCmd(0x40 | i);	/* Set row to 0 */
 231               	8,0,196,.LM18-.LFBB5
 232               	.LM18:
 233 005e 9E01      		ldi r24,lo8(-128)
 234 0060 2064      		call lcdWriteCmd
 235 0062 822F      		movw r30,r16
 236 0064 0E94 0000 		ldi r18,lo8(0)
 196:LCD\LCD.c     ****  	 	lcdWriteCmd(0x80 | 0);	/* Set column to 0*/
 237               	19,hi8(0)
 238               	.L22:
 240 006a 0E94 0000 	.LM19:
 241 006e F801      		ld r24,Z+
 242 0070 20E0      	.LBB20:
 243 0072 30E0      	.LBB21:
 197:LCD\LCD.c     **** 		for(j=0;j<84;j++)
 198:LCD\LCD.c     **** 		{
 199:LCD\LCD.c     **** 			lcdWriteByte(*p++);
 245               	out 47-0x20,r24
 246               	.L23:
 248               	.LM21:
 249               		sbis 46-0x20,7
 250               		rjmp .L23
 251               	.LBE21:
 252 0076 8FB9      	.LBE20:
 254               	.LM22:
 255               		subi r18,lo8(-(1))
 256 0078 779B      		sbci r19,hi8(-(1))
 257 007a 00C0      		cpi r18,84
 258               		cpc r19,__zero_reg__
 259               		brne .L22
 260               		subi r16,lo8(-(84))
 261               		sbci r17,hi8(-(84))
 263 007e 3F4F      	.LM23:
 264 0080 2435      		adiw r28,1
 265 0082 3105      		cpi r28,6
 266 0084 01F4      		cpc r29,__zero_reg__
 267 0086 0C5A      		brne .L21
 269               	.LM24:
 270               		lds r24,98
 271 008a 2196      		ori r24,lo8(4)
 272 008c C630      		sts 98,r24
 273 008e D105      	/* epilogue: frame size=0 */
 274 0090 01F4      		pop r29
 200:LCD\LCD.c     **** 		}
 201:LCD\LCD.c     **** 	}
 202:LCD\LCD.c     **** 	LCD_E_H;		/* chip deselect */
 275               	t
 276               	/* epilogue end (size=5) */
 277 0092 8091 6200 	/* function lcdUpdateDisplay size 52 (43) */
 287               	.Lscope5:
 292               	.global	OnePixel
 294               	OnePixel:
 296               	.LM25:
 297               	.LFBB6:
 298               	/* prologue: frame size=0 */
 299               	/* prologue end (size=0) */
 301               	.LM26:
 302               		mov r18,r22
 303               		lsr r18
 304               		lsr r18
 203:LCD\LCD.c     **** }
 204:LCD\LCD.c     **** 
 205:LCD\LCD.c     **** 
 206:LCD\LCD.c     **** 
 207:LCD\LCD.c     **** /*********** Set a pixel bit with value val *************************/
 208:LCD\LCD.c     **** void OnePixel(unsigned char x,unsigned char y,unsigned char val)
 209:LCD\LCD.c     **** {
 305               	 r18,r25
 306               		movw r30,r0
 307               		clr r1
 308               		add r30,r24
 309               		adc r31,__zero_reg__
 210:LCD\LCD.c     **** 	unsigned char *p = &disBuf[ (unsigned int)y/8*84 + x ];//找到对应字节
 310               	 r30,lo8(-(disBuf))
 311               		sbci r31,hi8(-(disBuf))
 312 00a6 262F      		ldi r23,lo8(0)
 313 00a8 2695      		ld r18,Z
 315 00ac 2695      	.LM27:
 316 00ae 94E5      		tst r20
 317 00b0 299F      		breq .L35
 319 00b4 1124      	.LM28:
 320 00b6 E80F      		andi r22,lo8(7)
 321 00b8 F11D      		andi r23,hi8(7)
 322 00ba E050      		ldi r24,lo8(1)
 323 00bc F040      		ldi r25,hi8(1)
 324 00be 70E0      		rjmp 2f
 325 00c0 2081      	1:	lsl r24
 211:LCD\LCD.c     **** 	if(val)*p |= (1<<(y%8));		//修改对应位
 326               	r22
 327               		brpl 1b
 328 00c2 4423      		or r18,r24
 329 00c4 01F0      		rjmp .L39
 330               	.L35:
 332 00c6 6770      	.LM29:
 333 00c8 7070      		andi r22,lo8(7)
 334 00ca 81E0      		andi r23,hi8(7)
 335 00cc 90E0      		ldi r24,lo8(1)
 336 00ce 00C0      		ldi r25,hi8(1)
 337 00d0 880F      		rjmp 2f
 338 00d2 991F      	1:	lsl r24
 339 00d4 6A95      		rol r25
 340 00d6 02F4      	2:	dec r22
 341 00d8 282B      		brpl 1b
 342 00da 00C0      		com r24
 343               		and r18,r24
 212:LCD\LCD.c     **** 	else *p &= ~(1<<(y%8));
 344               	et
 345               	/* epilogue: frame size=0 */
 346 00dc 6770      	/* epilogue: noreturn */
 347 00de 7070      	/* epilogue end (size=0) */
 348 00e0 81E0      	/* function OnePixel size 42 (42) */
 353 00ea 6A95      	.Lscope6:
 357               	.global	ReadPixel
 359 00f4 0895      	ReadPixel:
 361               	.LM30:
 362               	.LFBB7:
 363               	/* prologue: frame size=0 */
 364               	/* prologue end (size=0) */
 365               		mov r18,r22
 366               		lsr r18
 367               		lsr r18
 368               		lsr r18
 369               		ldi r19,lo8(0)
 370               		ldi r20,lo8(84)
 371               		ldi r21,hi8(84)
 372               		mul r18,r20
 373               		movw r30,r0
 374               		mul r18,r21
 213:LCD\LCD.c     **** }
 214:LCD\LCD.c     **** /**********  Read the pixel value withe the given codination ************/
 215:LCD\LCD.c     **** unsigned char ReadPixel(unsigned char x,unsigned char y)
 216:LCD\LCD.c     **** {
 375               	31,r0
 376               		clr r1
 377               		add r30,r24
 378               		adc r31,__zero_reg__
 379               		subi r30,lo8(-(disBuf))
 380 00f6 262F      		sbci r31,hi8(-(disBuf))
 381 00f8 2695      		ld r24,Z
 382 00fa 2695      		ldi r25,lo8(0)
 383 00fc 2695      		andi r22,lo8(7)
 384 00fe 30E0      		rjmp 2f
 385 0100 44E5      	1:	asr r25
 386 0102 50E0      		ror r24
 387 0104 249F      	2:	dec r22
 388 0106 F001      		brpl 1b
 390 010a F00D      	.LM31:
 391 010c 349F      		andi r24,lo8(1)
 392 010e F00D      		andi r25,hi8(1)
 393 0110 1124      	/* epilogue: frame size=0 */
 394 0112 E80F      		ret
 395 0114 F11D      	/* epilogue end (size=1) */
 396 0116 E050      	/* function ReadPixel size 30 (29) */
 398 011a 8081      	.Lscope7:
 400 011e 6770      	.global	lcdInit
 402 0122 9595      	lcdInit:
 404 0126 6A95      	.LM32:
 405 0128 02F4      	.LFBB8:
 217:LCD\LCD.c     **** 	unsigned char *p = &disBuf[ (unsigned int)y/8*84 + x ];//找到对应字节
 218:LCD\LCD.c     **** 	if(*p & (1<<(y%8)))return 1;
 219:LCD\LCD.c     **** 	else return 0;
 220:LCD\LCD.c     **** }
 406               	size 30 (29) */
 408 012a 8170      	.Lscope7:
 410               	.global	lcdInit
 412               	lcdInit:
 414               	.LM32:
 415               	.LFBB8:
 416               	/* prologue: frame size=0 */
 417               		push r16
 418               		push r17
 419               	/* prologue end (size=2) */
 421               	.LM33:
 422               		ldi r16,lo8(98)
 423               		ldi r17,hi8(98)
 424 0130 0F93      		movw r30,r16
 425 0132 1F93      		ld r24,Z
 426               		ori r24,lo8(1)
 427               		st Z,r24
 428               		ld r24,Z
 429 0134 02E6      		ori r24,lo8(4)
 430 0136 10E0      		st Z,r24
 431 0138 F801      		ld r24,Z
 432 013a 8081      		ori r24,lo8(8)
 433 013c 8160      		st Z,r24
 434 013e 8083      		sbi 56-0x20,1
 435 0140 8081      		sbi 56-0x20,2
 436 0142 8460      		ldi r30,lo8(97)
 437 0144 8083      		ldi r31,hi8(97)
 438 0146 8081      		ld r24,Z
 439 0148 8860      		ori r24,lo8(1)
 440 014a 8083      		st Z,r24
 441 014c C19A      		ld r24,Z
 442 014e C29A      		ori r24,lo8(4)
 443 0150 E1E6      		st Z,r24
 444 0152 F0E0      		ld r24,Z
 445 0154 8081      		ori r24,lo8(8)
 446 0156 8160      		st Z,r24

⌨️ 快捷键说明

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