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

📄 avrcam.lss

📁 mg128+Ov7620实现图象采集
💻 LSS
📖 第 1 页 / 共 5 页
字号:
 584:	69 f4       	brne	.+26     	; 0x5a0
	{
		pData = AVRcamVersion;
 586:	c1 e0       	ldi	r28, 0x01	; 1
 588:	d1 e0       	ldi	r29, 0x01	; 1
		while(*pData != 0)
		{		
			UIMgr_writeTxFifo(*pData++);
 58a:	80 91 01 01 	lds	r24, 0x0101
 58e:	88 23       	and	r24, r24
 590:	99 f1       	breq	.+102    	; 0x5f8
 592:	89 91       	ld	r24, Y+
 594:	0e 94 ed 03 	call	0x7da
 598:	88 81       	ld	r24, Y
 59a:	88 23       	and	r24, r24
 59c:	d1 f7       	brne	.-12     	; 0x592
 59e:	2c c0       	rjmp	.+88     	; 0x5f8
		}
	}		
	else if (receivedCmd == resetCameraCmd)
 5a0:	80 91 00 01 	lds	r24, 0x0100
 5a4:	84 30       	cpi	r24, 0x04	; 4
 5a6:	19 f4       	brne	.+6      	; 0x5ae
	{
		CamInt_resetCam();
 5a8:	0e 94 86 00 	call	0x10c
 5ac:	25 c0       	rjmp	.+74     	; 0x5f8
	}
	else if (receivedCmd == dumpFrameCmd)
 5ae:	80 91 00 01 	lds	r24, 0x0100
 5b2:	83 30       	cpi	r24, 0x03	; 3
 5b4:	41 f4       	brne	.+16     	; 0x5c6
	{
		/* publish the event that will indicate that
		a request has come to dump a frame...this will
		be received by the FrameMgr, which will begin
		dumping the frame...a short delay is needed
		here to keep the Java demo app happy (sometimes
		it wouldn't be able to receive the serial data
		as quickly as AVRcam can provide it). */
		Utility_delay(100);
 5b6:	84 e6       	ldi	r24, 0x64	; 100
 5b8:	90 e0       	ldi	r25, 0x00	; 0
 5ba:	0e 94 fe 05 	call	0xbfc
		PUBLISH_EVENT(EV_DUMP_FRAME);
 5be:	82 e0       	ldi	r24, 0x02	; 2
 5c0:	0e 94 00 01 	call	0x200
 5c4:	19 c0       	rjmp	.+50     	; 0x5f8
	}
	else if (receivedCmd == setCameraRegsCmd)
 5c6:	80 91 00 01 	lds	r24, 0x0100
 5ca:	82 30       	cpi	r24, 0x02	; 2
 5cc:	a9 f4       	brne	.+42     	; 0x5f8
	{
		/* we need to gather the tokens and
		build config cmds to be sent to the camera */
		for (i=1; i<tokenCount; i+=2)  /* starts at 1 since first token
 5ce:	c1 e0       	ldi	r28, 0x01	; 1
 5d0:	80 91 19 01 	lds	r24, 0x0119
 5d4:	c8 17       	cp	r28, r24
 5d6:	70 f4       	brcc	.+28     	; 0x5f4
											is the CR cmd */
		{
			CamConfig_setCamReg(tokenBuffer[i],tokenBuffer[i+1]);
 5d8:	8c 2f       	mov	r24, r28
 5da:	99 27       	eor	r25, r25
 5dc:	fc 01       	movw	r30, r24
 5de:	e2 5e       	subi	r30, 0xE2	; 226
 5e0:	fe 4f       	sbci	r31, 0xFE	; 254
 5e2:	61 81       	ldd	r22, Z+1	; 0x01
 5e4:	80 81       	ld	r24, Z
 5e6:	0e 94 9b 05 	call	0xb36
 5ea:	ce 5f       	subi	r28, 0xFE	; 254
 5ec:	80 91 19 01 	lds	r24, 0x0119
 5f0:	c8 17       	cp	r28, r24
 5f2:	90 f3       	brcs	.-28     	; 0x5d8
		}
		CamConfig_sendFifoCmds();
 5f4:	0e 94 a1 05 	call	0xb42
 5f8:	df 91       	pop	r29
 5fa:	cf 91       	pop	r28
 5fc:	08 95       	ret

000005fe <UIMgr_convertTokenToValue>:
	}
	
	
}

