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

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

?? nrf24l01.h

?? nRF24L01開發指導
?? H
?? 第 1 頁 / 共 2 頁
字號:
/******************************************************************************
*
* 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 <stddef.h>

#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<X>, where "B" represents "byte" and <X> 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

//EN_RXADDR register bitwise definitions
#define nrf24l01_EN_RXADDR_RESERVED	0xC0

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人美女视频在线观看18| 夜夜揉揉日日人人青青一国产精品| 337p粉嫩大胆噜噜噜噜噜91av| 久久久精品中文字幕麻豆发布| 亚洲欧洲成人自拍| 亚洲6080在线| 国产一区二区三区综合| 99精品视频一区二区| 欧美精品在欧美一区二区少妇| 精品对白一区国产伦| √…a在线天堂一区| 日日夜夜免费精品| 国产成人精品一区二| 精品污污网站免费看| 久久综合狠狠综合| 亚洲一二三区在线观看| 国产高清成人在线| 欧美日韩一区二区三区四区| 国产亚洲精品免费| 五月天欧美精品| 99国产欧美另类久久久精品| 亚洲在线中文字幕| 喷白浆一区二区| 日韩免费高清av| 亚洲视频免费在线| 蜜桃久久精品一区二区| 99久久免费视频.com| 精品日本一线二线三线不卡| 不卡一区二区三区四区| 日韩免费成人网| 亚洲一区日韩精品中文字幕| 国产成人在线网站| 7777精品伊人久久久大香线蕉经典版下载 | 99精品视频在线观看| 日韩精品专区在线| 亚洲综合免费观看高清在线观看| 国产成人午夜视频| 欧美一级日韩一级| 亚洲午夜三级在线| 99精品在线观看视频| 国产三级一区二区| 日韩欧美精品在线| 久久麻豆一区二区| 日韩精品五月天| 91福利视频在线| 中文字幕一区二区三区不卡在线 | 制服丝袜亚洲精品中文字幕| 亚洲欧洲精品天堂一级| 国产精品一区二区在线播放| 91精品视频网| 亚洲mv在线观看| 欧美综合在线视频| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 欧美中文字幕一二三区视频| 国产精品亲子伦对白| 国产乱子轮精品视频| 欧美成人video| 青草av.久久免费一区| 五月激情综合色| 在线精品视频一区二区| 亚洲欧美日韩国产手机在线| www.亚洲精品| 1024成人网| 91麻豆自制传媒国产之光| 中文字幕在线观看一区二区| 国产成人高清视频| 日韩一级黄色片| 亚洲va欧美va人人爽午夜| 成人夜色视频网站在线观看| 久久免费电影网| 国产一区二区不卡在线| 日韩情涩欧美日韩视频| 蜜臀精品一区二区三区在线观看 | 三级不卡在线观看| 欧美日韩一区三区四区| 亚洲成a人v欧美综合天堂下载| 一本大道久久a久久精品综合 | 欧美日韩在线亚洲一区蜜芽| 亚洲女女做受ⅹxx高潮| 一本在线高清不卡dvd| 亚洲精品久久久久久国产精华液| 91麻豆.com| 亚洲一区二区三区影院| 欧美日本韩国一区二区三区视频| 亚洲123区在线观看| 91精品久久久久久久99蜜桃 | 久久综合久色欧美综合狠狠| 国产真实乱子伦精品视频| 国产欧美精品区一区二区三区 | 自拍偷拍国产精品| 亚洲欧美综合色| 91日韩精品一区| 亚洲国产精品欧美一二99| 欧美一区二区三区在线视频| 久久国产尿小便嘘嘘| 久久精品无码一区二区三区| 99精品国产热久久91蜜凸| 亚洲国产aⅴ成人精品无吗| 日韩一区二区免费在线电影| 国模娜娜一区二区三区| 中文字幕在线播放不卡一区| 91久久精品一区二区三区| 免费高清成人在线| 国产精品久久久久精k8| 色婷婷亚洲综合| 久久狠狠亚洲综合| 中文字幕在线观看不卡| 欧美日韩一区中文字幕| 国产综合久久久久久鬼色| 日韩一区日韩二区| 制服丝袜一区二区三区| 成人天堂资源www在线| 亚洲国产欧美另类丝袜| 亚洲精品一区二区三区福利| hitomi一区二区三区精品| 婷婷六月综合网| 亚洲国产精品99久久久久久久久| 91猫先生在线| 国产在线国偷精品免费看| 一区二区三区影院| 欧美成人a在线| 在线区一区二视频| 国产精品综合久久| 亚洲va中文字幕| 国产精品久久精品日日| 91.com视频| 色综合中文字幕| 精品一区二区三区免费视频| 亚洲黄网站在线观看| 精品国产第一区二区三区观看体验 | 精品少妇一区二区| 色综合久久综合网| 国产裸体歌舞团一区二区| 亚洲电影第三页| 国产精品伦理一区二区| 日韩精品一区二区三区三区免费| 91老师国产黑色丝袜在线| 黄页网站大全一区二区| 午夜欧美视频在线观看| 亚洲欧洲三级电影| 欧美成人精品二区三区99精品| 色菇凉天天综合网| 大胆亚洲人体视频| 日韩av一区二区在线影视| 亚洲色欲色欲www| 亚洲国产岛国毛片在线| 日韩三区在线观看| 欧美亚洲一区二区在线| av亚洲精华国产精华精| 国产很黄免费观看久久| 经典三级一区二区| 日本网站在线观看一区二区三区| 日韩美女啊v在线免费观看| 国产欧美一区二区三区鸳鸯浴| 欧美疯狂做受xxxx富婆| 欧美无砖砖区免费| 91蝌蚪porny九色| 成人免费va视频| 国产91精品精华液一区二区三区| 看片的网站亚洲| 日本不卡在线视频| 天天影视网天天综合色在线播放| 亚洲自拍偷拍欧美| 亚洲激情图片qvod| 一区二区三区成人| 亚洲天堂av老司机| ●精品国产综合乱码久久久久| 欧美国产综合色视频| 日本一二三四高清不卡| 国产亚洲一区字幕| 久久久国产精华| 久久精品视频一区二区三区| 久久一夜天堂av一区二区三区| 日韩欧美国产小视频| 欧美xxxxx裸体时装秀| 日韩欧美国产午夜精品| 精品日韩99亚洲| 久久蜜桃av一区二区天堂| 精品国产a毛片| 国产欧美一区二区精品仙草咪| 久久久久久一二三区| 久久精品网站免费观看| 亚洲国产精品成人久久综合一区 | 日本福利一区二区| 一本久久精品一区二区| 91电影在线观看| 欧美日韩精品一区二区| 欧美日韩mp4| 日韩一级成人av| 日韩欧美在线观看一区二区三区| 日韩免费性生活视频播放| 精品久久人人做人人爱| 久久久噜噜噜久噜久久综合| 久久精品一区二区三区不卡| 国产精品美女久久久久久久| 亚洲精品日韩一| 午夜精品一区在线观看| 蜜臀av性久久久久蜜臀aⅴ流畅| 精品综合久久久久久8888| 国产91综合一区在线观看|