⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cc2400.h

📁 DSP与CC2400连接.做的无线数据发送程序.程序现在没有加入校验部分.也可以当接收程序使用.不用修改
💻 H
字号:
// Chipcon
// Product = CC2400
// Crystal accuracy = 0 ppm
// RF frequency = 2433 MHz
// RF data rate = 1 Mbps
// RF output power = 0.0 dBm
// RF deviation = 250 kHz
// RF bandwidth = 1 MHz
// RF data format = (2) 8/10 Line Coding
// RF modulation = (1) OOK
// GIO1 configuration = (60) LOCK_STATUS
// GIO6 configuration = (11) CRC_OK
//#define CC2400_FSDIV     0x02;
//#define CC2400_MANAND    0x0D;
//#define CC2400_MDMCTRL   0x03;
//#define CC2400_MDMTST0   0x14;
//#define CC2400_MDMTST1   0x15;
//#define CC2400_FSMTC     0x0B;
//#define CC2400_FREND     0x05;
//#define CC2400_IOCFG     0x08;
//#define CC2400_GRMDM     0x20;
//#define CC2400_GRDEC     0x21;
//#define CC2400_LMTST     0x12;

 /******************************************************************************************************
 *                                                                                                     *
 *        **********                                                                                   *
 *       ************                                                                                  *
 *      ***        ***                                                                                 *
 *      ***   +++   ***                                                                                *
 *      ***   + +   ***                                                                                *
 *      ***   +                        					CC2400 include file		                       *
 *      ***   + +   ***                                                                                *
 *      ***   +++   ***                                                                                *
 *      ***        ***                                                                                 *
 *       ************                                                                                  *
 *        **********                                                                                   *
 *                                                                                                     *
 *******************************************************************************************************
 * CC2400 related definitions and macros.															   *
 * Time critical FIFO I/O is provided py FIFO.asm                                  					   *
 *******************************************************************************************************
 * Compiler: Keil C51                                                                                  *
 * Target platform:  8051F005                                                                          *
 *******************************************************************************************************
 * Revision history:   																				   *
 * Initial release, MBR																				   *
 * Modified for 8051, HKI, 01.08.2004                                                        		   *
 ******************************************************************************************************/




//----------------------------------------------------------------------------
// RF_SETTINGS is a data structure which contains all the settings
// required for a given pair of RX/TX channels.
// These values should be passed to the configuration function rfInit(...)
// before the RX/TX channel pair can be used. The configuration function writes
// the setup to the register in CC2400.
// The RX/TX channel pair is later used by passing the correpsonding
// RF_SETTINGS data structures to the function
// rfInit(). 					
//------------------------------------------------------------------------------

/***************************************************************************************************
 * 								CC2400 STROBE, CONTROL AND STATUS REGSITER                         *
 **************************************************************************************************/ 

#define	CC2400_MAIN	      0x00	//	Main control register
#define	CC2400_FSCTRL	  0x01	//	Frequency synthesiser main control and status
#define	CC2400_FSDIV	  0x02	//	Frequency synthesiser frequency division control
#define	CC2400_MDMCTRL	  0x03	//	Modem main control and status
#define	CC2400_AGCCTRL	  0x04	//	AGC main control and status
#define	CC2400_FREND	  0x05	//	Analog front-end control
#define	CC2400_RSSI	      0x06	//	RSSI information
#define	CC2400_FREQEST	  0x07	//	Received signal frequency offset estimation
#define	CC2400_IOCFG	  0x08	//	I/O configuration register
#define	CC2400_FSMTC	  0x0B	//	Finite state machine time constants
#define	CC2400_MANAND	  0x0D	//	Manual signal AND-override register
#define	CC2400_FSMSTATE   0x0E	//	Finite state machine information and breakpoint
#define	CC2400_ADCTST	  0x0F	//	ADC test register
#define	CC2400_RXBPFTST   0x10	//	Receiver bandpass filters test register
#define	CC2400_PAMTST	  0x11	//	PA and transmit mixers test register
#define	CC2400_LMTST	  0x12	//	LNA and receive mixers test register
#define	CC2400_MANOR	  0x13	//	Manual signal OR-override register
#define	CC2400_MDMTST0	  0x14	//	Modem test register 0
#define	CC2400_MDMTST1	  0x15	//	Modem test register 1
#define	CC2400_DACTST	  0x16	//	DAC test register
#define	CC2400_AGCTST0	  0x17	//	AGC test register: various control and status
#define	CC2400_AGCTST1	  0x18	//	AGC test register: AGC timeout
#define	CC2400_AGCTST2	  0x19	//	AGC test register: AGC various parameters
#define	CC2400_FSTST0	  0x1A	//	Test register: VCO array results and override
#define	CC2400_FSTST1	  0x1B	//	Test register: VC DAC manual control VCO current constant
#define	CC2400_FSTST2	  0x1C	//	Test register:VCO current result and override
#define	CC2400_FSTST3	  0x1D	//	Test register: Charge pump current etc
#define	CC2400_MANFIDL	  0x1E	//	Manufacturer ID, lower 16 bit
#define	CC2400_MANFIDH	  0x1F	//	Manufacturer ID, upper 16 bit
#define	CC2400_GRMDM	  0x20	//	Generic radio modem control
#define	CC2400_GRDEC	  0x21	//	Generic radio decimation control and status
#define	CC2400_PKTSTATUS  0x22	//	Packet mode status
#define	CC2400_INT        0x23	//	Interrupt register
#define	CC2400_SYNCL	  0x2C	//	Synchronisation word, lower 16 bit
#define	CC2400_SYNCH	  0x2D	//	Synchronisation word, upper 16 bit
#define	CC2400_SXOSCON	  0x60	//	Command strobe register: Turn on XOSC
#define	CC2400_SFSON	  0x61	//	Command strobe register: Start and calibrate FS and 
#define	CC2400_SRX	      0x62	//	Command strobe register: Start RX
#define	CC2400_STX	      0x63	//	Command strobe register: Start TX (turn on PA)
#define	CC2400_SRFOFF	  0x64	//	Command strobe register: Turn off RX/TX and FS
#define	CC2400_SXOSCOFF   0x65	//	Command strobe register: Turn off XOSC
#define	CC2400_FIFOREG	  0x70	//	Write and read data to and from the 32 byte FIFO

