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

📄 main.c.lss

📁 AVR单片机控制的PDIUSBD12原程序
💻 LSS
📖 第 1 页 / 共 5 页
字号:
 404:	42 c0       	rjmp	.+132    	; 0x48a <__stack+0x2b>
	outportb(D12_COMMAND,0x80+endp);		//读取端点状态
 406:	c0 58       	subi	r28, 0x80	; 128
 408:	df 4f       	sbci	r29, 0xFF	; 255
 40a:	be 01       	movw	r22, r28
 40c:	83 e0       	ldi	r24, 0x03	; 3
 40e:	90 e0       	ldi	r25, 0x00	; 0
 410:	0e 94 03 01 	call	0x206 <outportb>
	i=inportb(D12_DATA);
 414:	82 e0       	ldi	r24, 0x02	; 2
 416:	90 e0       	ldi	r25, 0x00	; 0
 418:	0e 94 13 01 	call	0x226 <inportb>
	i=i & 0x60;
 41c:	c8 2f       	mov	r28, r24
 41e:	c0 76       	andi	r28, 0x60	; 96
	if(endp==4)
 420:	84 e0       	ldi	r24, 0x04	; 4
 422:	e8 16       	cp	r14, r24
 424:	49 f4       	brne	.+18     	; 0x438 <D12_ReadEndpoint+0x66>
 426:	80 91 23 01 	lds	r24, 0x0123
	{
		if(i==0x60)
 42a:	c0 36       	cpi	r28, 0x60	; 96
 42c:	11 f4       	brne	.+4      	; 0x432 <D12_ReadEndpoint+0x60>
			bEPPflags.bits.ep2buf_full=1;	//标志端点2缓冲区全满
 42e:	80 61       	ori	r24, 0x10	; 16
 430:	01 c0       	rjmp	.+2      	; 0x434 <D12_ReadEndpoint+0x62>
		else
			bEPPflags.bits.ep2buf_full=0;
 432:	8f 7e       	andi	r24, 0xEF	; 239
 434:	80 93 23 01 	sts	0x0123, r24
	}
	outportb(D12_COMMAND,0xF0);
 438:	60 ef       	ldi	r22, 0xF0	; 240
 43a:	70 e0       	ldi	r23, 0x00	; 0
 43c:	83 e0       	ldi	r24, 0x03	; 3
 43e:	90 e0       	ldi	r25, 0x00	; 0
 440:	0e 94 03 01 	call	0x206 <outportb>
	j=inportb(D12_DATA);
 444:	82 e0       	ldi	r24, 0x02	; 2
 446:	90 e0       	ldi	r25, 0x00	; 0
 448:	0e 94 13 01 	call	0x226 <inportb>
	j=inportb(D12_DATA);
 44c:	82 e0       	ldi	r24, 0x02	; 2
 44e:	90 e0       	ldi	r25, 0x00	; 0
 450:	0e 94 13 01 	call	0x226 <inportb>
 454:	f8 2e       	mov	r15, r24
	if(j>len)
 456:	d8 16       	cp	r13, r24
 458:	08 f4       	brcc	.+2      	; 0x45c <D12_ReadEndpoint+0x8a>
		j=len;
 45a:	fd 2c       	mov	r15, r13
	for(i=0;i<j;i++)
 45c:	c0 e0       	ldi	r28, 0x00	; 0
 45e:	cf 15       	cp	r28, r15
 460:	48 f4       	brcc	.+18     	; 0x474 <__stack+0x15>
		*(buf+i)=inportb(D12_DATA);
 462:	82 e0       	ldi	r24, 0x02	; 2
 464:	90 e0       	ldi	r25, 0x00	; 0
 466:	0e 94 13 01 	call	0x226 <inportb>
 46a:	f8 01       	movw	r30, r16
 46c:	81 93       	st	Z+, r24
 46e:	8f 01       	movw	r16, r30
 470:	cf 5f       	subi	r28, 0xFF	; 255
 472:	f5 cf       	rjmp	.-22     	; 0x45e <D12_ReadEndpoint+0x8c>
	outportb(D12_COMMAND,0xF2);
 474:	62 ef       	ldi	r22, 0xF2	; 242
 476:	70 e0       	ldi	r23, 0x00	; 0
 478:	83 e0       	ldi	r24, 0x03	; 3
 47a:	90 e0       	ldi	r25, 0x00	; 0
 47c:	0e 94 03 01 	call	0x206 <outportb>
	D12_ReadLastTransactionStatus(endp);
 480:	8e 2d       	mov	r24, r14
 482:	0e 94 9b 01 	call	0x336 <D12_ReadLastTransactionStatus>
	return j;
 486:	8f 2d       	mov	r24, r15
 488:	99 27       	eor	r25, r25
 48a:	df 91       	pop	r29
 48c:	cf 91       	pop	r28
 48e:	1f 91       	pop	r17
 490:	0f 91       	pop	r16
 492:	ff 90       	pop	r15
 494:	ef 90       	pop	r14
 496:	df 90       	pop	r13
 498:	08 95       	ret

