示例#1
0
void rf_set_rx(RF_RX_INFO *pRRI, uint8_t channel)
{
    rf_flush_rx_fifo();
    rf_set_channel(channel);
    rfSettings.pRxInfo = pRRI;
		MRF_FSM_RESET();
}
示例#2
0
void rf_polling_rx_on(void)
{
    rf_flush_rx_fifo();
    rfSettings.receiveOn = true;
    rx_ready = 1;
    mrf_write_short(BBREG1, 0x00);
    // TODO: Paul Gurniak, not sure if there is anything different between these?
}
示例#3
0
/**********************************************************
 * set the radio into "normal" mode (buffered TXFIFO) and go into (data) receive */
void rf_data_mode() {
#ifdef RADIO_PRIORITY_CEILING
nrk_sem_pend(radio_sem);
#endif
        cc2420Strobe(CC2420_SRFOFF); //stop radio
        cc2420WriteReg(CC2420_MDMCTRL1, 0x0500); // default MDMCTRL1 value
        cc2420WriteReg(CC2420_DACTST, 0); // default value
        rf_flush_rx_fifo();
#ifdef RADIO_PRIORITY_CEILING
nrk_sem_post(radio_sem);
#endif
}
示例#4
0
/**********************************************************
 * set the radio into "normal" mode (buffered TXFIFO) and go into (data) receive */
void rf_data_mode() {
#ifdef RADIO_PRIORITY_CEILING
nrk_sem_pend(radio_sem);
#endif


        FASTSPI_STROBE(CC2420_SRFOFF); //stop radio
        FASTSPI_SETREG(CC2420_MDMCTRL1, 0x0500); // default MDMCTRL1 value
        FASTSPI_SETREG(CC2420_DACTST, 0); // default value
        rf_flush_rx_fifo();
#ifdef RADIO_PRIORITY_CEILING
nrk_sem_post(radio_sem);
#endif
}
示例#5
0
void rf_test_mode()
{

#ifdef RADIO_PRIORITY_CEILING
    nrk_sem_pend(radio_sem);
#endif
    FASTSPI_STROBE(CC2420_SRFOFF); //stop radio
    // NOTE ON SETTING CC2420_MDMCTRL1
    //
    // RF studio" uses TX_MODE=3 (CC2420_MDMCTRL1=0x050C)
    // to send an unmodulated carrier; data sheet says TX_MODE
    // can be 2 or 3. So it should not matter...
    // HOWEVER, using (TX_MODE=3) sometimes causes problems when
    // going back to "data" mode!
    FASTSPI_SETREG(CC2420_MDMCTRL1, 0x0508); // MDMCTRL1 with TX_MODE=2
    FASTSPI_SETREG(CC2420_DACTST, 0x1800); // send unmodulated carrier
    rf_flush_rx_fifo();

#ifdef RADIO_PRIORITY_CEILING
    nrk_sem_post(radio_sem);
#endif
}
示例#6
0
/**********************************************************
 * Put the radio in serial TX mode, where data is sampled from the FIFO
 * pin to send after SFD, and timing is done using FIFOP
 * use rf_carrier_on() to start, set FIFO to first bit, then wait for it
 * to go up and down, then set next bit etc.
 * NOTE: You must set the FIFO pin to output mode in order to do this!
 * This can be undone by calling rf_data_mode()
 */
void rf_tx_set_serial()
{
    FASTSPI_SETREG(CC2420_MDMCTRL1, 0x0504); // set TXMODE to 1
    rf_flush_rx_fifo();
}
示例#7
0
/**********************************************************
 * Set the radio into serial unbuffered RX mode
 * RX data is received through sampling the FIFO pin, timing is done using FIFOP
 * Use rf_rx_on() to start rcv, then wait for SFD / FIFOP. Sample during each high edge of FIFOP
 * This can be undone by using rf_data_mode()
 */
void rf_rx_set_serial()
{
    FASTSPI_STROBE(CC2420_SRFOFF);           // stop radio
    FASTSPI_SETREG(CC2420_MDMCTRL1, 0x0501); // Set RX_MODE to 1
    rf_flush_rx_fifo();
}
示例#8
0
/**********************************************************
 * Put the radio in serial TX mode, where data is sampled from the FIFO
 * pin to send after SFD, and timing is done using FIFOP
 * use rf_carrier_on() to start, set FIFO to first bit, then wait for it
 * to go up and down, then set next bit etc.
 * NOTE: You must set the FIFO pin to output mode in order to do this!
 * This can be undone by calling rf_data_mode()
 */
void rf_tx_set_serial()
{
    cc2420WriteReg(CC2420_MDMCTRL1, 0x0504); // set TXMODE to 1
    rf_flush_rx_fifo();
}
示例#9
0
/**********************************************************
 * Set the radio into serial unbuffered RX mode
 * RX data is received through sampling the FIFO pin, timing is done using FIFOP 
 * Use rf_rx_on() to start rcv, then wait for SFD / FIFOP. Sample during each high edge of FIFOP
 * This can be undone by using rf_data_mode()
 */
void rf_rx_set_serial()
{
    cc2420Strobe(CC2420_SRFOFF);           // stop radio
    cc2420WriteReg(CC2420_MDMCTRL1, 0x0501); // Set RX_MODE to 1
    rf_flush_rx_fifo();
}