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

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

?? nrf24l01.htm

?? 用于驅動24L01芯片的函數代碼
?? HTM
?? 第 1 頁 / 共 2 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0051)http://filebox.vt.edu/users/stball1/code/nrf24l01.h -->
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.3059" name=GENERATOR></HEAD>
<BODY><PRE>/******************************************************************************
*
* File: nrf24l01.h
* 
* Copyright S. Brennen Ball, 2006-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.
*
*****************************************************************************/

#ifndef NRF24L01_H_
#define NRF24L01_H_

#include &lt;stddef.h&gt;

#ifndef bool
#define bool unsigned char
#endif
#ifndef false
#define false 0
#endif
#ifndef true
#define true !false
#endif

/////////////////////////////////////////////////////////////////////////////////
// SPI function requirements
//
// The user must define a function to send one byte of data and also return the
//   resulting byte of data data through the SPI port. The function used here 
//   has the function prototype
//
//	    unsigned char spi_send_read_byte(unsigned char byte);
//
// This function should take the argument unsigned char byte and send it through
//   the SPI port to the 24L01.  Then, it should wait until the 24L01 has returned
//   its response over SPI.  This received byte should be the return value of the
//   function.
//
// You should also change the include file name below to whatever the name of your 
//   SPI include file is.
//////////////////////////////////////////////////////////////////////////////////
#include "spi1.h"
#define spi_send_read_byte(byte)	spi1_send_read_byte(byte)


/////////////////////////////////////////////////////////////////////////////////
// Delay function requirements
//
// The user must define a function that delays for the specified number of 
//	 microseconds. This function needs to be as precise as possible, and the use
//   of a timer module within your microcontroller is highly recommended. The 
//   function used here has the prototype
//
//	    void delay_us(unsigned int microseconds);
//
// You should also change the include file name below to whatever the name of your 
//   delay include file is.
//////////////////////////////////////////////////////////////////////////////////
#include "delays.h"
#define delay_us(microseconds)		DelayUS(microseconds)


//////////////////////////////////////////////////////////////////////////////////
// IO pin definitions
//
// Below you will find several definitions and includes.  The first is an #include
//   for your microcontroller's include file to allow you to use register names 
//   rather than numbers.  The next three are to allow you to control the pins on
//   the 24L01 that aren't automatically handled by SPI.  These are CE, CSN, and
//   IRQ.
//
// The general format of these defines is a define for the IO register the pin is
//   attached to.  The second define is a mask for the pin.  For example, say that
//   your CE pin is tied to an IO port with the register name IOPORT1. Also, let's
//   say that the IO port is 8-bits wide, and you have attached the pin to pin 0 of
//   the port.  Then your define would look like this:
//
//	 #define nrf24l01_CE_IOREGISTER		IOPORT1
//   #define nrf24l01_CE_PINMASK		0x01
//
// If you have defines in your include file for individual IO pins, you could use
//   this define in this file, as well.  Using the previous example, assume that in
//   your microcontroller's include file, pin 0 of IOPORT1 has a define like this
//
//   #define IOPORT1_PIN0	0x01
//
// Then, you could make your defines for the CE pin in this file look like this:
//
//	 #define nrf24l01_CE_IOREGISTER		IOPORT1
//   #define nrf24l01_CE_PINMASK		IOPORT1_PIN0
//
// You should also change the include file name below to whatever the name of your 
//   processor's register definition include file is.
/////////////////////////////////////////////////////////////////////////////////////
#include "lpc214x.h"

//defines for uC pins CE pin is connected to
//This is used so that the routines can send TX payload data and 
//	properly initialize the nrf24l01 in TX and RX states.
//Change these definitions (and then recompile) to suit your particular application.
#define nrf24l01_CE_IOREGISTER		FIO0PIN
#define nrf24l01_CE_PINMASK			0x200000

//defines for uC pins CSN pin is connected to
//This is used so that the routines can send properly operate the SPI interface
// on the nrf24l01.
//Change these definitions (and then recompile) to suit your particular application.
#define nrf24l01_CSN_IOREGISTER		FIO0PIN
#define nrf24l01_CSN_PINMASK		0x100000

//defines for uC pins IRQ pin is connected to
//This is used so that the routines can poll for IRQ or create an ISR.
//Change these definitions (and then recompile) to suit your particular application.
#define nrf24l01_IRQ_IOREGISTER		FIO0PIN
#define nrf24l01_IRQ_PINMASK		0x8000