0000049a <D12_WriteEndpoint>:
}
//把数据写入端点
unsigned char D12_WriteEndpoint(unsigned char endp,unsigned char len,unsigned char *buf)
{
 49a:	df 92       	push	r13
 49c:	ef 92       	push	r14
 49e:	ff 92       	push	r15
 4a0:	0f 93       	push	r16
 4a2:	1f 93       	push	r17
 4a4:	cf 93       	push	r28
 4a6:	df 93       	push	r29
 4a8:	d8 2e       	mov	r13, r24
 4aa:	06 2f       	mov	r16, r22
 4ac:	ea 01       	movw	r28, r20
	unsigned char i,j;
	outportb(D12_COMMAND,endp);	
 4ae:	99 27       	eor	r25, r25
 4b0:	bc 01       	movw	r22, r24
 4b2:	83 e0       	ldi	r24, 0x03	; 3
 4b4:	90 e0       	ldi	r25, 0x00	; 0
 4b6:	0e 94 03 01 	call	0x206 <outportb>
	i=inportb(D12_DATA);
 4ba:	82 e0       	ldi	r24, 0x02	; 2
 4bc:	90 e0       	ldi	r25, 0x00	; 0
 4be:	0e 94 13 01 	call	0x226 <inportb>
	outportb(D12_COMMAND,0xF0);
 4c2:	60 ef       	ldi	r22, 0xF0	; 240
 4c4:	70 e0       	ldi	r23, 0x00	; 0
 4c6:	83 e0       	ldi	r24, 0x03	; 3
 4c8:	90 e0       	ldi	r25, 0x00	; 0
 4ca:	0e 94 03 01 	call	0x206 <outportb>
	outportb(D12_DATA,0);
 4ce:	60 e0       	ldi	r22, 0x00	; 0
 4d0:	70 e0       	ldi	r23, 0x00	; 0
 4d2:	82 e0       	ldi	r24, 0x02	; 2
 4d4:	90 e0       	ldi	r25, 0x00	; 0
 4d6:	0e 94 03 01 	call	0x206 <outportb>
	outportb(D12_DATA,len);
 4da:	e0 2e       	mov	r14, r16
 4dc:	ff 24       	eor	r15, r15
 4de:	b7 01       	movw	r22, r14
 4e0:	82 e0       	ldi	r24, 0x02	; 2
 4e2:	90 e0       	ldi	r25, 0x00	; 0
 4e4:	0e 94 03 01 	call	0x206 <outportb>
	for(j=0;j<len;j++)
 4e8:	10 e0       	ldi	r17, 0x00	; 0
 4ea:	10 17       	cp	r17, r16
 4ec:	48 f4       	brcc	.+18     	; 0x500 <D12_WriteEndpoint+0x66>
		outportb(D12_DATA,*(buf+j));
 4ee:	89 91       	ld	r24, Y+
 4f0:	99 27       	eor	r25, r25
 4f2:	bc 01       	movw	r22, r24
 4f4:	82 e0       	ldi	r24, 0x02	; 2
 4f6:	90 e0       	ldi	r25, 0x00	; 0
 4f8:	0e 94 03 01 	call	0x206 <outportb>
 4fc:	1f 5f       	subi	r17, 0xFF	; 255
 4fe:	f5 cf       	rjmp	.-22     	; 0x4ea <D12_WriteEndpoint+0x50>
	outportb(D12_COMMAND,0xFA);
 500:	6a ef       	ldi	r22, 0xFA	; 250
 502:	70 e0       	ldi	r23, 0x00	; 0
 504:	83 e0       	ldi	r24, 0x03	; 3
 506:	90 e0       	ldi	r25, 0x00	; 0
 508:	0e 94 03 01 	call	0x206 <outportb>
	D12_ReadLastTransactionStatus(endp);
 50c:	8d 2d       	mov	r24, r13
 50e:	0e 94 9b 01 	call	0x336 <D12_ReadLastTransactionStatus>
	return len;
}
 512:	c7 01       	movw	r24, r14
 514:	df 91       	pop	r29
 516:	cf 91       	pop	r28
 518:	1f 91       	pop	r17
 51a:	0f 91       	pop	r16
 51c:	ff 90       	pop	r15
 51e:	ef 90       	pop	r14
 520:	df 90       	pop	r13
 522:	08 95       	ret

