CC2420.h
代码如下:
#ifndef _CC2420_H_
#define _CC2420_H_
#include "public.h"
#define CC2420_PSDU_Len 127
#define REG_READ 0x40
#define REG_WRITE 0x00
#define RAM 0x80
#define RAM_READ 0x20
#define RAM_WRITE 0x00
#define CMD_SNOP (0x00 )
#define CMD_SXOSCON (0x01 )
#define CMD_STXCAL (0x02 )
#define CMD_SRXON (0x03 )
#define CMD_STXON (0x04 )
#define CMD_STXONCCA (0x05 )
#define CMD_SRFOFF (0x06 )
#define CMD_SXOSCOFF (0x07 )
#define CMD_SFLUSHRX (0x08 )
#define CMD_SFLUSHTX (0x09 )
#define CMD_SACK (0x0a )
#define CMD_SACKPEND (0x0b )
#define CMD_SRXDEC (0x0c )
#define CMD_STXENC (0x0d )
#define CMD_SAES (0x0e )
#define REG_MAIN (0x10 )
#define RESETN (0x01 << 15)
#define ENC_RESETN (0x01 << 14)
#define DEMOD_RESETN (0x01 << 13)
#define MOD_RESETN (0x01 << 12)
#define FS_RESETN (0x01 << 11)
#define XOSC16M_BYPASS (0x01 << 0 )
#define REG_MDMCTRL0 (0x11 )
#define RESERVED_FRAME_MODE (0x00 << 13)
#define PAN_COORDINATOR (0x01 << 12)
#define ADR_DECODE (0x01 << 11)
#define CCA_HYST (0x02 << 8 )
#define CCA_MODE (0x03 << 6 )
#define AUTOCRC (0x01 << 5 )
#define AUTOACK ( << 4 )
#define PREAMBLE_LENGTH (0x02 << 0 )
#define REG_MDMCTRL1 (0x12 )
#define CORR_THR (0x20 << 6 )
#define DEMOD_AVG_MODE ( << 5 )
#define MODULATION_MODE ( << 4 )
#define TX_MODE ( << 2 )
#define RX_MODE ( << 0 )
#define REG_RSSI (0x13 )
#define REG_SYNCWORD (0x14 )
#define SYNCWORD (0xA70F )
#define REG_TXCTRL (0x15 )
#define TXMIXBUF_CUR ( << 14)
#define TX_TURNAROUND ( << 13)
#define TXMIX_CAP_ARRAY ( << 11)
#define TXMIX_CURRENT ( << 9 )
#define PA_CURRENT ( << 6 )
#define PA_LEVEL ( << 0 )
#define REG_RXCTRL0 (0x16 )
#define RXMIXBUF_CUR ( << 12)
#define HIGH_LNA_GAIN ( << 10)
#define MED_LNA_GAIN ( << 8 )
#define LOW_LNA_GAIN ( << 6 )
#define HIGH_LNA_CURRENT ( << 4 )
#define MED_LNA_CURRENT ( << 2 )
#define LOW_LNA_CURRENT ( << 0 )
#define REG_RXCTRL1 (0x17 )
#define RXBPF_LOCUR ( << 13)
#define RXBPF_MIDCUR ( << 12)
#define LOW_LOWGAIN ( << 11)
#define MED_LOWGAIN ( << 10)
#define HIGH_HGM ( << 9 )
#define MED_HGM ( << 8 )
#define LNA_CAP_ARRAY ( << 6 )
#define RXMIX_TAIL ( << 4 )
#define RXMIX_VCM ( << 2 )
#define RXMIX_CURRENT ( << 0 )
#define REG_FSCTRL (0x18 )
#define LOCK_THR ( << 14)
#define CAL_DONE ( << 13)
#define CAL_RUNNING ( << 12)
#define LOCK_LENGTH ( << 11)
#define LOCK_STATUS ( << 10)
#define FREQ ( << 0 )
#define REG_SECCTRL0 (0x19 )
#define RXFIFO_PROTECTION ( << 9 )
#define SEC_CBC_HEAD ( << 8 )
#define SEC_SAKEYSEL (