基于CC1101与STC89C52无线收发程序(发射程序)
#include
#include
#define IOCFG2
#define IOCFG1
#define IOCFG0
#define FIFOTHR
#define SYNC1
#define SYNC0
#define PKTLEN
#define PKTCTRL1
#define PKTCTRL0
#define ADDR
#define CHANNR
#define FSCTRL1
#define FSCTRL0
#define FREQ2
#define FREQ1
#define FREQ0
#define MDMCFG4
#define MDMCFG3
#define MDMCFG2
#define MDMCFG1
#define MDMCFG0
#define DEVIATN
#define MCSM2
#define MCSM1
#define MCSM0
#define FOCCFG
#define BSCFG
#define AGCCTRL2
#define AGCCTRL1
#define AGCCTRL0
#define WOREVT1
#define WOREVT0
#define WORCTRL
#define FREND1
#define FREND0
#define FSCAL3
#define FSCAL2
#define FSCAL1
#define FSCAL0
#define RCCTRL1
#define RCCTRL0
#define FSTEST
#define PTEST
#define AGCTEST
#define TEST2
#define TEST1
#define TEST0
#define SRES
#define
#define SXOFF
#define SCAL
#define SRX
#define STX
#define SIDLE
#define SAFC
#define SWOR
#define SPWD
#define SFRX
#define SFTX
#define SWORRST
#define SNOP
#define PARTNUM
#define VERSION
#define FREQEST
#define LQI
#define RSSI
#define MARCSTATE
#define WORTIME1
#define WORTIME0
#define PKTSTATUS
#define VCO_VC_DAC
#define TXBYTES
#define RXBYTES
#define PATABLE
#define TX_FIFO
#define RX_FIFO
#define data_len
typedef
typedef
uchar rx_buffer[data_len]={0,0,0,0,0,0,0,0};//rx data
//uchar RX_data[data_len];
uchar code tx_buffer[data_len]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};//tx data
uchar data_length=0;
uchar code P_Config[]={0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0};//功率配置
sbit CSN=P2^1;
sbit SCLK=P2^7;
sbit SI=P2^2;
sbit SO=P2^0;
sbit GDO0=P2^6;
sbit key=P2^5;
sbit LED=P0^0;
//sbit LED1=P0^6;
void CC1101_Init(void);
void CC1101_RESET(void);
void POWER_UP_RESET(void);
uchar SPI_WR_Byte(uchar value);
void SPI_Write_Byte(uchar addr,uchar value);
uchar SPI_Read_Byte(uchar addr);
void SPI_Write_Strobe(uchar strobe);
void SPI_Write_Burst(uchar addr,uchar *buffer,uchar count);
void SPI_Read_Burst(uchar addr,uchar *buffer,uchar count);
void SPI_Write_Packet(uchar *TX_Buffer,uchar size);
uchar SPI_Read_Packet(uchar *RX_Buffer,uchar length);
void CC1101_Set_TX(void);
void CC1101_Set_RX(void);
void Write_Config(void);
CC1101STC89C52无线收 相关文章:
- 基于CC1101与STC89C52无线收发程序(接收程序)(11-27)
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)