////////////////////////////////////////////////////////////////////////////////////
// SPI commands
//
// The following are defines for all of the commands and data masks on the SPI 
//   interface.
////////////////////////////////////////////////////////////////////////////////////
//SPI command defines
#define nrf24l01_R_REGISTER		0x00
#define nrf24l01_W_REGISTER		0x20
#define nrf24l01_R_RX_PAYLOAD	0x61
#define nrf24l01_W_TX_PAYLOAD	0xA0
#define nrf24l01_FLUSH_TX		0xE1
#define nrf24l01_FLUSH_RX		0xE2
#define nrf24l01_REUSE_TX_PL	0xE3
#define nrf24l01_NOP			0xFF

//SPI command data mask defines
#define nrf24l01_R_REGISTER_DATA	0x1F
#define nrf24l01_W_REGISTER_DATA	0x1F

////////////////////////////////////////////////////////////////////////////////////
// Register definitions
//
// Below are the defines for each register's address in the 24L01.
////////////////////////////////////////////////////////////////////////////////////
#define nrf24l01_CONFIG			0x00
#define nrf24l01_EN_AA			0x01
#define nrf24l01_EN_RXADDR		0x02
#define nrf24l01_SETUP_AW		0x03
#define nrf24l01_SETUP_RETR		0x04
#define nrf24l01_RF_CH			0x05
#define nrf24l01_RF_SETUP		0x06
#define nrf24l01_STATUS			0x07
#define nrf24l01_OBSERVE_TX		0x08
#define nrf24l01_CD				0x09
#define nrf24l01_RX_ADDR_P0		0x0A
#define nrf24l01_RX_ADDR_P1		0x0B
#define nrf24l01_RX_ADDR_P2		0x0C
#define nrf24l01_RX_ADDR_P3		0x0D
#define nrf24l01_RX_ADDR_P4		0x0E
#define nrf24l01_RX_ADDR_P5		0x0F
#define nrf24l01_TX_ADDR		0x10
#define nrf24l01_RX_PW_P0		0x11
#define nrf24l01_RX_PW_P1		0x12
#define nrf24l01_RX_PW_P2		0x13
#define nrf24l01_RX_PW_P3		0x14
#define nrf24l01_RX_PW_P4		0x15
#define nrf24l01_RX_PW_P5		0x16
#define nrf24l01_FIFO_STATUS	0x17

////////////////////////////////////////////////////////////////////////////////////
// Default register values
//
// Below are the defines for each register's default value in the 24L01. Multi-byte
//   registers use notation B&lt;X&gt;, where "B" represents "byte" and &lt;X&gt; is the byte
//   number.
////////////////////////////////////////////////////////////////////////////////////
#define nrf24l01_CONFIG_DEFAULT_VAL			0x08
#define nrf24l01_EN_AA_DEFAULT_VAL			0x3F
#define nrf24l01_EN_RXADDR_DEFAULT_VAL		0x03
#define nrf24l01_SETUP_AW_DEFAULT_VAL		0x03
#define nrf24l01_SETUP_RETR_DEFAULT_VAL		0x03
#define nrf24l01_RF_CH_DEFAULT_VAL			0x02
#define nrf24l01_RF_SETUP_DEFAULT_VAL		0x0F
#define nrf24l01_STATUS_DEFAULT_VAL			0x0E
#define nrf24l01_OBSERVE_TX_DEFAULT_VAL		0x00
#define nrf24l01_CD_DEFAULT_VAL				0x00
#define nrf24l01_RX_ADDR_P0_B0_DEFAULT_VAL	0xE7
#define nrf24l01_RX_ADDR_P0_B1_DEFAULT_VAL	0xE7
#define nrf24l01_RX_ADDR_P0_B2_DEFAULT_VAL	0xE7
#define nrf24l01_RX_ADDR_P0_B3_DEFAULT_VAL	0xE7
#define nrf24l01_RX_ADDR_P0_B4_DEFAULT_VAL	0xE7
#define nrf24l01_RX_ADDR_P1_B0_DEFAULT_VAL	0xC2
#define nrf24l01_RX_ADDR_P1_B1_DEFAULT_VAL	0xC2
#define nrf24l01_RX_ADDR_P1_B2_DEFAULT_VAL	0xC2
#define nrf24l01_RX_ADDR_P1_B3_DEFAULT_VAL	0xC2
#define nrf24l01_RX_ADDR_P1_B4_DEFAULT_VAL	0xC2
#define nrf24l01_RX_ADDR_P2_DEFAULT_VAL		0xC3
#define nrf24l01_RX_ADDR_P3_DEFAULT_VAL		0xC4
#define nrf24l01_RX_ADDR_P4_DEFAULT_VAL		0xC5
#define nrf24l01_RX_ADDR_P5_DEFAULT_VAL		0xC6
#define nrf24l01_TX_ADDR_B0_DEFAULT_VAL		0xE7
#define nrf24l01_TX_ADDR_B1_DEFAULT_VAL		0xE7
#define nrf24l01_TX_ADDR_B2_DEFAULT_VAL		0xE7
#define nrf24l01_TX_ADDR_B3_DEFAULT_VAL		0xE7
#define nrf24l01_TX_ADDR_B4_DEFAULT_VAL		0xE7
#define nrf24l01_RX_PW_P0_DEFAULT_VAL		0x00
#define nrf24l01_RX_PW_P1_DEFAULT_VAL		0x00
#define nrf24l01_RX_PW_P2_DEFAULT_VAL		0x00
#define nrf24l01_RX_PW_P3_DEFAULT_VAL		0x00
#define nrf24l01_RX_PW_P4_DEFAULT_VAL		0x00
#define nrf24l01_RX_PW_P5_DEFAULT_VAL		0x00
#define nrf24l01_FIFO_STATUS_DEFAULT_VAL	0x11

