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

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

?? maintutorial2local.c

?? nRF24L01開發指導
?? C
字號:
/*****************************************************************************
*
* File: maintutorial2local.c
* 
* Copyright S. Brennen Ball, 2007
* 
* The author provides no guarantees, warantees, or promises, implied or
*	otherwise.  By using this software you agree to indemnify the author
* 	of any damages incurred by using it.
* 
*****************************************************************************/

#include "lpc214x.h"
#include "spi1.h"
#include "delays.h"
#include "nrf24l01.h"
#include "uart0.h"

//for the following 9 definitions, see Jim Lynch's ARM tutorial
#define PLOCK 0x400

void Initialize();
void InitializePLL();
void InitializeIO();
void Feed();

void IRQ_Routine()   __attribute__ ((interrupt("IRQ")));
void FIQ_Routine()   __attribute__ ((interrupt("FIQ")));
void SWI_Routine()   __attribute__ ((interrupt("SWI")));
void UNDEF_Routine() __attribute__ ((interrupt("UNDEF")));
//end Jim Lynch's definitions

void ToggleLED(); //toggle the current state of the on-board LED

//main routine
int	main() 
{	
	unsigned char data; //register to hold letter sent and received
	unsigned int count; //counter for for loop
	
	Initialize(); //initialize PLL, IO, UART, SPI, set up nRF24L01 as TX

	//main program loop
	while(1)
	{
		//check UART status register to see if data has been received.  if so, process
		while(uart0_rx_data_ready())
		{
			data = uart0_get_rx_data(); //get data from UART
			nrf24l01_write_tx_payload(&data, 1, true); //transmit received char over RF

			//wait until the packet has been sent or the maximum number of retries has been active
			while(!(nrf24l01_irq_pin_active() && (nrf24l01_irq_tx_ds_active() || nrf24l01_irq_max_rt_active())));

			//check to see if the maximum number of retries has been hit.  if not, wait for the RX device
			// to send the char back.  if so, assume the packet is lost and send "*" back to UART
			if(!nrf24l01_irq_max_rt_active())
			{
				nrf24l01_irq_clear_all(); //clear all interrupts in the 24L01
				nrf24l01_set_as_rx(true); //change the device to an RX to get the character back from the other 24L01

				//wait a while to see if we get the data back (change the loop maximum and the lower if
				//  argument (should be loop maximum - 1) to lengthen or shorten this time frame
				for(count = 0; count < 25000; count++)
				{
					//check to see if the data has been received.  if so, get the data and exit the loop.
					//  if the loop is at its last count, assume the packet has been lost and set the data
					//  to go to the UART to "?".  If neither of these is true, keep looping.
					if((nrf24l01_irq_pin_active() && nrf24l01_irq_rx_dr_active()))
					{
						nrf24l01_read_rx_payload(&data, 1); //get the payload into data
						break;
					}
					
					//if loop is on its last iteration, assume packet has been lost.
					if(count == 24999)
						data = '?';
				}
				
				nrf24l01_irq_clear_all(); //clear interrupts again
				uart0_printf("%c", data); //print the received data (or ? if none) to the screen
			
				DelayUS(130); //wait for receiver to come from standby to RX
				nrf24l01_set_as_tx(); //resume normal operation as a TX
			}
			else
			{
				nrf24l01_flush_tx(); //get the unsent character out of the TX FIFO
				nrf24l01_irq_clear_all(); //clear all interrupts
				uart0_printf("*"); //print "*" to the screen to show that the receiver did not receive the packet
			}
									
			ToggleLED(); //toggle the on-board LED as visual indication that the loop has completed
		}
	}
}

//initialize routine
void Initialize()
{
	InitializePLL(); //initialize PLL (Jim Lynch function)
	InitializeIO(); //set up IO (directions and functions)
	uart0_open(); //open UART0
	spi1_open(); //open SPI1
	nrf24l01_initialize_debug(false, 1, true); //initialize the 24L01 to the debug configuration as TX, 1 data byte, and auto-ack enabled
}

