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

📄 cc1100.lst

📁 用C语言开发环境编写的CC1100的通信案例程序
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V8.02   CC1100                                                                11/02/2007 10:01:25 PAGE 1   


C51 COMPILER V8.02, COMPILATION OF MODULE CC1100
OBJECT MODULE PLACED IN CC1100.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE CC1100.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          //
   2          //CC1100.h
   3          //
   4          // Copyright (c) NewMSG. All rights reserved. 2007
   5          // purpose : Test CC1100
   6          // http://www.newmsg.com        
   7          // http://www.newmsg.com/bbs
   8          
   9          // [public]
  10          
  11          #include <reg52.h>
  12          #include <intrins.h>
  13          #include "CC1100.h"
  14          
  15          
  16          #define         WRITE_BURST             0x40                                            //连续写入
  17          #define         READ_SINGLE             0x80                                            //读
  18          #define         READ_BURST              0xC0                                            //连续读
  19          #define         BYTES_IN_RXFIFO     0x7F                                                //接收缓冲区的有效字节数
  20          #define         CRC_OK              0x80                                                //CRC校验通过位标志
  21          
  22          /****************************************************************************************
  23          //全局变量定义
  24          /****************************************************************************************/
  25          /*
  26          //10k E
  27          RF_SETTINGS code rfSettings = {
  28                  0x00,
  29              0x06,   // FSCTRL1   Frequency synthesizer control.
  30              0x00,   // FSCTRL0   Frequency synthesizer control.
  31              0x10,   // FREQ2     Frequency control word, high byte.
  32              0xA7,   // FREQ1     Frequency control word, middle byte.
  33              0x62,   // FREQ0     Frequency control word, low byte.
  34              0xC8,   // MDMCFG4   Modem configuration.
  35              0x93,   // MDMCFG3   Modem configuration.
  36              0x03,   // MDMCFG2   Modem configuration.
  37              0x22,   // MDMCFG1   Modem configuration.
  38              0xF8,   // MDMCFG0   Modem configuration.
  39              0x00,   // CHANNR    Channel number.
  40              0x34,   // DEVIATN   Modem deviation setting (when FSK modulation is enabled).
  41              0x56,   // FREND1    Front end RX configuration.
  42              0x10,   // FREND0    Front end RX configuration.
  43              0x18,   // MCSM0     Main Radio Control State Machine configuration.
  44              0x16,   // FOCCFG    Frequency Offset Compensation Configuration.
  45              0x6C,   // BSCFG     Bit synchronization Configuration.
  46              0x43,   // AGCCTRL2  AGC control.
  47              0x40,   // AGCCTRL1  AGC control.
  48              0x91,   // AGCCTRL0  AGC control.
  49              0xA9,   // FSCAL3    Frequency synthesizer calibration.
  50              0x2A,   // FSCAL2    Frequency synthesizer calibration.
  51              0x00,   // FSCAL1    Frequency synthesizer calibration.
  52              0x11,   // FSCAL0    Frequency synthesizer calibration.
  53              0x59,   // FSTEST    Frequency synthesizer calibration.
  54              0x81,   // TEST2     Various test settings.
  55              0x35,   // TEST1     Various test settings.
C51 COMPILER V8.02   CC1100                                                                11/02/2007 10:01:25 PAGE 2   

  56              0x09,   // TEST0     Various test settings.
  57              0x0B,   // IOCFG2    GDO2 output pin configuration.
  58              0x06,   // IOCFG0D   GDO0 output pin configuration. Refer to SmartRF?Studio User Manual for detailed p
             -seudo register explanation.
  59              0x04,   // PKTCTRL1  Packet automation control.
  60              0x05,   // PKTCTRL0  Packet automation control.
  61              0x00,   // ADDR      Device address.
  62              0xFF    // PKTLEN    Packet length.
  63          };
  64          */
  65          /*
  66          // 250k E
  67          const RF_SETTINGS rfSettings = {
  68                  0x00,
  69              0x0B,   // FSCTRL1   Frequency synthesizer control.
  70              0x00,   // FSCTRL0   Frequency synthesizer control.
  71              0x10,   // FREQ2     Frequency control word, high byte.
  72              0xA7,   // FREQ1     Frequency control word, middle byte.
  73              0x62,   // FREQ0     Frequency control word, low byte.
  74              0x2D,   // MDMCFG4   Modem configuration.
  75              0x3B,   // MDMCFG3   Modem configuration.
  76              0x73,   // MDMCFG2   Modem configuration.
  77              0x22,   // MDMCFG1   Modem configuration.
  78              0xF8,   // MDMCFG0   Modem configuration.
  79          
  80              0x00,   // CHANNR    Channel number.
  81              0x00,   // DEVIATN   Modem deviation setting (when FSK modulation is enabled).
  82              0xB6,   // FREND1    Front end RX configuration.
  83              0x10,   // FREND0    Front end RX configuration.
  84              0x18,   // MCSM0     Main Radio Control State Machine configuration.
  85              0x1D,   // FOCCFG    Frequency Offset Compensation Configuration.
  86              0x1C,   // BSCFG     Bit synchronization Configuration.
  87              0xC7,   // AGCCTRL2  AGC control.
  88              0x00,   // AGCCTRL1  AGC control.
  89              0xB2,   // AGCCTRL0  AGC control.
  90          
  91              0xEA,   // FSCAL3    Frequency synthesizer calibration.
  92              0x0A,   // FSCAL2    Frequency synthesizer calibration.
  93              0x00,   // FSCAL1    Frequency synthesizer calibration.
  94              0x11,   // FSCAL0    Frequency synthesizer calibration.
  95              0x59,   // FSTEST    Frequency synthesizer calibration.
  96              0x88,   // TEST2     Various test settings.
  97              0x31,   // TEST1     Various test settings.
  98              0x0B,   // TEST0     Various test settings.
  99              0x0B,   // IOCFG2    GDO2 output pin configuration.
 100              0x06,   // IOCFG0D   GDO0 output pin configuration. Refer to SmartRF?Studio User Manual for detailed p
             -seudo register explanation.
 101          
 102              0x04,   // PKTCTRL1  Packet automation control.
 103              0x05,   // PKTCTRL0  Packet automation control.
 104              0x00,   // ADDR      Device address.
 105              0x0c    // PKTLEN    Packet length.
 106          };
 107           */
 108          
 109           // 250k E  Sensitivity 变长数据包 地址检测     crc
 110          const RF_SETTINGS rfSettings = {
 111                  0x00,
 112              0x0B,   // FSCTRL1   Frequency synthesizer control.
 113              0x00,   // FSCTRL0   Frequency synthesizer control.
 114              0x10,   // FREQ2     Frequency control word, high byte.
 115              0xA7,   // FREQ1     Frequency control word, middle byte.
C51 COMPILER V8.02   CC1100                                                                11/02/2007 10:01:25 PAGE 3   

 116              0x62,   // FREQ0     Frequency control word, low byte.
 117              0x2D,   // MDMCFG4   Modem configuration.
 118              0x3B,   // MDMCFG3   Modem configuration.
 119              0x73,   // MDMCFG2   Modem configuration.
 120              0x22,   // MDMCFG1   Modem configuration.
 121              0xF8,   // MDMCFG0   Modem configuration.
 122          
 123              0x00,   // CHANNR    Channel number.
 124              0x00,   // DEVIATN   Modem deviation setting (when FSK modulation is enabled).
 125              0xB6,   // FREND1    Front end RX configuration.
 126              0x10,   // FREND0    Front end RX configuration.
 127              0x18,   // MCSM0     Main Radio Control State Machine configuration.
 128              0x1D,   // FOCCFG    Frequency Offset Compensation Configuration.
 129              0x1C,   // BSCFG     Bit synchronization Configuration.
 130              0xC7,   // AGCCTRL2  AGC control.
 131              0x00,   // AGCCTRL1  AGC control.
 132              0xB2,   // AGCCTRL0  AGC control.
 133          
 134              0xEA,   // FSCAL3    Frequency synthesizer calibration.
 135              0x0A,   // FSCAL2    Frequency synthesizer calibration.
 136              0x00,   // FSCAL1    Frequency synthesizer calibration.
 137              0x11,   // FSCAL0    Frequency synthesizer calibration.
 138              0x59,   // FSTEST    Frequency synthesizer calibration.
 139              0x88,   // TEST2     Various test settings.
 140              0x31,   // TEST1     Various test settings.
 141              0x0B,   // TEST0     Various test settings.
 142              0x0B,   // IOCFG2    GDO2 output pin configuration.
 143              0x06,   // IOCFG0D   GDO0 output pin configuration. Refer to SmartRF?Studio User Manual for detailed p
             -seudo register explanation.
 144          
 145              0x04,   // PKTCTRL1  Packet automation control.      
 146              0x45,   // PKTCTRL0  Packet automation control.      //可变长数据包,通过同步词汇后的第一个位置配置数据包长
             -度
 147              0xAA,   // ADDR      Device address.
 148              0xFF    // PKTLEN    Packet length. 28bytes
 149          };
 150          
 151          /*
 152           // 38.4k  E
 153           const RF_SETTINGS rfSettings = {
 154                  0x00,
 155              0x06,   // FSCTRL1   Frequency synthesizer control.

⌨️ 快捷键说明

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