NRF24L01发送程序(单片机是STC89C52)
#include
typedef unsigned int uint;
typedef unsigned char uchar;
#define TX_ADDR_WITDH 5//发送地址宽度设置为5个字节
#define RX_ADDR_WITDH 5//接收地址宽度设置为5个字节
#define TX_DATA_WITDH 8//
#define RX_DATA_WITDH 8
#define R_REGISTER
#define W_REGISTER
#define R_RX_PLOAD
#define W_TX_PLOAD
#define FLUSH_TX
#define FLUSH_RX
#define REUSE_TX_PL 0xE3
#define NOP
#define CONFIG
#define EN_AA
#define EN_RX_ADDR
#define SETUP_AW
#define SETUP_RETR
#define RF_CH
#define RF_SETUP
#define STATUS
#define OBSERVE_TX
#define CD
#define RX_ADDR_P0
#define RX_ADDR_P1
#define RX_ADDR_P2
#define RX_ADDR_P3
#define RX_ADDR_P4
#define RX_ADDR_P5
#define TX_ADDR
#define RX_PW_P0
#define RX_PW_P1
#define RX_PW_P2
#define RX_PW_P3
#define RX_PW_P4
#define RX_PW_P5
#define FIFO_STATUS 0x17
//*********************************************************************************
uchar sta;
#define RX_DR
#define TX_DS
#define MAX_RT (sta & 0x10)
sbit CE=P1^5;
sbit IRQ=P1^0;
sbit CSN=P1^4;
sbit MOSI=P1^2;
sbit MISO=P1^1;
sbit SCK=P1^3;
sbit LED=P0^0;
uchar code TX_Addr[]={0x34,0x43,0x10,0x10,0x01};
uchar code TX_Buffer[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x00};
uchar RX_Buffer[RX_DATA_WITDH];
void _delay_us(uint x)
{
}
void _delay_ms(uint x)
{
}
//nRF24L01初始化
void nRF24L01_Init(void)
{
}
//SPI时序函数
uchar SPI_RW(uchar byte)
{
}
//SPI写寄存器一字节函数
//reg:寄存器地址
//value:一字节(值)
uchar SPI_W_Reg(uchar reg,uchar value)
{
}
//SPI读一字节
uchar SPI_R_byte(uchar reg)
{
}
//SPI读取RXFIFO寄存器数据
//reg:寄存器地址
//Dat_Buffer:用来存读取的数据
//DLen:数据长度
uchar SPI_R_DBuffer(uchar reg,uchar *Dat_Buffer,uchar Dlen)
{
}
//SPI向TXFIFO寄存器写入数据
//reg:写入寄存器地址
//TX_Dat_Buffer:存放需要发送的数据
//Dlen:数据长度
uchar SPI_W_DBuffer(uchar reg,uchar *TX_Dat_Buffer,uchar Dlen)
{
}
//设置发送模式
void nRF24L01_Set_TX_Mode(uchar *TX_Data)
{
}
//检测应答信号
uchar Check_Ack(void)
{
}
NRF24L01发送程序单片机STC89C5 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)