/***********************************************************
	Function Name: UIMgr_convertTokenToValue
	Function Description: This function is responsible for
	converting a received token to a hex value It will
	access the asciiTokenBuffer directly, and store the
	result in the appropriate token buffer.
	Inputs:  none 
	Outputs: none
***********************************************************/	
static void UIMgr_convertTokenToValue(void)
{
	unsigned int newValue;
	
	newValue = atoi(asciiTokenBuffer);//The atoi() function converts the initial portion of the string
 5fe:	8a e1       	ldi	r24, 0x1A	; 26
 600:	91 e0       	ldi	r25, 0x01	; 1
 602:	0e 94 96 06 	call	0xd2c
 606:	ac 01       	movw	r20, r24
                                      //pointed to by \c nptr to integer representation.
	if (newValue > 255)
 608:	8f 3f       	cpi	r24, 0xFF	; 255
 60a:	91 05       	cpc	r25, r1
 60c:	71 f0       	breq	.+28     	; 0x62a
 60e:	68 f0       	brcs	.+26     	; 0x62a
	{
		/* the value is too large */
		receivedCmd = invalidCmd;
 610:	86 e0       	ldi	r24, 0x06	; 6
 612:	80 93 00 01 	sts	0x0100, r24
		tokenBuffer[tokenCount] = 0xFF;  /* to indicate an error */
 616:	20 91 19 01 	lds	r18, 0x0119
 61a:	8e e1       	ldi	r24, 0x1E	; 30
 61c:	91 e0       	ldi	r25, 0x01	; 1
 61e:	fc 01       	movw	r30, r24
 620:	e2 0f       	add	r30, r18
 622:	f1 1d       	adc	r31, r1
 624:	8f ef       	ldi	r24, 0xFF	; 255
 626:	80 83       	st	Z, r24
 628:	08 c0       	rjmp	.+16     	; 0x63a
	}
	else
	{
		/* copy the value into the tokenBuffer */
		tokenBuffer[tokenCount] = newValue;
 62a:	80 91 19 01 	lds	r24, 0x0119
 62e:	2e e1       	ldi	r18, 0x1E	; 30
 630:	31 e0       	ldi	r19, 0x01	; 1
 632:	f9 01       	movw	r30, r18
 634:	e8 0f       	add	r30, r24
 636:	f1 1d       	adc	r31, r1
 638:	40 83       	st	Z, r20
	}
	memset(asciiTokenBuffer,0x00,MAX_TOKEN_LENGTH);
 63a:	83 e0       	ldi	r24, 0x03	; 3
 63c:	ea e1       	ldi	r30, 0x1A	; 26
 63e:	f1 e0       	ldi	r31, 0x01	; 1
 640:	11 92       	st	Z+, r1
 642:	8a 95       	dec	r24
 644:	e9 f7       	brne	.-6      	; 0x640
	charIndex = 0;
 646:	10 92 18 01 	sts	0x0118, r1
	charCount = 0;
 64a:	10 92 17 01 	sts	0x0117, r1
 64e:	08 95       	ret

00000650 <UIMgr_convertTokenToCmd>:
}
/***********************************************************
	Function Name: UIMgr_convertTokenToCmd
	Function Description: This function is responsible for
	parsing a received 2-character command.  It will
	access the asciiTokenBuffer directly.
	Inputs:  none 
	Outputs: none
***********************************************************/	
static void UIMgr_convertTokenToCmd(void)
{
	if ( (asciiTokenBuffer[0] == 'P') &&
 650:	80 91 1a 01 	lds	r24, 0x011A
 654:	80 35       	cpi	r24, 0x50	; 80
 656:	41 f4       	brne	.+16     	; 0x668
 658:	80 91 1b 01 	lds	r24, 0x011B
 65c:	87 34       	cpi	r24, 0x47	; 71
 65e:	21 f4       	brne	.+8      	; 0x668
		 (asciiTokenBuffer[1] == 'G') )
	{
		/* we got a "ping" command...but we still need to see
		if we are going to get the \r */
		receivedCmd = pingCmd;
 660:	81 e0       	ldi	r24, 0x01	; 1
 662:	80 93 00 01 	sts	0x0100, r24
 666:	32 c0       	rjmp	.+100    	; 0x6cc
	}
	else if ( (asciiTokenBuffer[0] == 'G') &&
 668:	80 91 1a 01 	lds	r24, 0x011A
 66c:	87 34       	cpi	r24, 0x47	; 71
 66e:	39 f4       	brne	.+14     	; 0x67e
 670:	80 91 1b 01 	lds	r24, 0x011B
 674:	86 35       	cpi	r24, 0x56	; 86
 676:	19 f4       	brne	.+6      	; 0x67e
			   (asciiTokenBuffer[1] == 'V') )
	{
		/* we got the "get version" command */
		receivedCmd = getVersionCmd;
 678:	10 92 00 01 	sts	0x0100, r1
 67c:	27 c0       	rjmp	.+78     	; 0x6cc
	}
	else if ( (asciiTokenBuffer[0] == 'D') &&
 67e:	80 91 1a 01 	lds	r24, 0x011A
 682:	84 34       	cpi	r24, 0x44	; 68
 684:	41 f4       	brne	.+16     	; 0x696
 686:	80 91 1b 01 	lds	r24, 0x011B
 68a:	86 34       	cpi	r24, 0x46	; 70
 68c:	21 f4       	brne	.+8      	; 0x696
			   (asciiTokenBuffer[1] == 'F') )
	{
		/* we should go into frame dump mode */
		receivedCmd = dumpFrameCmd;	
 68e:	83 e0       	ldi	r24, 0x03	; 3
 690:	80 93 00 01 	sts	0x0100, r24
 694:	1b c0       	rjmp	.+54     	; 0x6cc
	}
	else if ( (asciiTokenBuffer[0] == 'C') &&
 696:	80 91 1a 01 	lds	r24, 0x011A
 69a:	83 34       	cpi	r24, 0x43	; 67
 69c:	41 f4       	brne	.+16     	; 0x6ae
 69e:	80 91 1b 01 	lds	r24, 0x011B
 6a2:	82 35       	cpi	r24, 0x52	; 82
 6a4:	21 f4       	brne	.+8      	; 0x6ae
	           (asciiTokenBuffer[1] == 'R') )
	{
		/* the user wants to set registers in the OV6620 */
		receivedCmd = setCameraRegsCmd;
 6a6:	82 e0       	ldi	r24, 0x02	; 2
 6a8:	80 93 00 01 	sts	0x0100, r24
 6ac:	0f c0       	rjmp	.+30     	; 0x6cc
	}
	
	
	else if ( (asciiTokenBuffer[0] == 'R') &&
 6ae:	80 91 1a 01 	lds	r24, 0x011A
 6b2:	82 35       	cpi	r24, 0x52	; 82
 6b4:	41 f4       	brne	.+16     	; 0x6c6
 6b6:	80 91 1b 01 	lds	r24, 0x011B
 6ba:	83 35       	cpi	r24, 0x53	; 83
 6bc:	21 f4       	brne	.+8      	; 0x6c6
			   (asciiTokenBuffer[1] == 'S') )
	{
		receivedCmd = resetCameraCmd;
 6be:	84 e0       	ldi	r24, 0x04	; 4
 6c0:	80 93 00 01 	sts	0x0100, r24
 6c4:	03 c0       	rjmp	.+6      	; 0x6cc
	}
	else
	{
		/* don't recognize the cmd */
		receivedCmd = invalidCmd;
 6c6:	86 e0       	ldi	r24, 0x06	; 6
 6c8:	80 93 00 01 	sts	0x0100, r24
	}
	memset(asciiTokenBuffer,0x00,MAX_TOKEN_LENGTH);
 6cc:	83 e0       	ldi	r24, 0x03	; 3
 6ce:	ea e1       	ldi	r30, 0x1A	; 26
 6d0:	f1 e0       	ldi	r31, 0x01	; 1
 6d2:	11 92       	st	Z+, r1
 6d4:	8a 95       	dec	r24
 6d6:	e9 f7       	brne	.-6      	; 0x6d2
	charIndex = 0;
 6d8:	10 92 18 01 	sts	0x0118, r1
	charCount = 0;
 6dc:	10 92 17 01 	sts	0x0117, r1
 6e0:	08 95       	ret

000006e2 <UIMgr_sendAck>:
}
/***********************************************************
	Function Name: UIMgr_sendAck
	Function Description: This function is responsible for
	queuing up an ACK to be sent to the user.
	Inputs:  none 
	Outputs: none
***********************************************************/	
static void UIMgr_sendAck(void)
{
	UIMgr_writeTxFifo('A');
 6e2:	81 e4       	ldi	r24, 0x41	; 65
 6e4:	0e 94 ed 03 	call	0x7da
	UIMgr_writeTxFifo('C');
 6e8:	83 e4       	ldi	r24, 0x43	; 67
 6ea:	0e 94 ed 03 	call	0x7da
	UIMgr_writeTxFifo('K');
 6ee:	8b e4       	ldi	r24, 0x4B	; 75
 6f0:	0e 94 ed 03 	call	0x7da
	UIMgr_writeTxFifo(0x0D);
 6f4:	8d e0       	ldi	r24, 0x0D	; 13
 6f6:	0e 94 ed 03 	call	0x7da
 6fa:	08 95       	ret

000006fc <UIMgr_sendNck>:
}

/***********************************************************
	Function Name: UIMgr_sendNck
	Function Description: This function is responsible for
	queueing up an NCK to be sent to the user.
	Inputs:  none 
	Outputs: none
***********************************************************/	
static void UIMgr_sendNck(void)
{
		UIMgr_writeTxFifo('N');
 6fc:	8e e4       	ldi	r24, 0x4E	; 78
 6fe:	0e 94 ed 03 	call	0x7da
		UIMgr_writeTxFifo('C');
 702:	83 e4       	ldi	r24, 0x43	; 67
 704:	0e 94 ed 03 	call	0x7da
		UIMgr_writeTxFifo('K');
 708:	8b e4       	ldi	r24, 0x4B	; 75
 70a:	0e 94 ed 03 	call	0x7da
		UIMgr_writeTxFifo('\r');
 70e:	8d e0       	ldi	r24, 0x0D	; 13
 710:	0e 94 ed 03 	call	0x7da
 714:	08 95       	ret

00000716 <UIMgr_writeBufferToTxFifo>:
}


/***********************************************************
	Function Name: UIMgr_writeBufferToTxFifo
	Function Description: This function is responsible for
	placing "length" bytes into the tx FIFO.
	Inputs:  pData -  a pointer to the data to send
	         length - the number of bytes to send
	Outputs: none
***********************************************************/	
void UIMgr_writeBufferToTxFifo(unsigned char *pData, unsigned char length)
{
 716:	dc 01       	movw	r26, r24
	unsigned char tmpHead;
	if (length == 0)
 718:	66 23       	and	r22, r22
 71a:	a9 f0       	breq	.+42     	; 0x746
	{
		return;
	}
	
	DISABLE_INTS();
 71c:	f8 94       	cli
	while(length-- != 0)
	{
		UIMgr_txFifo[UIMgr_txFifoHead] = *pData++;
	
		/* now move the head up */
		tmpHead = (UIMgr_txFifoHead + 1) & (UI_MGR_TX_FIFO_MASK);
		UIMgr_txFifoHead = tmpHead;
 71e:	61 50       	subi	r22, 0x01	; 1
 720:	6f 3f       	cpi	r22, 0xFF	; 255
 722:	81 f0       	breq	.+32     	; 0x744
 724:	2f e0       	ldi	r18, 0x0F	; 15
 726:	34 e0       	ldi	r19, 0x04	; 4
 728:	90 91 15 01 	lds	r25, 0x0115
 72c:	f9 01       	movw	r30, r18
 72e:	e9 0f       	add	r30, r25
 730:	f1 1d       	adc	r31, r1
 732:	8d 91       	ld	r24, X+
 734:	80 83       	st	Z, r24
 736:	89 2f       	mov	r24, r25
 738:	8f 5f       	subi	r24, 0xFF	; 255
 73a:	8f 73       	andi	r24, 0x3F	; 63
 73c:	80 93 15 01 	sts	0x0115, r24
 740:	61 50       	subi	r22, 0x01	; 1
 742:	90 f7       	brcc	.-28     	; 0x728
	}
	ENABLE_INTS();
 744:	78 94       	sei
 746:	08 95       	ret
 748:	08 95       	ret

0000074a <UIMgr_txBuffer>:
}

