/******************************************************************************************************* * * * ********** * * ************ * * *** *** * * *** +++ *** * * *** + + *** * * *** + CHIPCON CC2420 BASIC RF LIBRARY * * *** + + *** Packet reception * * *** +++ *** * * *** *** * * ************ * * ********** * * * ******************************************************************************************************* * This file contains functions used to enable and disable for packet reception, and the FIFOP * * interrupt which handles the packet reception. The application must define the * * basicRfReceivePacket() function, which is called when a packet has been successfully received. * * * * More information can be found in basic_rf.h * ******************************************************************************************************* * Compiler: AVR-GCC, IAR 3.2, MSP430-GCC * * Target platform: CC2420DB, CC2420 + any MCU with very few modifications required * ******************************************************************************************************* * Revision history: * * $Log: basic_rf_receive.c,v $ * Revision 1.4 2004/07/26 11:28:10 mbr * Modified RXFIFO flushing by strobing CC2420_SFLUSHRX * * Revision 1.3 2004/03/30 14:59:22 mbr * Release for web * * * *******************************************************************************************************/ #include "include.h" UINT8 spiCnt; UINT8 i; //------------------------------------------------------------------------------------------------------- // void halRfReceiveOn(void) // // DESCRIPTION: // Enables the CC2420 receiver and the FIFOP interrupt. When a packet is received through this // interrupt, it will call halRfReceivePacket(...), which must be defined by the application //------------------------------------------------------------------------------------------------------- void basicRfReceiveOn(void) { printf("Turning on the receiver...\r\n"); rfSettings.receiveOn = TRUE; FASTSPI_STROBE(CC2420_SRXON); FASTSPI_STROBE(CC2420_SFLUSHRX); FIFOP_INT_INIT(); ENABLE_FIFOP_INT(); } // basicRfReceiveOn //------------------------------------------------------------------------------------------------------- // void halRfReceiveOff(void) // // DESCRIPTION: // Disables the CC2420 receiver and the FIFOP interrupt. //------------------------------------------------------------------------------------------------------- void basicRfReceiveOff(void) { rfSettings.receiveOn = FALSE; FASTSPI_STROBE(CC2420_SRFOFF); DISABLE_FIFOP_INT(); } // basicRfReceiveOff