/***************************************************************************************************
 * 								CC2400 STROBE, CONTROL AND STATUS REGSITER                         *
 **************************************************************************************************/ 
//#define	FSDIV_Var_HIGH	  0x09
//#define	FSDIV_Var_LOW	  0x81
#define	FSDIV_Var_HIGH	  0x09
#define	FSDIV_Var_LOW	  0x81
#define	MDMCTRL_Var_HIGH	  0x00
#define	MDMCTRL_Var_LOW	  0x40
#define	FREND_Var_HIGH	  0x00
#define	FREND_Var_LOW	  0x0F
//#define	IOCFG_Var_HIGH	  0x17  默认
//#define	IOCFG_Var_LOW	  0x0E0  默认
#define	IOCFG_Var_HIGH	  0x17       
#define	IOCFG_Var_LOW	  0xE0//IO6FIFO空  IO1FIFO满
#define	FSMTC_Var_HIGH	  0x7A
#define	FSMTC_Var_LOW	  0xAF
#define	MANAND_Var_HIGH	  0x7F
#define	MANAND_Var_LOW	  0xFF
#define	LMTST_Var_HIGH	  0x29
#define	LMTST_Var_LOW	  0x22
//#define	MDMTST0_Var_HIGH	  0x13
//#define	MDMTST0_Var_LOW	  0x4B
#define	MDMTST0_Var_HIGH	0x13
#define	MDMTST0_Var_LOW	  0x28
#define	MDMTST1_Var_HIGH	  0x00
#define	MDMTST1_Var_LOW	  0x28
//#define	GRMDM_Var_HIGH	  0x0F
//#define	GRMDM_Var_LOW	  0x79
#define	GRMDM_Var_HIGH	  0x0D
#define	GRMDM_Var_LOW	  0xF0
#define	GRDEC_Var_HIGH	  0x00
#define	GRDEC_Var_LOW	  0x03
//#define	INT_Var_HIGH	  0x00
//#define	INT_Var_LOW	      0x5E
#define	INT_Var_HIGH	  0x00
#define	INT_Var_LOW	      0x40
 /*******************************************************************************************************
 * 										       Bit definitions		        		                    *
 *					The Register Bit names are represented by their bit number (0-15)					*
 *******************************************************************************************************/

// The status byte of CC2400
#define	XOSC16M_STABLE       0x40 // Indicates whether the 16MHz oscillator is running ('1') or not
#define	CS_ABOVE_THRESHOLD_N 0x20 // Carrier sense flag.                               
#define	SYNC_RECEIVED	     0x10 // Indicates whether a sync word has been received or not
#define	FS_LOCK              0x04 // Indicates whether the freq. synth. is in lock('1') or not

 
// Main control register
#define	RESET	          15
#define	FS_FORCE_EN	       9
#define	RXN_TX	           8
#define	XOSC32K_BYPASS	   3
#define	XOSC32K_EN	       2
#define	XOSC16M_BYPASS	   1
#define	XOSC16M_FORCE_EN   0

//	FSCTRL (0x01) - Frequency Synthesiser Control and Status										
#define		LOCK_THRESHOLD	4	//	Number of consecutive reference clock periods with successful sync windows required to indicate lock						
#define		CAL_DONE	    3	//	Calibration has been performed since the last time the FS was turned on.						
#define		CAL_RUNNING	    2	//	Calibration status, '1' when calibration in progress.						
#define		LOCK_LENGTH	    1	//	LOCK_WINDOW pulse width:0: 2 CLK_PRE periods1: 4 CLK_PRE periods						
#define		PLL_LOCK_STATUS	0	//	'1' when PLL is in lock, otherwise '0'.						
											
//	FSDIV (0x02) - Frequency Synthesiser Frequency Division Control										
#define		FREQ_R	        10	//	Read only. Directly gives the right frequency when reading.						
#define		FREQ  	         0	//	Frequency control word used in Bluetooth mode and in GR mode with manual frequency-hopping enabled.  						
											
//	MDMCTRL (0x03) - Modem Control and Status										
#define		MOD_OFFSET	    7	//	Modulator centre frequency in 15.625 kHz steps relative to 1 MHz. Two's complement signed value. I.e MOD_OFFSET=0x3F 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -