cc2510收发源程序
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; }
下载地址
用户评论
看了评论下载的,很多地方还是值得参考的,感谢分享
如前人所述,代码是写的挺乱,但是主要的收发部分是可以用的,用DMA进行收发。有个参考总比自己写控制寄存器的代码强多了
程序不能运行,不过程序内容对于理解cc2510还是很有帮助的
写的比较好,比较适合有一定经验的阅读
程序写的太乱了,注释也不是很清楚,不适合新手学习。不过还是非常感谢!