////////////////////////////////////////////////////////////////////////////////////
// Register bitwise definitions
//
// Below are the defines for each register's bitwise fields in the 24L01.
////////////////////////////////////////////////////////////////////////////////////
//CONFIG register bitwise definitions
#define nrf24l01_CONFIG_RESERVED	0x80
#define	nrf24l01_CONFIG_MASK_RX_DR	0x40
#define	nrf24l01_CONFIG_MASK_TX_DS	0x20
#define	nrf24l01_CONFIG_MASK_MAX_RT	0x10
#define	nrf24l01_CONFIG_EN_CRC		0x08
#define	nrf24l01_CONFIG_CRCO		0x04
#define	nrf24l01_CONFIG_PWR_UP		0x02
#define	nrf24l01_CONFIG_PRIM_RX		0x01

//EN_AA register bitwise definitions
#define nrf24l01_EN_AA_RESERVED		0xC0
#define nrf24l01_EN_AA_ENAA_ALL		0x3F
#define nrf24l01_EN_AA_ENAA_P5		0x20
#define nrf24l01_EN_AA_ENAA_P4		0x10
#define nrf24l01_EN_AA_ENAA_P3		0x08
#define nrf24l01_EN_AA_ENAA_P2		0x04
#define nrf24l01_EN_AA_ENAA_P1		0x02
#define nrf24l01_EN_AA_ENAA_P0		0x01
#define nrf24l01_EN_AA_ENAA_NONE	0x00

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
狠狠v欧美v日韩v亚洲ⅴ| 亚洲精品少妇30p| 日韩成人免费电影| 色呦呦网站一区| 欧美国产1区2区| 九九**精品视频免费播放| 欧美体内she精高潮| 自拍偷在线精品自拍偷无码专区| 国产制服丝袜一区| 日韩午夜精品电影| 久久99精品国产.久久久久久| 欧美日韩日日夜夜| 亚洲成年人影院| 91国在线观看| 亚洲综合激情另类小说区| 白白色亚洲国产精品| 国产日韩欧美在线一区| 精品一区二区三区在线播放视频| 日韩一区国产二区欧美三区| 亚洲成人av一区| 欧美精品精品一区| 蜜桃久久精品一区二区| 精品福利在线导航| 国产在线播放一区三区四| 久久这里只有精品6| 国产成人丝袜美腿| 成人免费一区二区三区视频| 91影视在线播放| 亚洲地区一二三色| 日韩美女一区二区三区| 国产精品亚洲第一| 亚洲天天做日日做天天谢日日欢| 在线观看日韩精品| 成人看片黄a免费看在线| 26uuu精品一区二区三区四区在线| 亚洲一区二区三区国产| 成人黄色网址在线观看| 日韩欧美国产一区二区三区| 亚洲欧洲精品天堂一级 | 国产精品丝袜久久久久久app| 国产·精品毛片| 一个色在线综合| 久久久噜噜噜久久人人看 | 久久电影网电视剧免费观看| 久久久噜噜噜久噜久久综合| 国产一区二三区| 久久日韩粉嫩一区二区三区| 91啦中文在线观看| 久久精品国产99久久6| 中文字幕在线不卡国产视频| 欧美一区二区三区公司| 99精品偷自拍| 国产一区二区三区四| 亚洲成人av一区二区三区| 国产精品免费观看视频| 欧美一区午夜视频在线观看| 91一区一区三区| 国产成人精品免费| 国产在线观看免费一区| 日本成人在线视频网站| 亚洲国产sm捆绑调教视频 | 欧美一区二区三区系列电影| 色中色一区二区| 99精品国产热久久91蜜凸| 国产一区二区精品久久91| 日韩精品电影一区亚洲| 亚洲第一会所有码转帖| 亚洲综合免费观看高清完整版| 亚洲欧美日韩中文字幕一区二区三区 | 欧美亚洲动漫另类| 久久精品亚洲精品国产欧美kt∨| 色悠久久久久综合欧美99| 91丨九色丨尤物| 91麻豆精东视频| 在线精品观看国产| 在线观看不卡视频| 欧美喷潮久久久xxxxx| 欧美三级电影网站| 91精品国模一区二区三区| 欧美日本一区二区在线观看| 欧美剧情片在线观看| 日韩一区二区三区三四区视频在线观看 | 色婷婷国产精品综合在线观看| 成人国产精品免费网站| 91一区二区三区在线观看| 欧美又粗又大又爽| 91麻豆精品国产91久久久使用方法| 日韩一区二区三区视频在线| 久久久三级国产网站| 中文字幕在线不卡视频| 一区二区三区91| 激情文学综合插| 色综合色狠狠综合色| 欧美一区二区三区免费大片| 国产欧美1区2区3区| 国产aⅴ综合色| 91丨九色丨蝌蚪丨老版| 日韩一区二区在线看| 中文字幕av资源一区| 午夜精品免费在线| 成人在线视频一区二区| 欧美日韩一区高清| 亚洲国产精品高清| 日韩精品欧美精品| 99精品欧美一区二区三区小说| 欧美一区二区三区影视| **欧美大码日韩| 韩国女主播一区| 在线成人av网站| 日韩一区中文字幕| 韩国一区二区在线观看| 欧美亚洲自拍偷拍| 亚洲欧洲美洲综合色网| 九九精品视频在线看| 欧美欧美午夜aⅴ在线观看| 中文字幕高清一区| 国产乱人伦偷精品视频免下载| 欧美日韩精品一区二区三区 | 日韩欧美在线观看一区二区三区| 亚洲欧美一区二区三区极速播放| 国产成人在线网站| 国产日韩v精品一区二区| 久久国产精品色| 欧美一级精品在线| 五月激情综合色| 欧美亚洲愉拍一区二区| 亚洲精品成a人| 日本乱码高清不卡字幕| 中文字幕一区二区日韩精品绯色| 成人久久18免费网站麻豆| 男人操女人的视频在线观看欧美| 色婷婷综合久久久中文一区二区| 中文字幕日韩精品一区| av中文字幕在线不卡| 亚洲日本在线观看| 日本高清免费不卡视频| 亚洲色图视频网站| 欧洲在线/亚洲| 日日摸夜夜添夜夜添精品视频 | 欧美在线你懂的| 午夜欧美在线一二页| 欧美日韩一区中文字幕| 日韩va亚洲va欧美va久久| 欧美大尺度电影在线| 高清av一区二区| 亚洲精品综合在线| 这里只有精品99re| 国产专区欧美精品| 亚洲精品视频免费观看| 91麻豆精品国产91久久久久久久久 | 成人欧美一区二区三区黑人麻豆 | 国产一区二区三区综合| 国产精品视频一二| 欧美性色黄大片| 激情综合网天天干| 亚洲与欧洲av电影| 久久久亚洲精华液精华液精华液| 91原创在线视频| 久久精品国产99| 亚洲精品第1页| 久久久99精品免费观看不卡| 欧美系列亚洲系列| 国产精品538一区二区在线| 一区二区三区毛片| 中文字幕免费观看一区| 欧美久久久久久久久久| 国产69精品久久久久毛片| 日本亚洲电影天堂| 亚洲欧美经典视频| 中文字幕欧美日本乱码一线二线| 欧美一区国产二区| 欧美国产成人精品| 久久亚洲影视婷婷| 日韩一卡二卡三卡| 欧美日韩精品是欧美日韩精品| 成人中文字幕电影| 国产jizzjizz一区二区| 加勒比av一区二区| 乱一区二区av| 蜜桃精品视频在线| 视频一区二区三区中文字幕| 亚洲精品欧美激情| 一区二区三区日韩欧美精品 | 粉嫩嫩av羞羞动漫久久久| 老司机精品视频线观看86 | 欧美亚洲丝袜传媒另类| 成av人片一区二区| 成人v精品蜜桃久久一区| 国产成人精品免费| 成人听书哪个软件好| 成人免费视频caoporn| 成人av高清在线| 99r精品视频| 精品污污网站免费看| 欧美日韩国产电影| 日韩欧美第一区| 国产欧美一区二区精品秋霞影院| 国产亚洲短视频| 亚洲免费视频中文字幕| 亚洲第一搞黄网站|