00000524 <D12_AcknowledgeEndpoint>:
//端点应答处理
void D12_AcknowledgeEndpoint(unsigned char endp)
{
 524:	1f 93       	push	r17
 526:	18 2f       	mov	r17, r24
	outportb(D12_COMMAND,endp);	
 528:	99 27       	eor	r25, r25
 52a:	bc 01       	movw	r22, r24
 52c:	83 e0       	ldi	r24, 0x03	; 3
 52e:	90 e0       	ldi	r25, 0x00	; 0
 530:	0e 94 03 01 	call	0x206 <outportb>
	outportb(D12_COMMAND,0xF1);	
 534:	61 ef       	ldi	r22, 0xF1	; 241
 536:	70 e0       	ldi	r23, 0x00	; 0
 538:	83 e0       	ldi	r24, 0x03	; 3
 53a:	90 e0       	ldi	r25, 0x00	; 0
 53c:	0e 94 03 01 	call	0x206 <outportb>
	if(endp==0)
 540:	11 23       	and	r17, r17
 542:	31 f4       	brne	.+12     	; 0x550 <D12_AcknowledgeEndpoint+0x2c>
		outportb(D12_COMMAND,0xF2);	
 544:	62 ef       	ldi	r22, 0xF2	; 242
 546:	70 e0       	ldi	r23, 0x00	; 0
 548:	83 e0       	ldi	r24, 0x03	; 3
 54a:	90 e0       	ldi	r25, 0x00	; 0
 54c:	0e 94 03 01 	call	0x206 <outportb>
 550:	1f 91       	pop	r17
 552:	08 95       	ret

00000554 <stall_ep0>:


}
//
void stall_ep0(void)
{
//	outportb(D12_COMMAND,0);	
//	outportb(D12_COMMAND,0xF1);	
	D12_SetEndpointStatus(0,1);
 554:	61 e0       	ldi	r22, 0x01	; 1
 556:	80 e0       	ldi	r24, 0x00	; 0
 558:	0e 94 a9 01 	call	0x352 <D12_SetEndpointStatus>
	D12_SetEndpointStatus(1,1);
 55c:	61 e0       	ldi	r22, 0x01	; 1
 55e:	86 2f       	mov	r24, r22
 560:	0e 94 a9 01 	call	0x352 <D12_SetEndpointStatus>
 564:	08 95       	ret

00000566 <dma_eot>:
	}	
}
//MDA结束处理
void dma_eot(void)
{
 566:	08 95       	ret

00000568 <main_txdone>:
//	LED();
}
//端点1IN处理
void ep1_txdone(void)
{
	unsigned char j;
	j=D12_ReadLastTransactionStatus(3);			//清中断标志位
//	LED();
}
//端点1OUT处理
void ep1_rxdone(void)
{
	unsigned char len,j;
	j=D12_ReadLastTransactionStatus(2);			//清中断标志位
	len=D12_ReadEndpoint(2,sizeof(GenEpBuf),GenEpBuf);//读取数据
	if(len != 0)
		bEPPflags.bits.ep1_rxdone=1;			//标志接收到数据
//	LED();
}
//主端点IN控制
void main_txdone(void)
{
	unsigned char j;
	j=D12_ReadLastTransactionStatus(5);			//清中断标志位	
 568:	85 e0       	ldi	r24, 0x05	; 5
 56a:	0e 94 9b 01 	call	0x336 <D12_ReadLastTransactionStatus>
 56e:	08 95       	ret

00000570 <ep1_txdone>:
 570:	83 e0       	ldi	r24, 0x03	; 3
 572:	0e 94 9b 01 	call	0x336 <D12_ReadLastTransactionStatus>
 576:	08 95       	ret

00000578 <ep1_rxdone>:
 578:	82 e0       	ldi	r24, 0x02	; 2
 57a:	0e 94 9b 01 	call	0x336 <D12_ReadLastTransactionStatus>
 57e:	40 ee       	ldi	r20, 0xE0	; 224
 580:	50 e0       	ldi	r21, 0x00	; 0
 582:	60 e4       	ldi	r22, 0x40	; 64
 584:	82 e0       	ldi	r24, 0x02	; 2
 586:	0e 94 e9 01 	call	0x3d2 <D12_ReadEndpoint>
 58a:	88 23       	and	r24, r24
 58c:	29 f0       	breq	.+10     	; 0x598 <ep1_rxdone+0x20>
 58e:	80 91 23 01 	lds	r24, 0x0123
 592:	84 60       	ori	r24, 0x04	; 4
 594:	80 93 23 01 	sts	0x0123, r24
 598:	08 95       	ret

0000059a <ep0_rxdone>:
 59a:	80 e0       	ldi	r24, 0x00	; 0
 59c:	0e 94 9b 01 	call	0x336 <D12_ReadLastTransactionStatus>
 5a0:	85 ff       	sbrs	r24, 5
 5a2:	4f c0       	rjmp	.+158    	; 0x642 <ep0_rxdone+0xa8>
 5a4:	10 92 2d 01 	sts	0x012D, r1
 5a8:	10 92 2c 01 	sts	0x012C, r1
 5ac:	10 92 2f 01 	sts	0x012F, r1
 5b0:	10 92 2e 01 	sts	0x012E, r1
 5b4:	44 e2       	ldi	r20, 0x24	; 36
 5b6:	51 e0       	ldi	r21, 0x01	; 1
 5b8:	68 e0       	ldi	r22, 0x08	; 8
 5ba:	80 e0       	ldi	r24, 0x00	; 0
 5bc:	0e 94 e9 01 	call	0x3d2 <D12_ReadEndpoint>
 5c0:	88 30       	cpi	r24, 0x08	; 8
 5c2:	59 f0       	breq	.+22     	; 0x5da <ep0_rxdone+0x40>
 5c4:	61 e0       	ldi	r22, 0x01	; 1
 5c6:	80 e0       	ldi	r24, 0x00	; 0
 5c8:	0e 94 a9 01 	call	0x352 <D12_SetEndpointStatus>
 5cc:	61 e0       	ldi	r22, 0x01	; 1
 5ce:	86 2f       	mov	r24, r22
 5d0:	0e 94 a9 01 	call	0x352 <D12_SetEndpointStatus>
 5d4:	80 91 22 01 	lds	r24, 0x0122
 5d8:	5b c0       	rjmp	.+182    	; 0x690 <ep0_rxdone+0xf6>
 5da:	80 e0       	ldi	r24, 0x00	; 0
 5dc:	0e 94 92 02 	call	0x524 <D12_AcknowledgeEndpoint>
 5e0:	81 e0       	ldi	r24, 0x01	; 1
 5e2:	0e 94 92 02 	call	0x524 <D12_AcknowledgeEndpoint>
 5e6:	20 91 2a 01 	lds	r18, 0x012A
 5ea:	30 91 2b 01 	lds	r19, 0x012B
 5ee:	30 93 2d 01 	sts	0x012D, r19
 5f2:	20 93 2c 01 	sts	0x012C, r18
 5f6:	10 92 2f 01 	sts	0x012F, r1
 5fa:	10 92 2e 01 	sts	0x012E, r1
 5fe:	80 91 24 01 	lds	r24, 0x0124
 602:	87 ff       	sbrs	r24, 7
 604:	07 c0       	rjmp	.+14     	; 0x614 <ep0_rxdone+0x7a>
 606:	80 91 22 01 	lds	r24, 0x0122
 60a:	8f 77       	andi	r24, 0x7F	; 127
 60c:	88 64       	ori	r24, 0x48	; 72
 60e:	80 93 22 01 	sts	0x0122, r24
 612:	08 95       	ret
 614:	21 15       	cp	r18, r1
 616:	31 05       	cpc	r19, r1
 618:	c1 f1       	breq	.+112    	; 0x68a <ep0_rxdone+0xf0>
 61a:	80 91 22 01 	lds	r24, 0x0122
 61e:	29 30       	cpi	r18, 0x09	; 9
 620:	31 05       	cpc	r19, r1
 622:	60 f0       	brcs	.+24     	; 0x63c <ep0_rxdone+0xa2>
 624:	8f 73       	andi	r24, 0x3F	; 63
 626:	80 93 22 01 	sts	0x0122, r24
 62a:	61 e0       	ldi	r22, 0x01	; 1
 62c:	80 e0       	ldi	r24, 0x00	; 0
 62e:	0e 94 a9 01 	call	0x352 <D12_SetEndpointStatus>
 632:	61 e0       	ldi	r22, 0x01	; 1
 634:	86 2f       	mov	r24, r22
 636:	0e 94 a9 01 	call	0x352 <D12_SetEndpointStatus>
 63a:	08 95       	ret
 63c:	8f 73       	andi	r24, 0x3F	; 63
 63e:	80 68       	ori	r24, 0x80	; 128
 640:	e6 cf       	rjmp	.-52     	; 0x60e <ep0_rxdone+0x74>
 642:	90 91 22 01 	lds	r25, 0x0122
 646:	89 2f       	mov	r24, r25
 648:	80 7c       	andi	r24, 0xC0	; 192
 64a:	80 38       	cpi	r24, 0x80	; 128
 64c:	19 f5       	brne	.+70     	; 0x694 <ep0_rxdone+0xfa>
 64e:	80 91 2e 01 	lds	r24, 0x012E
 652:	90 91 2f 01 	lds	r25, 0x012F
 656:	8e 5c       	subi	r24, 0xCE	; 206
 658:	9e 4f       	sbci	r25, 0xFE	; 254
 65a:	ac 01       	movw	r20, r24
 65c:	60 e1       	ldi	r22, 0x10	; 16
 65e:	80 e0       	ldi	r24, 0x00	; 0
 660:	0e 94 e9 01 	call	0x3d2 <D12_ReadEndpoint>
 664:	20 91 2e 01 	lds	r18, 0x012E
 668:	30 91 2f 01 	lds	r19, 0x012F
 66c:	28 0f       	add	r18, r24
 66e:	31 1d       	adc	r19, r1
 670:	30 93 2f 01 	sts	0x012F, r19
 674:	20 93 2e 01 	sts	0x012E, r18
 678:	80 31       	cpi	r24, 0x10	; 16
 67a:	39 f4       	brne	.+14     	; 0x68a <ep0_rxdone+0xf0>
 67c:	80 91 2c 01 	lds	r24, 0x012C
 680:	90 91 2d 01 	lds	r25, 0x012D
 684:	28 17       	cp	r18, r24
 686:	39 07       	cpc	r19, r25
 688:	40 f0       	brcs	.+16     	; 0x69a <ep0_rxdone+0x100>
 68a:	80 91 22 01 	lds	r24, 0x0122
 68e:	88 60       	ori	r24, 0x08	; 8
 690:	8f 73       	andi	r24, 0x3F	; 63
 692:	bd cf       	rjmp	.-134    	; 0x60e <ep0_rxdone+0x74>
 694:	9f 73       	andi	r25, 0x3F	; 63
 696:	90 93 22 01 	sts	0x0122, r25
 69a:	08 95       	ret

0000069c <ep0_txdone>:
 69c:	cf 93       	push	r28
 69e:	df 93       	push	r29
 6a0:	c0 91 2c 01 	lds	r28, 0x012C
 6a4:	d0 91 2d 01 	lds	r29, 0x012D
 6a8:	80 91 2e 01 	lds	r24, 0x012E
 6ac:	90 91 2f 01 	lds	r25, 0x012F
 6b0:	c8 1b       	sub	r28, r24
 6b2:	d9 0b       	sbc	r29, r25
 6b4:	81 e0       	ldi	r24, 0x01	; 1
 6b6:	0e 94 9b 01 	call	0x336 <D12_ReadLastTransactionStatus>
 6ba:	80 91 22 01 	lds	r24, 0x0122
 6be:	80 7c       	andi	r24, 0xC0	; 192
 6c0:	80 34       	cpi	r24, 0x40	; 64
 6c2:	09 f0       	breq	.+2      	; 0x6c6 <ep0_txdone+0x2a>
 6c4:	46 c0       	rjmp	.+140    	; 0x752 <ep0_txdone+0xb6>
 6c6:	c0 31       	cpi	r28, 0x10	; 16
 6c8:	d1 05       	cpc	r29, r1
 6ca:	ec f0       	brlt	.+58     	; 0x706 <ep0_txdone+0x6a>
 6cc:	80 91 30 01 	lds	r24, 0x0130
 6d0:	90 91 31 01 	lds	r25, 0x0131
 6d4:	20 91 2e 01 	lds	r18, 0x012E
 6d8:	30 91 2f 01 	lds	r19, 0x012F
 6dc:	82 0f       	add	r24, r18
 6de:	93 1f       	adc	r25, r19

⌨️ 快捷键说明

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