//initialize IO pins
void InitializeIO()
{
	SCS = 0x03; // select the "fast" version of the I/O ports
	FIO1DIR3 = 0x01; //set LED bit as output
	FIO1PIN3 = 0x00; //turn LED on (pin is 0)
	
	FIO0DIR = 0x007A0001; //set CE, CSN, MISO1, SCK1, and TX as outputs (and another control bit on my particular board)
	FIO0PIN = 0x00500000; //set CSN bit (and another control bit on my particular board)
	PINSEL0 = 0x00000005; //set up UART0 pins as UART0 instead of GPIO
	PINSEL1 = 0x000000A8; //set up SPI1 pins as SPI1 instead of GPIO
}

//toggles on-board LED
void ToggleLED()
{
	if((FIO1PIN3 & 0x01) == 0x00)
		FIO1PIN3 = 0x01;
	else
		FIO1PIN3 = 0x00;
}

//initialize PLL to 5x (Jim Lynch function)
void InitializePLL()  
{
	// Setting Multiplier and Divider values
  	PLLCFG=0x24;
  	Feed();
  
	// Enabling the PLL */	
	PLLCON=0x1;
	Feed();
  
	// Wait for the PLL to lock to set frequency
	while(!(PLLSTAT & PLOCK));
  
	// Connect the PLL as the clock source
	PLLCON=0x3;
	Feed();
  
	// Enabling MAM and setting number of clocks used for Flash memory fetch (4 cclks in this case)
	MAMCR=0x2;
	MAMTIM=0x4;

	VPBDIV=0x01;
}

//operate PLL Feed (Jim Lynch function)
void Feed()
{
	PLLFEED=0xAA;
	PLLFEED=0x55;
}

//the following 4 stubs are functions by Jim Lynch
void IRQ_Routine() 
{
}

void FIQ_Routine()  
{
}

void SWI_Routine()  
{
}

