亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? uimgr.c

?? AVR與圖像傳感器OVA6620的接口程序 通過I2C總線進行通信對圖像進行采集和預處理
?? C
?? 第 1 頁 / 共 2 頁
字號:
		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);
		PUBLISH_EVENT(EV_DUMP_FRAME);
	}
	else if (receivedCmd == setCameraRegsCmd)
	{
		/* 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
											is the CR cmd */
		{
			CamConfig_setCamReg(tokenBuffer[i],tokenBuffer[i+1]);
		}
		CamConfig_sendFifoCmds();
	}
	else if (receivedCmd == enableTrackingCmd)
	{
		/* publish the event...again with a short delay */
		Utility_delay(100);
		PUBLISH_EVENT(EV_ENABLE_TRACKING);
	}
	else if (receivedCmd == disableTrackingCmd)
	{
		PUBLISH_EVENT(EV_DISABLE_TRACKING);
	}
	else if (receivedCmd == setColorMapCmd)
	{
		/* copy the received tokens into the color map */
		for (i=0; i<tokenCount; i++)
		{
			colorMap[i] = tokenBuffer[i+1];
            
            /* write each colorMap byte to EEPROM, but only those
            that changed...this will help reduce wear on the EEPROM */
            eepromData = eeprom_read_byte( (unsigned char*)(i+1));
            if (eepromData != colorMap[i])
            {
                /* need to actually perform the write because the
                data in eeprom is different than the current colorMap */
                eeprom_write_succeeded = FALSE;
                while(eeprom_write_succeeded == FALSE && num_writes < MAX_EEPROM_WRITE_ATTEMPTS)
                {
                    eeprom_write_byte((unsigned char*)(i+1),colorMap[i]);
                    num_writes++;
                    eepromData = eeprom_read_byte( (unsigned char*)(i+1));
                    if (eepromData == colorMap[i])
                    {
                        eeprom_write_succeeded = TRUE;
                    }
                }
                num_writes = 0;
            }
		}

#if	DEBUG_COLOR_MAP			
            			/* for debugging...send out the entire color map */
        UIMgr_txBuffer("\r\n",2);
		for (i=0; i<NUM_ELEMENTS_IN_COLOR_MAP; i++)
		{
			memset(asciiBuffer,0x00,5);
			itoa(colorMap[i],asciiBuffer,10);
			UIMgr_txBuffer(asciiBuffer,3);
			UIMgr_txBuffer(" ",1);
			if (i==15 || i == 31)
			{
				/* break up the output */
				UIMgr_txBuffer("\r\n",2);
			}
		}
#endif			
	}
}

/***********************************************************
	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);
	if (newValue > 255)
	{
		/* the value is too large */
		receivedCmd = invalidCmd;
		tokenBuffer[tokenCount] = 0xFF;  /* to indicate an error */
	}
	else
	{
		/* copy the value into the tokenBuffer */
		tokenBuffer[tokenCount] = newValue;
	}
	memset(asciiTokenBuffer,0x00,MAX_TOKEN_LENGTH);
	charIndex = 0;
	charCount = 0;
}
/***********************************************************
	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') &&
		 (asciiTokenBuffer[1] == 'G') )
	{
		/* we got a "ping" command...but we still need to see
		if we are going to get the \r */
		receivedCmd = pingCmd;
	}
	else if ( (asciiTokenBuffer[0] == 'G') &&
			   (asciiTokenBuffer[1] == 'V') )
	{
		/* we got the "get version" command */
		receivedCmd = getVersionCmd;
	}
	else if ( (asciiTokenBuffer[0] == 'D') &&
			   (asciiTokenBuffer[1] == 'F') )
	{
		/* we should go into frame dump mode */
		receivedCmd = dumpFrameCmd;	
	}
	else if ( (asciiTokenBuffer[0] == 'C') &&
	           (asciiTokenBuffer[1] == 'R') )
	{
		/* the user wants to set registers in the OV6620 */
		receivedCmd = setCameraRegsCmd;
	}
	else if ( (asciiTokenBuffer[0] == 'E') &&
			   (asciiTokenBuffer[1] == 'T') )
	{
		/* the user wants to enable tracking */
		receivedCmd = enableTrackingCmd;
	}
	else if ( (asciiTokenBuffer[0] == 'S') &&
			   (asciiTokenBuffer[1] == 'M') )
	{
		/* the user wants to set the color map */
		receivedCmd = setColorMapCmd;
	}
	else if ( (asciiTokenBuffer[0] == 'D') &&
			   (asciiTokenBuffer[1] == 'T') )
	{
		receivedCmd = disableTrackingCmd;
	}
	else if ( (asciiTokenBuffer[0] == 'R') &&
			   (asciiTokenBuffer[1] == 'S') )
	{
		receivedCmd = resetCameraCmd;
	}
	else
	{
		/* don't recognize the cmd */
		receivedCmd = invalidCmd;
	}
	memset(asciiTokenBuffer,0x00,MAX_TOKEN_LENGTH);
	charIndex = 0;
	charCount = 0;
}
/***********************************************************
	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');
	UIMgr_writeTxFifo('C');
	UIMgr_writeTxFifo('K');
	UIMgr_writeTxFifo('\r');
}

/***********************************************************
	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');
		UIMgr_writeTxFifo('C');
		UIMgr_writeTxFifo('K');
		UIMgr_writeTxFifo('\r');
}


/***********************************************************
	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)
{
	unsigned char tmpHead;
	if (length == 0)
	{
		return;
	}
	
	DISABLE_INTS();
	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;
	}
	ENABLE_INTS();
}

/***********************************************************
	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)
{
	while(length-- != 0)
	{
		UartInt_txByte(*pData++); 
	}
}

/***********************************************************
	Function Name: UIMgr_flushTxBuffer
	Function Description: This function is responsible for
	sending all data currently in the serial tx buffer
	to the user.
	Inputs:  none
	Outputs: none
***********************************************************/	
void UIMgr_flushTxBuffer(void)
{
	while(IS_DATA_IN_TX_FIFO() == TRUE)
	{
		UartInt_txByte(UIMgr_readTxFifo() );
	}
}

/***********************************************************
	Function Name: UIMgr_readRxFifo
	Function Description: This function is responsible for
	reading a single byte of data from the rx fifo, and
	updating the appropriate pointers.
	Inputs:  none 
	Outputs: unsigned char-the data read
***********************************************************/	
static unsigned char UIMgr_readRxFifo(void)
{
	unsigned char dataByte, tmpTail;
	
	/* just return the current tail from the rx fifo */
	DISABLE_INTS();
	dataByte = UIMgr_rxFifo[UIMgr_rxFifoTail];	
	tmpTail = (UIMgr_rxFifoTail+1) & (UI_MGR_RX_FIFO_MASK);
	UIMgr_rxFifoTail = tmpTail;
	ENABLE_INTS();
	
	return(dataByte);
}

/***********************************************************
	Function Name: UIMgr_readTxFifo
	Function Description: This function is responsible for
	reading a single byte of data from the tx fifo, and
	updating the appropriate pointers.
	Inputs:  none 
	Outputs: unsigned char-the data read
***********************************************************/	
static unsigned char UIMgr_readTxFifo(void)
{
	unsigned char dataByte, tmpTail;
	
	/* just return the current tail from the tx fifo */
	DISABLE_INTS();
	dataByte = UIMgr_txFifo[UIMgr_txFifoTail];	
	tmpTail = (UIMgr_txFifoTail+1) & (UI_MGR_TX_FIFO_MASK);
	UIMgr_txFifoTail = tmpTail;
	ENABLE_INTS();
	
	return(dataByte);
}

/***********************************************************
	Function Name: UIMgr_writeTxFifo
	Function Description: This function is responsible for
	writing a single byte to the TxFifo and
	updating the appropriate pointers.
	Inputs:  data - the byte to write to the Fifo 
	Outputs: none
***********************************************************/	
void UIMgr_writeTxFifo(unsigned char data)
{
	unsigned char tmpHead;

	DISABLE_INTS();
	UIMgr_txFifo[UIMgr_txFifoHead] = data;

    /* now move the head up */
    tmpHead = (UIMgr_txFifoHead + 1) & (UI_MGR_TX_FIFO_MASK);
    UIMgr_txFifoHead = tmpHead;
	ENABLE_INTS();
	
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产一区二区三区 | 青青草国产成人99久久| 久久中文娱乐网| 日韩午夜在线播放| 日韩欧美亚洲国产另类| 欧美夫妻性生活| 欧美一区二区视频观看视频| 欧美综合久久久| 欧美日韩综合不卡| 欧美日韩免费在线视频| 7777精品久久久大香线蕉| 欧美丝袜自拍制服另类| 在线播放中文一区| 欧美一区二区三区思思人| 欧美xxxx在线观看| 久久久久高清精品| 中文字幕亚洲一区二区av在线| 欧美国产一区二区| 亚洲精品久久嫩草网站秘色| 亚洲成人av在线电影| 日韩高清在线电影| 国产在线观看免费一区| 波多野结衣亚洲| 欧美视频日韩视频| 精品国产凹凸成av人网站| 中文字幕成人av| 一区二区三区四区激情| 日韩电影在线免费看| 国产精品原创巨作av| 色综合天天狠狠| 在线播放欧美女士性生活| 久久精品欧美日韩精品 | 色哟哟精品一区| 在线91免费看| 国产三级欧美三级日产三级99 | 亚洲高清在线精品| 久久精品国产澳门| 99久久免费视频.com| 欧美夫妻性生活| 国产精品拍天天在线| 亚洲观看高清完整版在线观看| 国产一区激情在线| 在线免费不卡视频| 久久老女人爱爱| 日韩精品乱码av一区二区| 国产电影一区在线| 91精品国产综合久久福利软件 | 亚洲精品国产成人久久av盗摄 | 国产欧美综合在线观看第十页| 一区二区三区小说| 粉嫩在线一区二区三区视频| 精品视频一区 二区 三区| 国产欧美一区二区精品仙草咪| 亚洲国产三级在线| av爱爱亚洲一区| 久久精品人人做人人爽97| 婷婷开心激情综合| 欧美在线小视频| 国产精品美女www爽爽爽| 国产综合色精品一区二区三区| 欧美人狂配大交3d怪物一区| 亚洲日本护士毛茸茸| 国产精品影视网| 欧美videos中文字幕| 亚洲va国产天堂va久久en| 96av麻豆蜜桃一区二区| 国产色婷婷亚洲99精品小说| 国产自产高清不卡| 欧美成人艳星乳罩| 日本不卡不码高清免费观看| 欧美午夜电影在线播放| 亚洲欧美区自拍先锋| 99精品热视频| 亚洲欧美另类久久久精品2019| 成人精品鲁一区一区二区| 国产欧美一区二区三区在线看蜜臀| 激情欧美一区二区| 欧美变态tickle挠乳网站| 极品少妇一区二区| 久久久久青草大香线综合精品| 国产一区不卡视频| 日本一区二区三区四区| 成人夜色视频网站在线观看| 国产精品久久久久婷婷二区次| 成人午夜av电影| 亚洲色欲色欲www在线观看| 91在线观看视频| 亚洲国产cao| 精品欧美乱码久久久久久| 国产美女av一区二区三区| 久久久久久久久99精品| 成人久久久精品乱码一区二区三区| 国产精品麻豆久久久| 91色porny| 日韩精品视频网站| 久久在线免费观看| 色一情一乱一乱一91av| 丝袜亚洲另类欧美综合| 久久精品亚洲乱码伦伦中文| 91在线观看地址| 偷拍与自拍一区| 国产视频视频一区| 日本二三区不卡| 麻豆精品蜜桃视频网站| 国产精品―色哟哟| 欧美图片一区二区三区| 成人动漫在线一区| 亚洲一区二区五区| 欧美r级电影在线观看| 97久久超碰国产精品| 日韩精品国产精品| 国产精品女主播在线观看| 欧美亚州韩日在线看免费版国语版| 蜜臀精品久久久久久蜜臀| 国产精品久久看| 日韩午夜小视频| www.av精品| 精品一区二区在线播放| 亚洲精品国产无天堂网2021| www久久久久| 欧美人与z0zoxxxx视频| 成人国产精品免费观看| 蜜桃精品视频在线| 亚洲欧美日韩精品久久久久| 精品久久人人做人人爱| 欧美性大战久久久久久久| 国产成人一区二区精品非洲| 日韩中文字幕1| 一区二区三区在线视频观看58| 久久久久久麻豆| 日韩一区二区三区四区| 欧美三级日韩三级| 91老师片黄在线观看| 国产a区久久久| 狠狠色狠狠色综合| 人人狠狠综合久久亚洲| 一区二区在线观看视频| 日本一区二区三区久久久久久久久不| 4438成人网| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 粉嫩一区二区三区性色av| 久久国产麻豆精品| 日韩福利电影在线| 亚洲电影在线免费观看| 亚洲综合清纯丝袜自拍| 国产精品国产自产拍在线| 欧美国产日韩一二三区| 久久美女高清视频| 2020国产精品自拍| 久久中文娱乐网| 久久精品网站免费观看| 国产亚洲精品资源在线26u| 精品国产免费人成在线观看| 日韩欧美你懂的| 精品欧美一区二区在线观看| 日韩欧美电影一二三| 精品福利一二区| 久久久精品国产99久久精品芒果| **性色生活片久久毛片| 亚洲欧美一区二区三区孕妇| 成人免费在线播放视频| 亚洲欧美日韩国产综合在线| 一区二区三区四区亚洲| 亚洲国产aⅴ成人精品无吗| 日韩电影一二三区| 韩国精品久久久| 高清国产一区二区三区| 99久久久国产精品| 在线观看欧美黄色| 欧美日韩成人综合天天影院| 欧美一区二区三区免费大片| 337p粉嫩大胆色噜噜噜噜亚洲| 久久精品人人做| 一区二区三区国产| 日日摸夜夜添夜夜添精品视频| 免费成人美女在线观看.| 国产一区二区三区四区在线观看 | 亚洲国产精品二十页| 日韩一区在线看| 午夜精品久久久久久| 久久99国产精品麻豆| 国产91丝袜在线18| 欧美网站一区二区| 久久久久久一二三区| 亚洲天堂2014| 日韩av电影天堂| 成人理论电影网| 日韩欧美国产一区二区三区| 国产精品天天看| 天堂av在线一区| 波多野结衣的一区二区三区| 欧美在线观看一二区| 国产视频一区不卡| 婷婷一区二区三区| 成人v精品蜜桃久久一区| 欧美男女性生活在线直播观看| 精品免费一区二区三区| 亚洲色图.com| 国产激情91久久精品导航| 欧美日本国产视频|