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

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

?? nrf24l01.h

?? 介紹NRF24L01的多通道(Multiple Pipes),其中文件nrf24l01.c實現此射頻芯片在多通道下的通信
?? 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 <p18f452.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		PORTC
#define nrf24l01_CE_PINMASK			0x02

//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		PORTC
#define nrf24l01_CSN_PINMASK		0x04

//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		PORTB
#define nrf24l01_IRQ_PINMASK		0x01


////////////////////////////////////////////////////////////////////////////////////
// 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一区二区三区免费野_久草精品视频
不卡视频在线看| 欧美一二三在线| 北岛玲一区二区三区四区| 日本韩国欧美在线| 久久免费美女视频| 视频一区免费在线观看| 成人午夜私人影院| 欧美精品一区二区在线播放| 亚洲一区二区三区四区不卡| 国产91精品久久久久久久网曝门| 日本欧美大码aⅴ在线播放| 成人av在线播放网址| 精品99一区二区| 蜜桃视频免费观看一区| 在线观看欧美日本| 亚洲精品日韩综合观看成人91| 亚洲妇熟xx妇色黄| 97久久精品人人澡人人爽| 久久久美女毛片| 人人狠狠综合久久亚洲| 欧美日韩国产片| 亚洲激情成人在线| 国产大陆a不卡| 久久夜色精品一区| 国产一区高清在线| 2017欧美狠狠色| 激情五月婷婷综合| 久久免费看少妇高潮| 久久99日本精品| ww久久中文字幕| 精品一区二区久久| 2022国产精品视频| 久久91精品久久久久久秒播| 欧美成人乱码一区二区三区| 日本成人在线一区| 日韩一区二区三区视频| 日本欧洲一区二区| 日韩欧美国产午夜精品| 捆绑调教一区二区三区| 欧美精品一区二区三区在线| 黑人巨大精品欧美黑白配亚洲| 欧美乱妇23p| 日本亚洲三级在线| 亚洲精品一区二区在线观看| 国产呦精品一区二区三区网站| 欧美日韩中文字幕精品| 婷婷夜色潮精品综合在线| 欧美一卡2卡3卡4卡| 黄色资源网久久资源365| 久久久久久9999| 色综合久久天天综合网| 偷拍一区二区三区四区| 精品精品国产高清a毛片牛牛| 丝袜亚洲另类丝袜在线| 精品久久久网站| 成人免费视频视频| 亚洲国产日韩在线一区模特| 欧美一个色资源| www.av亚洲| 日本一区中文字幕| 国产亚洲精品免费| 日本黄色一区二区| 久88久久88久久久| 亚洲人精品一区| 欧美一区在线视频| av亚洲产国偷v产偷v自拍| 亚洲一区二区影院| 26uuu色噜噜精品一区| 欧美亚洲精品一区| 国产美女精品人人做人人爽| 亚洲精品少妇30p| 久久亚洲一级片| 欧美三片在线视频观看 | 久久美女艺术照精彩视频福利播放| 久久国产精品99久久久久久老狼| 久久免费看少妇高潮| 欧美三级在线视频| 成人网在线播放| 日日夜夜精品免费视频| 亚洲手机成人高清视频| 日韩免费视频一区二区| 在线免费不卡电影| 成人丝袜18视频在线观看| 日韩有码一区二区三区| 一区二区三区在线看| 久久青草国产手机看片福利盒子| 在线观看区一区二| www.久久精品| 成人午夜精品在线| 国产主播一区二区| 日韩精品一级二级| 亚洲永久精品国产| 中文字幕亚洲在| 国产欧美久久久精品影院| 日韩亚洲欧美在线| 欧美人动与zoxxxx乱| 91亚洲精品久久久蜜桃| 国产99久久久国产精品潘金网站| 丝袜诱惑亚洲看片| 亚洲亚洲人成综合网络| 亚洲色图20p| 日韩理论片一区二区| 国产欧美日本一区视频| 国产亚洲婷婷免费| 久久久www免费人成精品| 日韩精品一区二区三区中文精品| 色婷婷综合久色| 91色婷婷久久久久合中文| 不卡视频在线看| av不卡免费电影| 99久久精品国产麻豆演员表| 国产91综合一区在线观看| 成人综合激情网| aaa亚洲精品| 丁香激情综合五月| caoporn国产一区二区| 成人黄页毛片网站| 91丨porny丨户外露出| 91丨porny丨中文| 欧美亚洲一区二区在线| 5858s免费视频成人| 欧美一区二区三区日韩视频| 日韩午夜在线影院| 久久综合精品国产一区二区三区 | 久久99热狠狠色一区二区| 久久草av在线| 国产制服丝袜一区| 国产v综合v亚洲欧| 色婷婷精品久久二区二区蜜臀av| 色综合欧美在线| 911精品国产一区二区在线| 日韩欧美久久一区| 国产欧美视频一区二区| 国产精品欧美极品| 亚洲综合久久av| 蜜臀久久99精品久久久画质超高清| 香蕉久久一区二区不卡无毒影院 | 九九**精品视频免费播放| 精品亚洲porn| 99久久精品国产观看| 欧美日本乱大交xxxxx| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 秋霞电影网一区二区| 经典三级在线一区| 国产精品亚洲午夜一区二区三区| 久久国产剧场电影| 99久久99久久精品国产片果冻| 99久久99久久综合| 欧美精品自拍偷拍| 国产婷婷色一区二区三区四区| 国产精品毛片久久久久久久| 亚洲成av人片在线观看| 国产综合色在线视频区| 99re这里都是精品| 欧美大片一区二区| 综合在线观看色| 久久69国产一区二区蜜臀| 91蜜桃在线观看| 精品久久久久久久久久久久久久久久久 | thepron国产精品| 777久久久精品| 最新日韩av在线| 麻豆久久久久久| 欧美在线观看18| 国产精品久久一卡二卡| 美女脱光内衣内裤视频久久影院| 韩国成人精品a∨在线观看| 欧美色综合网站| 国产精品白丝在线| 国产精品123| 欧美一区二区三区在线电影| 亚洲男同1069视频| 国产成人无遮挡在线视频| 欧美视频在线一区| 亚洲欧美福利一区二区| 国产精品主播直播| 欧美一卡二卡在线观看| 亚洲午夜羞羞片| 色天使久久综合网天天| 中文字幕永久在线不卡| 国产精品99久| 久久九九99视频| 久久电影国产免费久久电影| 91精品婷婷国产综合久久性色 | www.av亚洲| 亚洲国产精品成人综合色在线婷婷 | 久久99精品久久久| 欧美日韩久久不卡| 亚洲精品视频观看| 色婷婷久久久久swag精品| 日韩一区在线播放| 国产精品香蕉一区二区三区| 日韩亚洲欧美成人一区| 久久精品国产免费| 制服丝袜亚洲色图| 奇米一区二区三区| 日韩欧美中文字幕一区| 伦理电影国产精品| 欧美www视频| 国产一区91精品张津瑜|