void UNDEF_Routine() 
{
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
波多野结衣亚洲| 欧美精品一区二区三区在线播放| 欧美一区二区美女| 中文字幕av不卡| 免费高清成人在线| 一本大道久久a久久综合| 欧美成人r级一区二区三区| 亚洲精品中文在线影院| 国模冰冰炮一区二区| 欧美群妇大交群中文字幕| 中文字幕中文字幕一区| 国产激情精品久久久第一区二区| 欧美日韩国产乱码电影| 亚洲精品高清在线| 91亚洲精品久久久蜜桃| 国产色产综合色产在线视频| 另类专区欧美蜜桃臀第一页| 欧美蜜桃一区二区三区 | 一本色道久久综合亚洲aⅴ蜜桃| 日韩一区二区三区视频在线观看| 亚洲综合在线视频| jlzzjlzz亚洲女人18| 中文字幕精品—区二区四季| 国产福利一区二区三区| 国产日韩欧美不卡在线| 国产毛片精品视频| 久久久午夜精品| 国产电影精品久久禁18| 久久久久久9999| 国产美女视频一区| 26uuu色噜噜精品一区二区| 久久精品国产一区二区三| 欧美一级片在线看| 美女性感视频久久| 2024国产精品| 粉嫩aⅴ一区二区三区四区| 国产日韩亚洲欧美综合| 成人美女视频在线看| 国产精品乱码一区二三区小蝌蚪| 成人av在线一区二区| 亚洲视频在线观看一区| 在线免费不卡视频| 五月天一区二区| 精品人伦一区二区色婷婷| 国产精品中文字幕一区二区三区| 国产日韩欧美精品一区| av一区二区不卡| 亚洲成人你懂的| 日韩一区二区三区免费观看| 国产一区二区三区免费播放| 国产精品的网站| 91丨九色丨国产丨porny| 亚洲电影一级片| 欧美精品一区二区三区蜜臀| caoporm超碰国产精品| 午夜精品久久一牛影视| 精品国产免费人成电影在线观看四季| 国产一区亚洲一区| 自拍av一区二区三区| 欧美日韩综合不卡| 激情综合色播激情啊| 亚洲色图视频网站| 91麻豆精品国产91久久久使用方法 | 亚洲制服丝袜av| 日韩一区二区三区四区五区六区 | 奇米影视7777精品一区二区| 国产日韩av一区二区| 色综合天天性综合| 久久99久久久欧美国产| 国产精品久久久一区麻豆最新章节| 91电影在线观看| 狠狠色伊人亚洲综合成人| 亚洲精品免费电影| 精品乱人伦小说| 欧美最猛性xxxxx直播| 国产乱码精品一区二区三区av| 一区二区三区不卡视频| 久久久久久久久岛国免费| 欧洲视频一区二区| 床上的激情91.| 国产成人午夜视频| 午夜欧美电影在线观看| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 久久疯狂做爰流白浆xx| 亚洲视频中文字幕| 久久久噜噜噜久噜久久综合| 欧美日韩高清一区二区三区| 国产成人精品一区二| 日本不卡一区二区三区高清视频| 亚洲婷婷综合色高清在线| 26uuu亚洲综合色| 7777精品伊人久久久大香线蕉的| 99视频超级精品| 国产盗摄一区二区| 麻豆精品视频在线| 日韩激情一区二区| 亚洲成人综合在线| 一区二区免费在线| 亚洲天天做日日做天天谢日日欢 | 一区二区高清视频在线观看| 久久久久久久久岛国免费| 欧美成人官网二区| 欧美日韩视频在线第一区| 色狠狠色狠狠综合| 色呦呦网站一区| 成人av电影观看| 不卡一二三区首页| 波多野结衣一区二区三区| 岛国精品在线观看| 国产高清精品网站| 成人免费观看av| 成人午夜精品在线| 成人av在线影院| 91亚洲国产成人精品一区二三 | 国产美女精品在线| 久久成人综合网| 国产一区二区视频在线| 激情文学综合插| 国产麻豆精品在线观看| 国产一区二区中文字幕| 国产宾馆实践打屁股91| 成人激情av网| 91在线观看成人| 欧美艳星brazzers| 欧美精品乱人伦久久久久久| 欧美精品v日韩精品v韩国精品v| 在线综合+亚洲+欧美中文字幕| 91精品国产欧美一区二区成人| 91精品国产综合久久国产大片| 欧美一区二区大片| 久久综合色婷婷| 成人免费在线播放视频| 艳妇臀荡乳欲伦亚洲一区| 午夜精品成人在线| 极品销魂美女一区二区三区| 风间由美一区二区av101| 99re成人精品视频| 欧美日韩国产精品成人| 久久影音资源网| 中文字幕在线不卡国产视频| 亚洲精品中文在线观看| 午夜久久电影网| 国产精品中文字幕一区二区三区| 色综合色狠狠天天综合色| 欧美片网站yy| 欧美经典一区二区| 亚洲国产欧美在线| 狠狠色2019综合网| 欧美日韩一区二区在线视频| 日韩午夜中文字幕| 国产精品伦一区二区三级视频| 午夜精品一区二区三区电影天堂| 狠狠狠色丁香婷婷综合激情| 91福利精品视频| 欧美电影免费观看高清完整版在线观看| 日本一区二区三区在线不卡| 亚洲va欧美va人人爽午夜| 国产99久久久国产精品免费看| 欧美性色欧美a在线播放| 久久尤物电影视频在线观看| 一区二区三区四区不卡视频| 国产乱一区二区| 欧美精品乱码久久久久久| 国产精品私人影院| 麻豆精品一二三| 欧美在线免费视屏| 国产午夜一区二区三区| 日韩av成人高清| 在线观看一区日韩| 国产欧美日韩视频一区二区| 蜜乳av一区二区三区| 欧美亚一区二区| 亚洲欧美综合色| 懂色中文一区二区在线播放| 日韩欧美国产综合在线一区二区三区| 亚洲欧美乱综合| 本田岬高潮一区二区三区| 2020日本不卡一区二区视频| 午夜日韩在线观看| 日本韩国一区二区| 最新中文字幕一区二区三区| 成人综合婷婷国产精品久久免费| 91精品国产福利在线观看| 亚洲电影一区二区| 日本久久一区二区三区| 国产精品二三区| 成人av免费在线播放| 国产欧美日韩亚州综合| 国产一区二区三区在线观看精品 | 欧美午夜片在线看| 亚洲欧美在线aaa| 成人午夜视频免费看| 久久久久国产精品厨房| 国产中文字幕一区| 精品成人佐山爱一区二区| 国产在线观看一区二区| 久久精品人人做人人综合| 国产一区二区三区四区五区美女 | av亚洲精华国产精华精| 国产精品久久久久影院|