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

📄 its_rf.h

📁 program show the communication of CC100-MSP430
💻 H
字号:
/***********************************************************************************
    Filename: ITS_rf.h

    Copyright 2007 Texas Instruments, Inc.
***********************************************************************************/

#ifndef HAL_RF_H
#define HAL_RF_H

#include "ITS_types.h"

//----------------------------------------------------------------------------------
// Type declarations
//----------------------------------------------------------------------------------

// The following structure can be used when configuring the RF chip. SmartRF Studio
// can be used to export a predefined instance of this structure.
typedef struct {
    uint8 fsctrl1;    // Frequency synthesizer control.
    uint8 fsctrl0;    // Frequency synthesizer control.
    uint8 freq2;      // Frequency control word, high byte.
    uint8 freq1;      // Frequency control word, middle byte.
    uint8 freq0;      // Frequency control word, low byte.
    uint8 mdmcfg4;    // Modem configuration.
    uint8 mdmcfg3;    // Modem configuration.
    uint8 mdmcfg2;    // Modem configuration.
    uint8 mdmcfg1;    // Modem configuration.
    uint8 mdmcfg0;    // Modem configuration.
    uint8 channr;     // Channel number.
    uint8 deviatn;    // Modem deviation setting (when FSK modulation is enabled).
    uint8 frend1;     // Front end RX configuration.
    uint8 frend0;     // Front end RX configuration.
    uint8 mcsm0;      // Main Radio Control State Machine configuration.
    uint8 foccfg;     // Frequency Offset Compensation Configuration.
    uint8 bscfg;      // Bit synchronization Configuration.
    uint8 agcctrl2;   // AGC control.
    uint8 agcctrl1;   // AGC control.
    uint8 agcctrl0;   // AGC control.
    uint8 fscal3;     // Frequency synthesizer calibration.
    uint8 fscal2;     // Frequency synthesizer calibration.
    uint8 fscal1;     // Frequency synthesizer calibration.
    uint8 fscal0;     // Frequency synthesizer calibration.
    uint8 fstest;     // Frequency synthesizer calibration.
    uint8 test2;      // Various test settings.
    uint8 test1;      // Various test settings.
    uint8 test0;      // Various test settings.
    uint8 iocfg2;     // GDO2 output pin configuration.
    uint8 iocfg0;     // GDO0 output pin configuration.
    uint8 pktctrl1;   // Packet automation control.
    uint8 pktctrl0;   // Packet automation control.
    uint8 addr;       // Device address.
    uint8 pktlen;     // Packet length.
    uint8 sync1;      // Msb of sync
    uint8 sync0;      // Lsb of sync
} HAL_RF_CONFIG;

// For rapid chip configuration with a minimum of function overhead.
// The array has to be set up with predefined values for all registers.
typedef uint8 HAL_RF_BURST_CONFIG[47];

// The chip status byte, returned by chip for all SPI accesses
typedef uint8 HAL_RF_STATUS;



//----------------------------------------------------------------------------------
// Function declarations
//----------------------------------------------------------------------------------

void  ITSRfConfigCC1100(const HAL_RF_CONFIG* rfConfig, const uint8* rfPaTable, uint8 rfPaTableLen);
void  ITSRfBurstConfig(const HAL_RF_BURST_CONFIG rfConfig, const uint8* rfPaTable, uint8 rfPaTableLen);
void  ITSRfResetChip(void);
uint8 ITSRfGetChipId(void);
uint8 ITSRfGetChipVer(void);
uint8 ITSRfReadStatusReg(uint8 addr);
uint8 ITSRfReadReg(uint8 addr);

HAL_RF_STATUS ITSRfWriteReg(uint8 addr, uint8 data);
HAL_RF_STATUS ITSRfWriteFifo(const uint8* data, uint8 length);
HAL_RF_STATUS ITSRfReadFifo(uint8* data, uint8 length);
HAL_RF_STATUS ITSRfStrobe(uint8 cmd);
HAL_RF_STATUS ITSRfGetTxStatus(void);
HAL_RF_STATUS ITSRfGetRxStatus(void);


/**********************************************************************************/
#endif

⌨️ 快捷键说明

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