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

📄 lcd_pcd8544.lss

📁 Nokia 6110 LCD 驱动 Atmega8
💻 LSS
📖 第 1 页 / 共 5 页
字号:
                fraction -= dx;
            }
            x1 += stepx;
            fraction += dy;
 8c6:	c0 0f       	add	r28, r16
 8c8:	d1 1f       	adc	r29, r17
    /* Draw next positions until end */
    if ( dx > dy )
    {	
        /* Take fraction */
        fraction = dy - ( dx >> 1);
        while ( x1 != x2 )
 8ca:	c5 14       	cp	r12, r5
 8cc:	81 f7       	brne	.-32     	; 0x8ae <LcdLine+0x92>
 8ce:	17 c0       	rjmp	.+46     	; 0x8fe <LcdLine+0xe2>
        }
    }
    else
    {
        /* Take fraction */
        fraction = dx - ( dy >> 1);
 8d0:	c8 01       	movw	r24, r16
 8d2:	95 95       	asr	r25
 8d4:	87 95       	ror	r24
 8d6:	e7 01       	movw	r28, r14
 8d8:	c8 1b       	sub	r28, r24
 8da:	d9 0b       	sbc	r29, r25
 8dc:	0e c0       	rjmp	.+28     	; 0x8fa <LcdLine+0xde>
        while ( y1 != y2 )
        {
            if ( fraction >= 0 )
 8de:	d7 fd       	sbrc	r29, 7
 8e0:	03 c0       	rjmp	.+6      	; 0x8e8 <LcdLine+0xcc>
            {
                x1 += stepx;
 8e2:	ca 0c       	add	r12, r10
                fraction -= dy;
 8e4:	c0 1b       	sub	r28, r16
 8e6:	d1 0b       	sbc	r29, r17
 8e8:	d8 0c       	add	r13, r8
            }
            y1 += stepy;
            fraction += dx;
			
            /* Draw calculated point */
            response = LcdPixel( x1, y1, mode );
 8ea:	47 2d       	mov	r20, r7
 8ec:	6d 2d       	mov	r22, r13
 8ee:	8c 2d       	mov	r24, r12
 8f0:	35 df       	rcall	.-406    	; 0x75c <LcdPixel>
            if(response)
 8f2:	88 23       	and	r24, r24
 8f4:	41 f4       	brne	.+16     	; 0x906 <LcdLine+0xea>
            {
                x1 += stepx;
                fraction -= dy;
            }
            y1 += stepy;
            fraction += dx;
 8f6:	ce 0d       	add	r28, r14
 8f8:	df 1d       	adc	r29, r15
    }
    else
    {
        /* Take fraction */
        fraction = dx - ( dy >> 1);
        while ( y1 != y2 )
 8fa:	d6 14       	cp	r13, r6
 8fc:	81 f7       	brne	.-32     	; 0x8de <LcdLine+0xc2>
                return response;
        }
    }
	
    /* Set update flag to be true */
    UpdateLcd = TRUE;
 8fe:	81 e0       	ldi	r24, 0x01	; 1
 900:	80 93 5e 02 	sts	0x025E, r24
 904:	80 e0       	ldi	r24, 0x00	; 0
    return OK;
}
 906:	df 91       	pop	r29
 908:	cf 91       	pop	r28
 90a:	1f 91       	pop	r17
 90c:	0f 91       	pop	r16
 90e:	ff 90       	pop	r15
 910:	ef 90       	pop	r14
 912:	df 90       	pop	r13
 914:	cf 90       	pop	r12
 916:	bf 90       	pop	r11
 918:	af 90       	pop	r10
 91a:	9f 90       	pop	r9
 91c:	8f 90       	pop	r8
 91e:	7f 90       	pop	r7
 920:	6f 90       	pop	r6
 922:	5f 90       	pop	r5
 924:	08 95       	ret

00000926 <LcdSingleBar>:
 *				   width  -> width of bar (in pixel)
 *				   mode   -> Off, On or Xor. See enum in pcd8544.h.
 * Return value :  see return value on pcd8544.h
 */
