📄 sppsetuprf.c
字号:
/*****************************************************************************
* *
* ********** *
* ************ *
* *** *** *
* *** +++ *** *
* *** + + *** *
* *** + CHIPCON CC1010 *
* *** + + *** CUL - spp *
* *** +++ *** *
* *** *** *
* *********** *
* ********* *
* *
*****************************************************************************
* *
*****************************************************************************
* Author: JOL *
*****************************************************************************
* Revision history: *
* *
* $Log: sppSetupRF.c,v $
* Revision 1.4 2003/04/29 10:49:44 tos
* Removed timer initialization from sppSetupRF (including the clkFreq argument)
*
* Revision 1.3 2002/11/20 14:05:55 kht
* Added comment to inform user that calling sppSetupRF clears the callback settings
*
* Revision 1.2 2002/11/18 13:39:10 tos
* Initialisation of pointers to timer callback functions before timer
* interrupt is started/enabled.
*
* Revision 1.1 2002/10/14 12:27:34 tos
* Initial version in CVS.
*
* *
****************************************************************************/
#include <chipcon/sppInternal.h>
//----------------------------------------------------------------------------
// void sppSetupRF (...)
//
// Description:
// Set up SPP for transmission or reception.
// Call this function to (re)calibrate the radio, or to switch between
// different RF settings.
//
// Arguments:
// RF_RXTXPAIR_SETTINGS code* pRF_SETTINGS
// RF settings (frequencies, modem settings, etc.)
//
// RF_RXTXPAIR_CALDATA xdata* pRF_CALDATA
// Calibration results
//
// bool calibrate
// Calibrate now. *pRF_CALDATA is written to when calibrate = TRUE,
// and read from otherwise. Use FALSE if *pRF_CALDATA is valid.
//----------------------------------------------------------------------------
void sppSetupRF (RF_RXTXPAIR_SETTINGS code *pRF_SETTINGS, RF_RXTXPAIR_CALDATA xdata *pRF_CALDATA, bool calibrate) {
// Default synchronization settings
RF_SET_PREAMBLE_COUNT(SPP_PREAMBLE_SENSE_BITS);
RF_SET_SYNC_BYTE(RF_SUITABLE_SYNC_BYTE);
// Update the internal pointers
sppIntData.pRF_SETTINGS = pRF_SETTINGS;
sppIntData.pRF_CALDATA = pRF_CALDATA;
// Calibrate with the new/current settings
if (calibrate) {
halRFCalib (sppIntData.pRF_SETTINGS, sppIntData.pRF_CALDATA);
}
// Make sure that we're in IDLE mode
sppIntData.mode = SPP_IDLE_MODE;
} // sppSetupRF
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -