1. 首页
  2. 编程语言
  3. C
  4. cc2510收发源程序

cc2510收发源程序

上传者: 2018-12-29 00:20:56上传 RAR文件 236.03KB 热度 36次
void radioConfigure_rx() { PA_TABLE0 = 0xFE;//1=0xff,-2=0xbf,-6=0x7f,-10=0xcb,-16=0x87,-20=0xc1,-30=0x44 /* FREQ2 = 0x5F;// 2480 MHz FREQ1 = 0x62; FREQ0 = 0x76;*/ FREQ2 = 0x5E;// 2460 MHz FREQ1 = 0x9D; FREQ0 = 0x89; /* FREQ2 = 0x5D;// 2440 MHz FREQ1 = 0xD8; FREQ0 = 0x9D; FREQ2 = 0x5D;// 2420 MHz FREQ1 = 0x13; FREQ0 = 0xB1; */ FSCTRL1 = 0x0A; // Frequency synthesizer control. FSCTRL0 = 0x00; // Frequency synthesizer control. MDMCFG4 = 0x2D; // Modem configuration. MDMCFG3 = 0x3B; // Modem configuration. MDMCFG2 = 0x73; // Modem configuration. MDMCFG1 = 0x22; // Modem configuration. MDMCFG0 = 0xF8; // Modem configuration. DEVIATN = 0x00; // Modem deviation setting (when FSK modulation is enabled). FREND1 = 0xB6; // Front end RX configuration. FREND0 = 0x10; // Front end RX configuration. MCSM0 = 0x14; // Main Radio Control State Machine configuration. FOCCFG = 0x1D; // Frequency Offset Compensation Configuration. BSCFG = 0x1C; // Bit synchronization Configuration. AGCCTRL2 = 0xC7; // AGC control. AGCCTRL1 = 0x00; // AGC control. AGCCTRL0 = 0xB2; // AGC control. FSCAL3 = 0xEA; // Frequency synthesizer calibration. FSCAL2 = 0x0A; // Frequency synthesizer calibration. FSCAL0 = 0x11; // Frequency synthesizer calibration. TEST2 = 0x88; // Various test settings. TEST1 = 0x31; // Various test settings. TEST0 = 0x0B; // Various test settings. // Common radio settings for CCxx10, any frequency and data rate CHANNR = 0x00; // Channel number. MCSM1 = 0x30; // Main Radio Control State Machine configuration. IOCFG2 = 0x0B; // GDO2 output pin configuration. IOCFG0 = 0x06; // GDO0 output pin configuration. Sync word. PKTCTRL1 = 0x04; // Packet automation control. PKTCTRL0 = 0x45; // Packet automation control. Data whitening on. ADDR = 0x00; // Device address. Not used. PKTLEN = PACKET_LENGTH_RX; // Packet length. return; } // Frequency synthesizer control. FSCTRL0 = 0x00; // Frequency synthesizer control. MDMCFG4 = 0x2D; // Modem configuration. MDMCFG3 = 0x3B; // Modem configuration. MDMCFG2 = 0x73; // Modem configuration. MDMCFG1 = 0x22; // Modem configuration. MDMCFG0 = 0xF8; // Modem configuration. DEVIATN = 0x00; // Modem deviation setting (when FSK modulation is enabled). FREND1 = 0xB6; // Front end RX configuration. FREND0 = 0x10; // Front end RX configuration. MCSM0 = 0x14; // Main Radio Control State Machine configuration. FOCCFG = 0x1D; // Frequency Offset Compensation Configuration. BSCFG = 0x1C; // Bit synchronization Configuration. AGCCTRL2 = 0xC7; // AGC control. AGCCTRL1 = 0x00; // AGC control. AGCCTRL0 = 0xB2; // AGC control. FSCAL3 = 0xEA; // Frequency synthesizer calibration. FSCAL2 = 0x0A; // Frequency synthesizer calibration. FSCAL0 = 0x11; // Frequency synthesizer calibration. TEST2 = 0x88; // Various test settings. TEST1 = 0x31; // Various test settings. TEST0 = 0x0B; // Various test settings. // Common radio settings for CCxx10, any frequency and data rate CHANNR = 0x00; // Channel number. MCSM1 = 0x30; // Main Radio Control State Machine configuration. IOCFG2 = 0x0B; // GDO2 output pin configuration. IOCFG0 = 0x06; // GDO0 output pin configuration. Sync word. PKTCTRL1 = 0x04; // Packet automation control. PKTCTRL0 = 0x45; // Packet automation control. Data whitening on. ADDR = 0x00; // Device address. Not used. PKTLEN = PACKET_LENGTH_RX; // Packet length. return; }
用户评论