byte LcdSingleBar ( byte baseX, byte baseY, byte height, byte width, LcdPixelMode mode )
{
 926:	df 92       	push	r13
 928:	ef 92       	push	r14
 92a:	ff 92       	push	r15
 92c:	0f 93       	push	r16
 92e:	1f 93       	push	r17
 930:	cf 93       	push	r28
 932:	df 93       	push	r29
 934:	e8 2e       	mov	r14, r24
 936:	f6 2e       	mov	r15, r22
 938:	d0 2e       	mov	r13, r16
	byte tmpIdxX,tmpIdxY,tmp;

    byte response;

    /* Checking border */
	if ( ( baseX > LCD_X_RES ) || ( baseY > LCD_Y_RES ) ) return OUT_OF_BORDER;
 93a:	84 e5       	ldi	r24, 0x54	; 84
 93c:	8e 15       	cp	r24, r14
 93e:	28 f1       	brcs	.+74     	; 0x98a <LcdSingleBar+0x64>
 940:	80 e3       	ldi	r24, 0x30	; 48
 942:	86 17       	cp	r24, r22
 944:	10 f1       	brcs	.+68     	; 0x98a <LcdSingleBar+0x64>
	
	if ( height > baseY )
 946:	64 17       	cp	r22, r20
 948:	10 f4       	brcc	.+4      	; 0x94e <LcdSingleBar+0x28>
 94a:	00 e0       	ldi	r16, 0x00	; 0
 94c:	11 c0       	rjmp	.+34     	; 0x970 <LcdSingleBar+0x4a>
		tmp = 0;
	else
		tmp = baseY - height;
 94e:	06 2f       	mov	r16, r22
 950:	04 1b       	sub	r16, r20
 952:	0e c0       	rjmp	.+28     	; 0x970 <LcdSingleBar+0x4a>
    /* Draw lines */
	for ( tmpIdxY = tmp; tmpIdxY < baseY; tmpIdxY++ )
	{
		for ( tmpIdxX = baseX; tmpIdxX < (baseX + width); tmpIdxX++ )
        {
			response = LcdPixel( tmpIdxX, tmpIdxY, mode ); 
 954:	4d 2d       	mov	r20, r13
 956:	60 2f       	mov	r22, r16
 958:	81 2f       	mov	r24, r17
 95a:	00 df       	rcall	.-512    	; 0x75c <LcdPixel>
            if(response)
 95c:	88 23       	and	r24, r24
 95e:	b1 f4       	brne	.+44     	; 0x98c <LcdSingleBar+0x66>
		tmp = baseY - height;

    /* Draw lines */
	for ( tmpIdxY = tmp; tmpIdxY < baseY; tmpIdxY++ )
	{
		for ( tmpIdxX = baseX; tmpIdxX < (baseX + width); tmpIdxX++ )
 960:	1f 5f       	subi	r17, 0xFF	; 255
 962:	81 2f       	mov	r24, r17
 964:	90 e0       	ldi	r25, 0x00	; 0
 966:	8c 17       	cp	r24, r28
 968:	9d 07       	cpc	r25, r29
 96a:	a4 f3       	brlt	.-24     	; 0x954 <LcdSingleBar+0x2e>
		tmp = 0;
	else
		tmp = baseY - height;

    /* Draw lines */
	for ( tmpIdxY = tmp; tmpIdxY < baseY; tmpIdxY++ )
 96c:	0f 5f       	subi	r16, 0xFF	; 255
 96e:	04 c0       	rjmp	.+8      	; 0x978 <LcdSingleBar+0x52>
	{
		for ( tmpIdxX = baseX; tmpIdxX < (baseX + width); tmpIdxX++ )
 970:	ce 2d       	mov	r28, r14
 972:	d0 e0       	ldi	r29, 0x00	; 0
 974:	c2 0f       	add	r28, r18
 976:	d1 1d       	adc	r29, r1
		tmp = 0;
	else
		tmp = baseY - height;

    /* Draw lines */
	for ( tmpIdxY = tmp; tmpIdxY < baseY; tmpIdxY++ )
 978:	0f 15       	cp	r16, r15
 97a:	10 f4       	brcc	.+4      	; 0x980 <LcdSingleBar+0x5a>
 97c:	1e 2d       	mov	r17, r14
 97e:	f1 cf       	rjmp	.-30     	; 0x962 <LcdSingleBar+0x3c>

        }
	}

    /* Set update flag to be true */
	UpdateLcd = TRUE;
 980:	81 e0       	ldi	r24, 0x01	; 1
 982:	80 93 5e 02 	sts	0x025E, r24
 986:	80 e0       	ldi	r24, 0x00	; 0
 988:	01 c0       	rjmp	.+2      	; 0x98c <LcdSingleBar+0x66>
    return OK;
 98a:	81 e0       	ldi	r24, 0x01	; 1
}
 98c:	df 91       	pop	r29
 98e:	cf 91       	pop	r28
 990:	1f 91       	pop	r17
 992:	0f 91       	pop	r16
 994:	ff 90       	pop	r15
 996:	ef 90       	pop	r14
 998:	df 90       	pop	r13
 99a:	08 95       	ret

0000099c <LcdBars>:
 *				   width  -> width of bar (in pixel)
 * Return value :  None.
 * Note         :  Please check EMPTY_SPACE_BARS, BAR_X, BAR_Y in pcd8544.h 
 */  
byte LcdBars ( byte data[], byte numbBars, byte width, byte multiplier )
{
 99c:	af 92       	push	r10
 99e:	bf 92       	push	r11
 9a0:	cf 92       	push	r12
 9a2:	df 92       	push	r13
 9a4:	ef 92       	push	r14
 9a6:	ff 92       	push	r15
 9a8:	0f 93       	push	r16
 9aa:	1f 93       	push	r17
 9ac:	cf 93       	push	r28
 9ae:	df 93       	push	r29
 9b0:	7c 01       	movw	r14, r24
 9b2:	a6 2e       	mov	r10, r22
 9b4:	d4 2e       	mov	r13, r20
 9b6:	b2 2e       	mov	r11, r18
 9b8:	12 e0       	ldi	r17, 0x02	; 2
 9ba:	c1 2e       	mov	r12, r17
 9bc:	c4 0e       	add	r12, r20
 9be:	80 e0       	ldi	r24, 0x00	; 0
 9c0:	c0 e0       	ldi	r28, 0x00	; 0
 9c2:	d0 e0       	ldi	r29, 0x00	; 0
 9c4:	15 e0       	ldi	r17, 0x05	; 5
 9c6:	17 c0       	rjmp	.+46     	; 0x9f6 <LcdBars+0x5a>
    byte response;

	for ( b = 0;  b < numbBars ; b++ )
	{
        /* Preventing from out of border (LCD_X_RES) */
		if ( tmpIdx > LCD_X_RES ) return OUT_OF_BORDER;
 9c8:	85 35       	cpi	r24, 0x55	; 85
 9ca:	10 f0       	brcs	.+4      	; 0x9d0 <LcdBars+0x34>
 9cc:	81 e0       	ldi	r24, 0x01	; 1
 9ce:	19 c0       	rjmp	.+50     	; 0xa02 <LcdBars+0x66>
		
		/* Calculate x axis */
		tmpIdx = ((width + EMPTY_SPACE_BARS) * b) + BAR_X;

		/* Draw single bar */
		response = LcdSingleBar( tmpIdx, BAR_Y, data[ b ] * multiplier, width, PIXEL_ON);  
 9d0:	f7 01       	movw	r30, r14
 9d2:	ec 0f       	add	r30, r28
 9d4:	fd 1f       	adc	r31, r29
 9d6:	40 81       	ld	r20, Z
 9d8:	b4 9e       	mul	r11, r20
 9da:	40 2d       	mov	r20, r0
 9dc:	11 24       	eor	r1, r1
 9de:	01 e0       	ldi	r16, 0x01	; 1
 9e0:	2d 2d       	mov	r18, r13
 9e2:	66 e2       	ldi	r22, 0x26	; 38
 9e4:	81 2f       	mov	r24, r17
 9e6:	9f df       	rcall	.-194    	; 0x926 <LcdSingleBar>
 9e8:	21 96       	adiw	r28, 0x01	; 1
 9ea:	91 2f       	mov	r25, r17
 9ec:	9c 0d       	add	r25, r12
        if(response == OUT_OF_BORDER)
 9ee:	81 30       	cpi	r24, 0x01	; 1
 9f0:	41 f0       	breq	.+16     	; 0xa02 <LcdBars+0x66>
 9f2:	81 2f       	mov	r24, r17
 9f4:	19 2f       	mov	r17, r25
{
	byte b;
	byte tmpIdx = 0;
    byte response;

	for ( b = 0;  b < numbBars ; b++ )
 9f6:	ca 15       	cp	r28, r10
 9f8:	38 f3       	brcs	.-50     	; 0x9c8 <LcdBars+0x2c>
        if(response == OUT_OF_BORDER)
            return response;
	}

	/* Set update flag to be true */
	UpdateLcd = TRUE;
 9fa:	81 e0       	ldi	r24, 0x01	; 1
 9fc:	80 93 5e 02 	sts	0x025E, r24
 a00:	80 e0       	ldi	r24, 0x00	; 0
    return OK;

}
 a02:	df 91       	pop	r29
 a04:	cf 91       	pop	r28
 a06:	1f 91       	pop	r17
 a08:	0f 91       	pop	r16
 a0a:	ff 90       	pop	r15
 a0c:	ef 90       	pop	r14
 a0e:	df 90       	pop	r13
 a10:	cf 90       	pop	r12
 a12:	bf 90       	pop	r11
 a14:	af 90       	pop	r10
 a16:	08 95       	ret

00000a18 <LcdRect>:
 *				   y2   -> absolute second y axis coordinate
 *				   mode -> Off, On or Xor. See enum in pcd8544.h.
 * Return value :  see return value on pcd8544.h.
 */
byte LcdRect ( byte x1, byte x2, byte y1, byte y2, LcdPixelMode mode )
{
 a18:	cf 92       	push	r12
 a1a:	df 92       	push	r13
 a1c:	ef 92       	push	r14
 a1e:	ff 92       	push	r15
 a20:	0f 93       	push	r16
 a22:	1f 93       	push	r17
 a24:	d8 2e       	mov	r13, r24
 a26:	e6 2e       	mov	r14, r22
 a28:	f2 2e       	mov	r15, r18
 a2a:	c0 2e       	mov	r12, r16
	byte tmpIdxX,tmpIdxY;
    byte response;

	/* Checking border */
	if ( ( x1 > LCD_X_RES ) ||  ( x2 > LCD_X_RES ) || ( y1 > LCD_Y_RES ) || ( y2 > LCD_Y_RES ) )
 a2c:	84 e5       	ldi	r24, 0x54	; 84
 a2e:	8d 15       	cp	r24, r13
 a30:	f8 f0       	brcs	.+62     	; 0xa70 <LcdRect+0x58>
 a32:	86 17       	cp	r24, r22
 a34:	e8 f0       	brcs	.+58     	; 0xa70 <LcdRect+0x58>
 a36:	41 33       	cpi	r20, 0x31	; 49
 a38:	d8 f4       	brcc	.+54     	; 0xa70 <LcdRect+0x58>
 a3a:	80 e3       	ldi	r24, 0x30	; 48
 a3c:	82 17       	cp	r24, r18
 a3e:	c0 f0       	brcs	.+48     	; 0xa70 <LcdRect+0x58>
		/* If out of border then return */
		return OUT_OF_BORDER;

	if ( ( x2 > x1 ) && ( y2 > y1 ) )
 a40:	d6 16       	cp	r13, r22
 a42:	c0 f4       	brcc	.+48     	; 0xa74 <LcdRect+0x5c>
 a44:	42 17       	cp	r20, r18
 a46:	b0 f4       	brcc	.+44     	; 0xa74 <LcdRect+0x5c>
 a48:	04 2f       	mov	r16, r20
 a4a:	0a c0       	rjmp	.+20     	; 0xa60 <LcdRect+0x48>
		{		
			/* Draw line horizontally */
			for ( tmpIdxX = x1; tmpIdxX < x2; tmpIdxX++ )
            {
				/* Draw a pixel */
				response = LcdPixel( tmpIdxX, tmpIdxY, mode ); 
 a4c:	4c 2d       	mov	r20, r12
 a4e:	60 2f       	mov	r22, r16
 a50:	81 2f       	mov	r24, r17
 a52:	84 de       	rcall	.-760    	; 0x75c <LcdPixel>
                if(response)
 a54:	88 23       	and	r24, r24
 a56:	79 f4       	brne	.+30     	; 0xa76 <LcdRect+0x5e>
	if ( ( x2 > x1 ) && ( y2 > y1 ) )
	{ 
		for ( tmpIdxY = y1; tmpIdxY < y2; tmpIdxY++ )
		{		
			/* Draw line horizontally */
			for ( tmpIdxX = x1; tmpIdxX < x2; tmpIdxX++ )
 a58:	1f 5f       	subi	r17, 0xFF	; 255
 a5a:	1e 15       	cp	r17, r14
 a5c:	b8 f3       	brcs	.-18     	; 0xa4c <LcdRect+0x34>
		/* If out of border then return */
		return OUT_OF_BORDER;

	if ( ( x2 > x1 ) && ( y2 > y1 ) )
	{ 
		for ( tmpIdxY = y1; tmpIdxY < y2; tmpIdxY++ )
 a5e:	0f 5f       	subi	r16, 0xFF	; 255
 a60:	0f 15       	cp	r16, r15
 a62:	10 f4       	brcc	.+4      	; 0xa68 <LcdRect+0x50>
 a64:	1d 2d       	mov	r17, r13
 a66:	f9 cf       	rjmp	.-14     	; 0xa5a <LcdRect+0x42>
                    return response;
            }
		}

		/* Set update flag to be true */
		UpdateLcd = TRUE;
 a68:	81 e0       	ldi	r24, 0x01	; 1
 a6a:	80 93 5e 02 	sts	0x025E, r24
 a6e:	02 c0       	rjmp	.+4      	; 0xa74 <LcdRect+0x5c>
 a70:	81 e0       	ldi	r24, 0x01	; 1
 a72:	01 c0       	rjmp	.+2      	; 0xa76 <LcdRect+0x5e>
 a74:	80 e0       	ldi	r24, 0x00	; 0
	}
    return OK;	
}
 a76:	1f 91       	pop	r17
 a78:	0f 91       	pop	r16
 a7a:	ff 90       	pop	r15
 a7c:	ef 90       	pop	r14
 a7e:	df 90       	pop	r13
 a80:	cf 90       	pop	r12
 a82:	08 95       	ret

⌨️ 快捷键说明

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