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

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

?? nrf24l01.h

?? 介紹NRF24L01的增強型突發模式(Enhanced ShockBurst Mode),此模式有效數據速率為2Mbps。其中文件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一区二区三区免费野_久草精品视频
天天做天天摸天天爽国产一区| 久久久精品日韩欧美| 色诱视频网站一区| 成人av电影在线| 91麻豆swag| 欧美日韩aaaaaa| 宅男噜噜噜66一区二区66| 91精品国产综合久久国产大片| 91精品国产91综合久久蜜臀| 欧美一区二区三区视频| 26uuuu精品一区二区| 日本一区二区免费在线观看视频| 国产日韩欧美不卡在线| 亚洲欧洲日产国码二区| 午夜视频久久久久久| 国产在线播精品第三| 成人免费高清在线| 在线观看视频91| 欧美电影免费观看高清完整版在| 久久久精品免费网站| 亚洲美腿欧美偷拍| 男人的j进女人的j一区| 国产精品亚洲一区二区三区妖精| 91色九色蝌蚪| 日韩精品资源二区在线| 国产情人综合久久777777| 亚洲色图第一区| 美女视频网站久久| 99国产精品久久久久久久久久| 日本国产一区二区| 欧美精品一区二区三区久久久| 国产精品全国免费观看高清| 无码av免费一区二区三区试看| 国产一区二区91| 欧美日韩在线一区二区| 国产午夜精品一区二区三区视频 | 欧美日韩美少妇| 精品国产亚洲一区二区三区在线观看| 国产精品视频一区二区三区不卡| 午夜欧美在线一二页| 国产精品一区2区| 91精品国产福利在线观看| 日韩理论片一区二区| 另类专区欧美蜜桃臀第一页| 色香色香欲天天天影视综合网| 久久―日本道色综合久久 | 欧美日本在线一区| 欧美国产日韩一二三区| 老司机免费视频一区二区| 色狠狠桃花综合| 国产精品全国免费观看高清| 国产一区视频在线看| 欧美日本一区二区在线观看| 亚洲欧美另类综合偷拍| 国产九色精品成人porny| 欧美一级黄色录像| 亚洲图片欧美综合| 日本高清不卡视频| 亚洲色图制服诱惑| 99久久99久久精品免费看蜜桃 | 99国产精品视频免费观看| 亚洲精品一区二区三区99| 天天色天天爱天天射综合| 欧美亚洲综合久久| 亚洲精品国产一区二区三区四区在线| 国产精品一区二区免费不卡| 精品久久免费看| 精品在线播放午夜| 日韩三级电影网址| 狂野欧美性猛交blacked| 69久久夜色精品国产69蝌蚪网| 午夜精品123| 欧美日韩1234| 免费在线观看一区| 精品国产91久久久久久久妲己| 毛片一区二区三区| 2021国产精品久久精品| 激情综合色综合久久综合| 久久影视一区二区| 国产成人丝袜美腿| 欧美激情一区二区| 色呦呦国产精品| 亚洲电影在线播放| 这里只有精品免费| 美女诱惑一区二区| xnxx国产精品| caoporm超碰国产精品| 亚洲一区二区三区四区在线观看| 欧美嫩在线观看| 黄色成人免费在线| 18欧美亚洲精品| 欧美日韩精品欧美日韩精品| 精品一区二区三区在线播放| 久久综合色之久久综合| 99re8在线精品视频免费播放| 亚洲视频1区2区| 91精品在线免费观看| 国产精品一区二区果冻传媒| 亚洲人xxxx| 欧美一区二区高清| 成年人国产精品| 日韩国产欧美一区二区三区| 中文字幕免费观看一区| 欧美午夜片在线看| 国产精品一二三区| 亚洲精品视频在线看| 51久久夜色精品国产麻豆| 国产精品自拍三区| 亚洲成人自拍网| 国产日韩精品一区二区三区| 欧洲精品一区二区三区在线观看| 免费在线观看不卡| 最新不卡av在线| 日韩欧美专区在线| 色综合久久88色综合天天| 老司机精品视频在线| 一区二区三区四区激情| 久久精品一区二区三区不卡| 欧美天天综合网| 99久久久国产精品免费蜜臀| 蜜桃久久av一区| 亚洲精品成人a在线观看| 久久免费看少妇高潮| 欧美日韩一区在线| 色综合色综合色综合色综合色综合 | 91麻豆精品久久久久蜜臀| 94-欧美-setu| 丁香六月综合激情| 狠狠狠色丁香婷婷综合久久五月| 亚洲国产乱码最新视频| 一色桃子久久精品亚洲| 久久久一区二区三区捆绑**| 欧美一级欧美三级在线观看| 欧美在线不卡视频| 91视频免费播放| 成人av在线资源网站| 国产大陆亚洲精品国产| 国产资源在线一区| 麻豆精品在线看| 日韩av网站在线观看| 性久久久久久久久| 亚洲成人激情社区| 亚洲第四色夜色| 亚洲高清不卡在线| 亚洲一区二区在线免费观看视频| 亚洲美女视频在线观看| 亚洲欧美激情一区二区| 亚洲欧美激情一区二区| 亚洲视频在线观看一区| 亚洲天堂免费看| 一区二区三区四区激情| 亚洲最大成人网4388xx| 日韩毛片在线免费观看| 一区二区三区精密机械公司| 亚洲男人的天堂av| 亚洲国产精品影院| 日韩国产一区二| 韩国欧美国产1区| 国产精品亚洲а∨天堂免在线| 国产激情视频一区二区在线观看 | 国产精品美女久久久久av爽李琼 | 99在线热播精品免费| 成人午夜免费视频| 99精品国产91久久久久久| 一本色道久久综合亚洲精品按摩| 91精品福利视频| 欧美高清视频不卡网| 日韩欧美高清一区| 国产精品视频yy9299一区| 亚洲乱码中文字幕| 日韩不卡在线观看日韩不卡视频| 久久99久久久欧美国产| 成人黄色一级视频| 在线免费观看不卡av| 日韩一区二区三区电影在线观看| 久久久99免费| 一区二区三区四区不卡在线 | 欧美日韩亚洲综合一区二区三区| 日韩亚洲欧美在线| 中文字幕不卡在线播放| 午夜av一区二区三区| 国产成人在线免费| 欧美人与z0zoxxxx视频| 久久精品人人做人人综合| 亚洲精品第一国产综合野| 久久国产精品区| 91在线视频网址| 日韩欧美一区在线观看| 中文字幕在线观看不卡| 美女高潮久久久| 色天天综合色天天久久| 久久色在线视频| 午夜精品国产更新| 成人黄色小视频| 精品日韩欧美在线| 舔着乳尖日韩一区| 99精品欧美一区| 久久久影视传媒| 日本不卡视频一二三区| 色综合天天综合网天天狠天天|