/***********************************************************
	Function Name: UIMgr_txBuffer
	Function Description: This function is responsible for
	sending 'length' bytes out using the UartInterface 
	module.
	Inputs:  pData -  a pointer to the data to send
	         length - the number of bytes to send
	Outputs: none
***********************************************************/	
void UIMgr_txBuffer(unsigned char *pData, unsigned char length)
{
 74a:	0f 93       	push	r16
 74c:	1f 93       	push	r17
 74e:	cf 93       	push	r28
 750:	8c 01       	movw	r16, r24
 752:	c6 2f       	mov	r28, r22
	while(length-- != 0)
	{
		UartInt_txByte(*pData++); 
 754:	c1 50       	subi	r28, 0x01	; 1
 756:	cf 3f       	cpi	r28, 0xFF	; 255
 758:	39 f0       	breq	.+14     	; 0x768
 75a:	f8 01       	movw	r30, r16
 75c:	81 91       	ld	r24, Z+
 75e:	8f 01       	movw	r16, r30
 760:	0e 94 09 04 	call	0x812
 764:	c1 50       	subi	r28, 0x01	; 1
 766:	c8 f7       	brcc	.-14     	; 0x75a
 768:	cf 91       	pop	r28
 76a:	1f 91       	pop	r17
 76c:	0f 91       	pop	r16

⌨️ 快捷键说明

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